Boxzilla - Version 3.2.6

Version Description

Download this release

Release Info

Developer DvanKooten
Plugin Icon 128x128 Boxzilla
Version 3.2.6
Comparing to
See all releases

Code changes from version 3.2.5 to 3.2.6

assets/browserify/admin/_admin.js CHANGED
@@ -17,12 +17,15 @@
17
  var Designer = require('./_designer.js')($, Option, events);
18
  var rowTemplate = wp.template('rule-row-template');
19
  var i18n = boxzilla_i18n;
 
 
20
 
21
  // events
22
  $optionControls.on('click', ".boxzilla-add-rule", addRuleFields);
23
  $optionControls.on('click', ".boxzilla-remove-rule", removeRule);
24
  $optionControls.on('change', ".boxzilla-rule-condition", setContextualHelpers);
25
  $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);
 
26
 
27
  $(window).load(function () {
28
  if (typeof(window.tinyMCE) === "undefined") {
@@ -33,12 +36,23 @@
33
  // call contextual helper method for each row
34
  $('.boxzilla-rule-row').each(setContextualHelpers);
35
 
 
 
 
 
 
36
  function toggleTriggerOptions() {
37
  $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');
38
  }
39
 
40
  function removeRule() {
41
- $(this).parents('tr').remove();
 
 
 
 
 
 
42
  }
43
 
44
  function setContextualHelpers() {
@@ -143,10 +157,11 @@
143
 
144
  function addRuleFields() {
145
  var data = {
146
- 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length
 
147
  };
148
  var html = rowTemplate(data);
149
- $(document.getElementById('boxzilla-box-rules')).after(html);
150
  return false;
151
  }
152
 
17
  var Designer = require('./_designer.js')($, Option, events);
18
  var rowTemplate = wp.template('rule-row-template');
19
  var i18n = boxzilla_i18n;
20
+ var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');
21
+ var rulesContainerEl = document.getElementById('boxzilla-box-rules');
22
 
23
  // events
24
  $optionControls.on('click', ".boxzilla-add-rule", addRuleFields);
25
  $optionControls.on('click', ".boxzilla-remove-rule", removeRule);
26
  $optionControls.on('change', ".boxzilla-rule-condition", setContextualHelpers);
27
  $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);
28
+ $(ruleComparisonEl).change(toggleAndOrTexts);
29
 
30
  $(window).load(function () {
31
  if (typeof(window.tinyMCE) === "undefined") {
36
  // call contextual helper method for each row
37
  $('.boxzilla-rule-row').each(setContextualHelpers);
38
 
39
+ function toggleAndOrTexts() {
40
+ var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;
41
+ $('.boxzilla-andor').text(newText);
42
+ }
43
+
44
  function toggleTriggerOptions() {
45
  $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');
46
  }
47
 
48
  function removeRule() {
49
+ var row = $(this).parents('tr');
50
+
51
+ // delete andor row
52
+ row.prev().remove();
53
+
54
+ // delete rule row
55
+ row.remove();
56
  }
57
 
58
  function setContextualHelpers() {
157
 
158
  function addRuleFields() {
159
  var data = {
160
+ 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length,
161
+ 'andor': ruleComparisonEl.value === 'any' ? i18n.or : i18n.and,
162
  };
163
  var html = rowTemplate(data);
164
+ $(rulesContainerEl).append(html);
165
  return false;
166
  }
167
 
assets/css/admin-styles.css CHANGED
@@ -68,6 +68,13 @@
68
  #boxzilla-admin .status.negative {
69
  background: #c3c3c3; }
70
 
 
 
 
 
 
 
 
71
  .boxzilla-is-dismissible {
72
  padding-right: 38px;
73
  position: relative; }
68
  #boxzilla-admin .status.negative {
69
  background: #c3c3c3; }
70
 
71
+ .boxzilla-muted {
72
+ color: #888; }
73
+
74
+ .boxzilla-no-vpadding {
75
+ padding-top: 0 !important;
76
+ padding-bottom: 0 !important; }
77
+
78
  .boxzilla-is-dismissible {
79
  padding-right: 38px;
80
  position: relative; }
assets/css/admin-styles.min.css CHANGED
@@ -1 +1 @@
1
- .boxzilla-rule-row-0 .boxzilla-close{visibility:hidden}.column-box_id{width:80px}.boxzilla-sm{width:150px}.boxzilla-xsm{width:15px}.boxzilla-title{margin-top:2em!important}.boxzilla-label{display:block;font-weight:700;margin-bottom:6px}.boxzilla-close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;font-size:21px;font-weight:700;line-height:26px;text-shadow:0 1px 0 #fff;opacity:.3;filter:alpha(opacity=30)}.boxzilla-close:focus,.boxzilla-close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.6;filter:alpha(opacity=60)}.post-type-boxzilla-box .form-table{table-layout:fixed}.post-type-boxzilla-box .window-positions{border:1px solid #EEE}.post-type-boxzilla-box .window-positions td{padding:3px;margin-bottom:0}.post-type-boxzilla-box .wp-picker-container{white-space:nowrap}.post-type-boxzilla-box .wp-picker-clear,.post-type-boxzilla-box .wp-picker-holder,.post-type-boxzilla-box .wp-picker-input-wrap{background:#fff;z-index:999!important;position:absolute!important}#boxzilla-admin .status{display:inline-block;padding:3px 6px;color:#fff;text-transform:uppercase;font-weight:700}#boxzilla-admin .status.positive{background-color:#32cd32}#boxzilla-admin .status.negative{background:#c3c3c3}.boxzilla-is-dismissible{padding-right:38px;position:relative}.radio-label{font-weight:400}.radio-label>input{margin-top:0!important}.boxzilla-row{margin:0 -20px}.boxzilla-col-one-third,.boxzilla-col-two-third{float:left;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px}.boxzilla-col-two-third{width:66.66%}.boxzilla-col-one-third{width:33.33%}.boxzilla-sidebar{margin-top:10px}.boxzilla-box{background:#fff;padding:20px;margin-bottom:20px;border:1px solid #ccc}.boxzilla-box :first-child,.boxzilla-box h3{margin-top:0}.boxzilla-box :last-child{margin-bottom:0}.boxzilla-sidebar form label{display:block;font-weight:700;margin-bottom:6px}@media (max-width:920px){.boxzilla-row{margin:0}.boxzilla-col-one-third,.boxzilla-col-two-third{float:none;padding:0;width:auto}.boxzilla-sidebar{margin-top:40px}}
1
+ .boxzilla-rule-row-0 .boxzilla-close{visibility:hidden}.column-box_id{width:80px}.boxzilla-sm{width:150px}.boxzilla-xsm{width:15px}.boxzilla-title{margin-top:2em!important}.boxzilla-label{display:block;font-weight:700;margin-bottom:6px}.boxzilla-close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;font-size:21px;font-weight:700;line-height:26px;text-shadow:0 1px 0 #fff;opacity:.3;filter:alpha(opacity=30)}.boxzilla-close:focus,.boxzilla-close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.6;filter:alpha(opacity=60)}.post-type-boxzilla-box .form-table{table-layout:fixed}.post-type-boxzilla-box .window-positions{border:1px solid #EEE}.post-type-boxzilla-box .window-positions td{padding:3px;margin-bottom:0}.post-type-boxzilla-box .wp-picker-container{white-space:nowrap}.post-type-boxzilla-box .wp-picker-clear,.post-type-boxzilla-box .wp-picker-holder,.post-type-boxzilla-box .wp-picker-input-wrap{background:#fff;z-index:999!important;position:absolute!important}#boxzilla-admin .status{display:inline-block;padding:3px 6px;color:#fff;text-transform:uppercase;font-weight:700}#boxzilla-admin .status.positive{background-color:#32cd32}#boxzilla-admin .status.negative{background:#c3c3c3}.boxzilla-muted{color:#888}.boxzilla-no-vpadding{padding-top:0!important;padding-bottom:0!important}.boxzilla-is-dismissible{padding-right:38px;position:relative}.radio-label{font-weight:400}.radio-label>input{margin-top:0!important}.boxzilla-row{margin:0 -20px}.boxzilla-col-one-third,.boxzilla-col-two-third{float:left;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px}.boxzilla-col-two-third{width:66.66%}.boxzilla-col-one-third{width:33.33%}.boxzilla-sidebar{margin-top:10px}.boxzilla-box{background:#fff;padding:20px;margin-bottom:20px;border:1px solid #ccc}.boxzilla-box :first-child,.boxzilla-box h3{margin-top:0}.boxzilla-box :last-child{margin-bottom:0}.boxzilla-sidebar form label{display:block;font-weight:700;margin-bottom:6px}@media (max-width:920px){.boxzilla-row{margin:0}.boxzilla-col-one-third,.boxzilla-col-two-third{float:none;padding:0;width:auto}.boxzilla-sidebar{margin-top:40px}}
assets/js/admin-script.js CHANGED
@@ -25,12 +25,15 @@ window.Boxzilla_Admin = require('./admin/_admin.js');
25
  var Designer = require('./_designer.js')($, Option, events);
26
  var rowTemplate = wp.template('rule-row-template');
27
  var i18n = boxzilla_i18n;
 
 
28
 
29
  // events
30
  $optionControls.on('click', ".boxzilla-add-rule", addRuleFields);
31
  $optionControls.on('click', ".boxzilla-remove-rule", removeRule);
32
  $optionControls.on('change', ".boxzilla-rule-condition", setContextualHelpers);
33
  $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);
 
34
 
35
  $(window).load(function () {
36
  if (typeof window.tinyMCE === "undefined") {
@@ -41,12 +44,23 @@ window.Boxzilla_Admin = require('./admin/_admin.js');
41
  // call contextual helper method for each row
42
  $('.boxzilla-rule-row').each(setContextualHelpers);
43
 
 
 
 
 
 
44
  function toggleTriggerOptions() {
45
  $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');
46
  }
47
 
48
  function removeRule() {
49
- $(this).parents('tr').remove();
 
 
 
 
 
 
50
  }
51
 
52
  function setContextualHelpers() {
@@ -151,10 +165,11 @@ window.Boxzilla_Admin = require('./admin/_admin.js');
151
 
152
  function addRuleFields() {
153
  var data = {
154
- 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length
 
155
  };
156
  var html = rowTemplate(data);
157
- $(document.getElementById('boxzilla-box-rules')).after(html);
158
  return false;
159
  }
160
 
25
  var Designer = require('./_designer.js')($, Option, events);
26
  var rowTemplate = wp.template('rule-row-template');
27
  var i18n = boxzilla_i18n;
28
+ var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');
29
+ var rulesContainerEl = document.getElementById('boxzilla-box-rules');
30
 
31
  // events
32
  $optionControls.on('click', ".boxzilla-add-rule", addRuleFields);
33
  $optionControls.on('click', ".boxzilla-remove-rule", removeRule);
34
  $optionControls.on('change', ".boxzilla-rule-condition", setContextualHelpers);
35
  $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);
36
+ $(ruleComparisonEl).change(toggleAndOrTexts);
37
 
38
  $(window).load(function () {
39
  if (typeof window.tinyMCE === "undefined") {
44
  // call contextual helper method for each row
45
  $('.boxzilla-rule-row').each(setContextualHelpers);
46
 
47
+ function toggleAndOrTexts() {
48
+ var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;
49
+ $('.boxzilla-andor').text(newText);
50
+ }
51
+
52
  function toggleTriggerOptions() {
53
  $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');
54
  }
55
 
56
  function removeRule() {
57
+ var row = $(this).parents('tr');
58
+
59
+ // delete andor row
60
+ row.prev().remove();
61
+
62
+ // delete rule row
63
+ row.remove();
64
  }
65
 
66
  function setContextualHelpers() {
165
 
166
  function addRuleFields() {
167
  var data = {
168
+ 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length,
169
+ 'andor': ruleComparisonEl.value === 'any' ? i18n.or : i18n.and
170
  };
171
  var html = rowTemplate(data);
172
+ $(rulesContainerEl).append(html);
173
  return false;
174
  }
175
 
assets/js/admin-script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var e=void 0,t=void 0;!function(){function t(n,o,r){function i(s,a){if(!o[s]){if(!n[s]){var u="function"==typeof e&&e;if(!a&&u)return u(s,!0);if(l)return l(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=o[s]={exports:{}};n[s][0].call(p.exports,function(e){var t=n[s][1][e];return i(t||e)},p,p.exports,t,n,o,r)}return o[s].exports}for(var l="function"==typeof e&&e,s=0;s<r.length;s++)i(r[s]);return i}return t}()({1:[function(e,t,n){"use strict";window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(e,t,n){"use strict";!function(){function n(){var e="tr"===this.tagName.toLowerCase()?this:o(this).parents("tr").get(0),t=e.querySelector(".boxzilla-rule-condition").value,n=e.querySelector(".boxzilla-rule-value"),r=e.querySelector(".boxzilla-rule-qualifier"),i=n.cloneNode(!0),l=o(i);switch(o(e.querySelectorAll(".boxzilla-helper")).remove(),i.removeAttribute("name"),i.className=i.className+" boxzilla-helper",n.parentNode.insertBefore(i,n.nextSibling),l.change(function(){n.value=this.value}),i.style.display="",n.style.display="none",r.style.display="",r.querySelector('option[value="not_contains"]').style.display="none",r.querySelector('option[value="contains"]').style.display="none",s.parentNode&&s.parentNode.removeChild(s),t){default:i.placeholder=p.enterCommaSeparatedValues;break;case"":case"everywhere":r.value="1",n.value="",i.style.display="none",r.style.display="none";break;case"is_single":case"is_post":i.placeholder=p.enterCommaSeparatedPosts,l.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":i.placeholder=p.enterCommaSeparatedPages,l.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":i.placeholder=p.enterCommaSeparatedPostTypes,l.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":r.querySelector('option[value="contains"]').style.display="",r.querySelector('option[value="not_contains"]').style.display="",i.placeholder=p.enterCommaSeparatedRelativeUrls;break;case"is_post_in_category":l.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=category",{multiple:!0,multipleSep:","});break;case"is_post_with_tag":l.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_tag",{multiple:!0,multipleSep:","});break;case"is_user_logged_in":i.style.display="none",n.parentNode.insertBefore(s,n.nextSibling);break;case"is_referer":r.querySelector('option[value="contains"]').style.display="",r.querySelector('option[value="not_contains"]').style.display=""}}var o=window.jQuery,r=e("./_option.js"),i=document.getElementById("boxzilla-box-options-controls"),l=o(i),s=document.createTextNode(" logged in");if(0!==l.length){var a=new(e("wolfy87-eventemitter")),u=e("./_designer.js")(o,r,a),c=wp.template("rule-row-template"),p=boxzilla_i18n;l.on("click",".boxzilla-add-rule",function(){var e={key:i.querySelectorAll(".boxzilla-rule-row").length},t=c(e);return o(document.getElementById("boxzilla-box-rules")).after(t),!1}),l.on("click",".boxzilla-remove-rule",function(){o(this).parents("tr").remove()}),l.on("change",".boxzilla-rule-condition",n),l.find(".boxzilla-auto-show-trigger").on("change",function(){l.find(".boxzilla-trigger-options").toggle(""!==this.value)}),o(window).load(function(){void 0===window.tinyMCE&&(document.getElementById("notice-notinymce").style.display="")}),o(".boxzilla-rule-row").each(n),t.exports={Designer:u,Option:r,events:a}}}()},{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(e,t,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.exports=function(e,t,n){function r(){return!!c&&(s.css({"border-color":u.borderColor.getColorValue(),"border-width":u.borderWidth.getPxValue(),"border-style":u.borderStyle.getValue(),"background-color":u.backgroundColor.getColorValue(),width:u.width.getPxValue(),color:u.color.getColorValue()}),n.trigger("editor.styles.apply"),!0)}var i,l,s,a=document.getElementById("post_ID").value||0,u={},c=!1,p=e("#boxzilla-box-appearance-controls");return u.borderColor=new t("border-color"),u.borderWidth=new t("border-width"),u.borderStyle=new t("border-style"),u.backgroundColor=new t("background-color"),u.width=new t("width"),u.color=new t("color"),p.find("input.boxzilla-color-field").wpColorPicker({change:r,clear:r}),p.find(":input").not(".boxzilla-color-field").change(r),n.on("editor.init",r),{init:function(){"object"===o(window.tinyMCE)&&null!==tinyMCE.get("content")&&(l=e("#content_ifr"),(i=l.contents().find("html")).css({background:"white"}),(s=i.find("#tinymce")).addClass("boxzilla boxzilla-"+a),s.css({margin:0,background:"white",display:"inline-block",width:"auto","min-width":"240px",position:"relative"}),s.get(0).style.cssText+=";padding: 25px !important;",c=!0,n.trigger("editor.init"))},resetStyles:function(){for(var e in u)"theme"!==e.substring(0,5)&&u[e].clear();r(),n.trigger("editor.styles.reset")},options:u}}},{}],4:[function(e,t,n){"use strict";var o=window.jQuery,r=function(e){"string"==typeof e&&(e=document.getElementById("boxzilla-"+e)),e||console.error("Unable to find option element."),this.element=e};r.prototype.getColorValue=function(){return this.element.value.length>0?o(this.element).hasClass("wp-color-field")?o(this.element).wpColorPicker("color"):this.element.value:""},r.prototype.getPxValue=function(e){return this.element.value.length>0?parseInt(this.element.value)+"px":e||""},r.prototype.getValue=function(e){return this.element.value.length>0?this.element.value:e||""},r.prototype.clear=function(){this.element.value=""},r.prototype.setValue=function(e){this.element.value=e},t.exports=r},{}],5:[function(e,n,o){!function(e){"use strict";function o(){}function r(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function i(e){return function(){return this[e].apply(this,arguments)}}function l(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&l(e.listener)}var s=o.prototype,a=e.EventEmitter;s.getListeners=function(e){var t,n,o=this._getEvents();if(e instanceof RegExp){t={};for(n in o)o.hasOwnProperty(n)&&e.test(n)&&(t[n]=o[n])}else t=o[e]||(o[e]=[]);return t},s.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},s.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},s.addListener=function(e,t){if(!l(t))throw new TypeError("listener must be a function");var n,o=this.getListenersAsObject(e),i="object"==typeof t;for(n in o)o.hasOwnProperty(n)&&-1===r(o[n],t)&&o[n].push(i?t:{listener:t,once:!1});return this},s.on=i("addListener"),s.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},s.once=i("addOnceListener"),s.defineEvent=function(e){return this.getListeners(e),this},s.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},s.removeListener=function(e,t){var n,o,i=this.getListenersAsObject(e);for(o in i)i.hasOwnProperty(o)&&-1!==(n=r(i[o],t))&&i[o].splice(n,1);return this},s.off=i("removeListener"),s.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},s.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},s.manipulateListeners=function(e,t,n){var o,r,i=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(o=n.length;o--;)i.call(this,t,n[o]);else for(o in t)t.hasOwnProperty(o)&&(r=t[o])&&("function"==typeof r?i.call(this,o,r):l.call(this,o,r));return this},s.removeEvent=function(e){var t,n=typeof e,o=this._getEvents();if("string"===n)delete o[e];else if(e instanceof RegExp)for(t in o)o.hasOwnProperty(t)&&e.test(t)&&delete o[t];else delete this._events;return this},s.removeAllListeners=i("removeEvent"),s.emitEvent=function(e,t){var n,o,r,i,l=this.getListenersAsObject(e);for(i in l)if(l.hasOwnProperty(i))for(n=l[i].slice(0),r=0;r<n.length;r++)!0===(o=n[r]).once&&this.removeListener(e,o.listener),o.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,o.listener);return this},s.trigger=i("emitEvent"),s.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},s.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},s._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},s._getEvents=function(){return this._events||(this._events={})},o.noConflict=function(){return e.EventEmitter=a,o},"function"==typeof t&&t.amd?t(function(){return o}):"object"==typeof n&&n.exports?n.exports=o:e.EventEmitter=o}(this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=admin-script.min.js.map
1
+ !function(){var e=void 0,t=void 0;!function(){function t(n,o,r){function i(s,a){if(!o[s]){if(!n[s]){var u="function"==typeof e&&e;if(!a&&u)return u(s,!0);if(l)return l(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=o[s]={exports:{}};n[s][0].call(p.exports,function(e){var t=n[s][1][e];return i(t||e)},p,p.exports,t,n,o,r)}return o[s].exports}for(var l="function"==typeof e&&e,s=0;s<r.length;s++)i(r[s]);return i}return t}()({1:[function(e,t,n){"use strict";window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(e,t,n){"use strict";!function(){function n(){var e="tr"===this.tagName.toLowerCase()?this:o(this).parents("tr").get(0),t=e.querySelector(".boxzilla-rule-condition").value,n=e.querySelector(".boxzilla-rule-value"),r=e.querySelector(".boxzilla-rule-qualifier"),i=n.cloneNode(!0),l=o(i);switch(o(e.querySelectorAll(".boxzilla-helper")).remove(),i.removeAttribute("name"),i.className=i.className+" boxzilla-helper",n.parentNode.insertBefore(i,n.nextSibling),l.change(function(){n.value=this.value}),i.style.display="",n.style.display="none",r.style.display="",r.querySelector('option[value="not_contains"]').style.display="none",r.querySelector('option[value="contains"]').style.display="none",s.parentNode&&s.parentNode.removeChild(s),t){default:i.placeholder=p.enterCommaSeparatedValues;break;case"":case"everywhere":r.value="1",n.value="",i.style.display="none",r.style.display="none";break;case"is_single":case"is_post":i.placeholder=p.enterCommaSeparatedPosts,l.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":i.placeholder=p.enterCommaSeparatedPages,l.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":i.placeholder=p.enterCommaSeparatedPostTypes,l.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":r.querySelector('option[value="contains"]').style.display="",r.querySelector('option[value="not_contains"]').style.display="",i.placeholder=p.enterCommaSeparatedRelativeUrls;break;case"is_post_in_category":l.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=category",{multiple:!0,multipleSep:","});break;case"is_post_with_tag":l.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_tag",{multiple:!0,multipleSep:","});break;case"is_user_logged_in":i.style.display="none",n.parentNode.insertBefore(s,n.nextSibling);break;case"is_referer":r.querySelector('option[value="contains"]').style.display="",r.querySelector('option[value="not_contains"]').style.display=""}}var o=window.jQuery,r=e("./_option.js"),i=document.getElementById("boxzilla-box-options-controls"),l=o(i),s=document.createTextNode(" logged in");if(0!==l.length){var a=new(e("wolfy87-eventemitter")),u=e("./_designer.js")(o,r,a),c=wp.template("rule-row-template"),p=boxzilla_i18n,d=document.getElementById("boxzilla-rule-comparison"),f=document.getElementById("boxzilla-box-rules");l.on("click",".boxzilla-add-rule",function(){var e={key:i.querySelectorAll(".boxzilla-rule-row").length,andor:"any"===d.value?p.or:p.and},t=c(e);return o(f).append(t),!1}),l.on("click",".boxzilla-remove-rule",function(){var e=o(this).parents("tr");e.prev().remove(),e.remove()}),l.on("change",".boxzilla-rule-condition",n),l.find(".boxzilla-auto-show-trigger").on("change",function(){l.find(".boxzilla-trigger-options").toggle(""!==this.value)}),o(d).change(function(){var e="any"===d.value?p.or:p.and;o(".boxzilla-andor").text(e)}),o(window).load(function(){void 0===window.tinyMCE&&(document.getElementById("notice-notinymce").style.display="")}),o(".boxzilla-rule-row").each(n),t.exports={Designer:u,Option:r,events:a}}}()},{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(e,t,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.exports=function(e,t,n){function r(){return!!c&&(s.css({"border-color":u.borderColor.getColorValue(),"border-width":u.borderWidth.getPxValue(),"border-style":u.borderStyle.getValue(),"background-color":u.backgroundColor.getColorValue(),width:u.width.getPxValue(),color:u.color.getColorValue()}),n.trigger("editor.styles.apply"),!0)}var i,l,s,a=document.getElementById("post_ID").value||0,u={},c=!1,p=e("#boxzilla-box-appearance-controls");return u.borderColor=new t("border-color"),u.borderWidth=new t("border-width"),u.borderStyle=new t("border-style"),u.backgroundColor=new t("background-color"),u.width=new t("width"),u.color=new t("color"),p.find("input.boxzilla-color-field").wpColorPicker({change:r,clear:r}),p.find(":input").not(".boxzilla-color-field").change(r),n.on("editor.init",r),{init:function(){"object"===o(window.tinyMCE)&&null!==tinyMCE.get("content")&&(l=e("#content_ifr"),(i=l.contents().find("html")).css({background:"white"}),(s=i.find("#tinymce")).addClass("boxzilla boxzilla-"+a),s.css({margin:0,background:"white",display:"inline-block",width:"auto","min-width":"240px",position:"relative"}),s.get(0).style.cssText+=";padding: 25px !important;",c=!0,n.trigger("editor.init"))},resetStyles:function(){for(var e in u)"theme"!==e.substring(0,5)&&u[e].clear();r(),n.trigger("editor.styles.reset")},options:u}}},{}],4:[function(e,t,n){"use strict";var o=window.jQuery,r=function(e){"string"==typeof e&&(e=document.getElementById("boxzilla-"+e)),e||console.error("Unable to find option element."),this.element=e};r.prototype.getColorValue=function(){return this.element.value.length>0?o(this.element).hasClass("wp-color-field")?o(this.element).wpColorPicker("color"):this.element.value:""},r.prototype.getPxValue=function(e){return this.element.value.length>0?parseInt(this.element.value)+"px":e||""},r.prototype.getValue=function(e){return this.element.value.length>0?this.element.value:e||""},r.prototype.clear=function(){this.element.value=""},r.prototype.setValue=function(e){this.element.value=e},t.exports=r},{}],5:[function(e,n,o){!function(e){"use strict";function o(){}function r(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function i(e){return function(){return this[e].apply(this,arguments)}}function l(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&l(e.listener)}var s=o.prototype,a=e.EventEmitter;s.getListeners=function(e){var t,n,o=this._getEvents();if(e instanceof RegExp){t={};for(n in o)o.hasOwnProperty(n)&&e.test(n)&&(t[n]=o[n])}else t=o[e]||(o[e]=[]);return t},s.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},s.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&((t={})[e]=n),t||n},s.addListener=function(e,t){if(!l(t))throw new TypeError("listener must be a function");var n,o=this.getListenersAsObject(e),i="object"==typeof t;for(n in o)o.hasOwnProperty(n)&&-1===r(o[n],t)&&o[n].push(i?t:{listener:t,once:!1});return this},s.on=i("addListener"),s.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},s.once=i("addOnceListener"),s.defineEvent=function(e){return this.getListeners(e),this},s.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},s.removeListener=function(e,t){var n,o,i=this.getListenersAsObject(e);for(o in i)i.hasOwnProperty(o)&&-1!==(n=r(i[o],t))&&i[o].splice(n,1);return this},s.off=i("removeListener"),s.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},s.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},s.manipulateListeners=function(e,t,n){var o,r,i=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(o=n.length;o--;)i.call(this,t,n[o]);else for(o in t)t.hasOwnProperty(o)&&(r=t[o])&&("function"==typeof r?i.call(this,o,r):l.call(this,o,r));return this},s.removeEvent=function(e){var t,n=typeof e,o=this._getEvents();if("string"===n)delete o[e];else if(e instanceof RegExp)for(t in o)o.hasOwnProperty(t)&&e.test(t)&&delete o[t];else delete this._events;return this},s.removeAllListeners=i("removeEvent"),s.emitEvent=function(e,t){var n,o,r,i,l=this.getListenersAsObject(e);for(i in l)if(l.hasOwnProperty(i))for(n=l[i].slice(0),r=0;r<n.length;r++)!0===(o=n[r]).once&&this.removeListener(e,o.listener),o.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,o.listener);return this},s.trigger=i("emitEvent"),s.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},s.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},s._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},s._getEvents=function(){return this._events||(this._events={})},o.noConflict=function(){return e.EventEmitter=a,o},"function"==typeof t&&t.amd?t(function(){return o}):"object"==typeof n&&n.exports?n.exports=o:e.EventEmitter=o}(this||{})},{}]},{},[1])}();
2
  //# sourceMappingURL=admin-script.min.js.map
assets/js/admin-script.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["admin-script.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","window","Boxzilla_Admin","./admin/_admin.js","2","setContextualHelpers","context","this","tagName","toLowerCase","$","parents","get","condition","querySelector","value","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","querySelectorAll","remove","removeAttribute","className","parentNode","insertBefore","nextSibling","change","style","display","tnLoggedIn","removeChild","placeholder","i18n","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","jQuery","Option","optionControls","document","getElementById","$optionControls","createTextNode","events","Designer","rowTemplate","wp","template","boxzilla_i18n","on","data","key","html","after","find","toggle","load","tinyMCE","each","./_designer.js","./_option.js","wolfy87-eventemitter","3","_typeof","Symbol","iterator","obj","constructor","prototype","applyStyles","visualEditorInitialised","$innerEditor","css","border-color","options","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","width","color","trigger","$editor","$editorFrame","boxId","$appearanceControls","wpColorPicker","clear","not","init","contents","background","addClass","margin","min-width","position","cssText","resetStyles","substring","4","element","console","error","hasClass","fallbackValue","parseInt","setValue","5","EventEmitter","indexOfListener","listeners","listener","alias","name","apply","arguments","isValidListener","RegExp","proto","originalGlobalValue","getListeners","evt","response","_getEvents","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","TypeError","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAAIA,OAAUC,EAAgEC,OAASD,GAAW,WAAY,SAASE,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,EAAkB,mBAATV,GAAqBA,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undefined; var exports = undefined; var define = undefined; (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){\n'use strict';\n\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n'use strict';\n\n(function () {\n 'use strict';\n\n var $ = window.jQuery;\n var Option = require('./_option.js');\n var optionControls = document.getElementById('boxzilla-box-options-controls');\n var $optionControls = $(optionControls);\n var tnLoggedIn = document.createTextNode(' logged in');\n\n // sanity check, are we on the correct page?\n if ($optionControls.length === 0) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter');\n var events = new EventEmitter();\n var Designer = require('./_designer.js')($, Option, events);\n var rowTemplate = wp.template('rule-row-template');\n var i18n = boxzilla_i18n;\n\n // events\n $optionControls.on('click', \".boxzilla-add-rule\", addRuleFields);\n $optionControls.on('click', \".boxzilla-remove-rule\", removeRule);\n $optionControls.on('change', \".boxzilla-rule-condition\", setContextualHelpers);\n $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);\n\n $(window).load(function () {\n if (typeof window.tinyMCE === \"undefined\") {\n document.getElementById('notice-notinymce').style.display = '';\n }\n });\n\n // call contextual helper method for each row\n $('.boxzilla-rule-row').each(setContextualHelpers);\n\n function toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n }\n\n function removeRule() {\n $(this).parents('tr').remove();\n }\n\n function setContextualHelpers() {\n var context = this.tagName.toLowerCase() === \"tr\" ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput);\n\n // remove previously added helpers\n $(context.querySelectorAll('.boxzilla-helper')).remove();\n\n // prepare better input\n betterInput.removeAttribute('name');\n betterInput.className = betterInput.className + ' boxzilla-helper';\n valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n $betterInput.change(function () {\n valueInput.value = this.value;\n });\n\n betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = 'none';\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = 'none';\n if (tnLoggedIn.parentNode) {\n tnLoggedIn.parentNode.removeChild(tnLoggedIn);\n }\n\n // change placeholder for textual help\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_url':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_user_logged_in':\n betterInput.style.display = 'none';\n valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);\n break;\n\n case 'is_referer':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n break;\n\n }\n }\n\n function addRuleFields() {\n var data = {\n 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length\n };\n var html = rowTemplate(data);\n $(document.getElementById('boxzilla-box-rules')).after(html);\n return false;\n }\n\n module.exports = {\n 'Designer': Designer,\n 'Option': Option,\n 'events': events\n };\n})();\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar Designer = function Designer($, Option, events) {\n\n\t// vars\n\tvar boxId = document.getElementById('post_ID').value || 0,\n\t $editor,\n\t $editorFrame,\n\t $innerEditor,\n\t options = {},\n\t visualEditorInitialised = false;\n\n\tvar $appearanceControls = $(\"#boxzilla-box-appearance-controls\");\n\n\t// create Option objects\n\toptions.borderColor = new Option('border-color');\n\toptions.borderWidth = new Option('border-width');\n\toptions.borderStyle = new Option('border-style');\n\toptions.backgroundColor = new Option('background-color');\n\toptions.width = new Option('width');\n\toptions.color = new Option('color');\n\n\t// functions\n\tfunction init() {\n\n\t\t// Only run if TinyMCE has actually inited\n\t\tif (_typeof(window.tinyMCE) !== \"object\" || tinyMCE.get('content') === null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// add classes to TinyMCE <html>\n\t\t$editorFrame = $(\"#content_ifr\");\n\t\t$editor = $editorFrame.contents().find('html');\n\t\t$editor.css({\n\t\t\t'background': 'white'\n\t\t});\n\n\t\t// add content class and padding to TinyMCE <body>\n\t\t$innerEditor = $editor.find('#tinymce');\n\t\t$innerEditor.addClass('boxzilla boxzilla-' + boxId);\n\t\t$innerEditor.css({\n\t\t\t'margin': 0,\n\t\t\t'background': 'white',\n\t\t\t'display': 'inline-block',\n\t\t\t'width': 'auto',\n\t\t\t'min-width': '240px',\n\t\t\t'position': 'relative'\n\t\t});\n\t\t$innerEditor.get(0).style.cssText += ';padding: 25px !important;';\n\n\t\tvisualEditorInitialised = true;\n\n\t\t/* @since 2.0.3 */\n\t\tevents.trigger('editor.init');\n\t}\n\n\t/**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n\tfunction applyStyles() {\n\n\t\tif (!visualEditorInitialised) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// apply styles from CSS editor\n\t\t$innerEditor.css({\n\t\t\t'border-color': options.borderColor.getColorValue(), //getColorValue( 'borderColor', '' ),\n\t\t\t'border-width': options.borderWidth.getPxValue(), //getPxValue( 'borderWidth', '' ),\n\t\t\t'border-style': options.borderStyle.getValue(), //getValue('borderStyle', '' ),\n\t\t\t'background-color': options.backgroundColor.getColorValue(), //getColorValue( 'backgroundColor', ''),\n\t\t\t'width': options.width.getPxValue(), //getPxValue( 'width', 'auto' ),\n\t\t\t'color': options.color.getColorValue() // getColorValue( 'color', '' )\n\t\t});\n\n\t\t/* @since 2.0.3 */\n\t\tevents.trigger('editor.styles.apply');\n\n\t\treturn true;\n\t}\n\n\tfunction resetStyles() {\n\t\tfor (var key in options) {\n\t\t\tif (key.substring(0, 5) === 'theme') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\toptions[key].clear();\n\t\t}\n\t\tapplyStyles();\n\n\t\t/* @since 2.0.3 */\n\t\tevents.trigger('editor.styles.reset');\n\t}\n\n\t// event binders\n\t$appearanceControls.find('input.boxzilla-color-field').wpColorPicker({ change: applyStyles, clear: applyStyles });\n\t$appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n\tevents.on('editor.init', applyStyles);\n\n\t// public methods\n\treturn {\n\t\t'init': init,\n\t\t'resetStyles': resetStyles,\n\t\t'options': options\n\t};\n};\n\nmodule.exports = Designer;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\n\nvar Option = function Option(element) {\n\n\t// find corresponding element\n\tif (typeof element == \"string\") {\n\t\telement = document.getElementById('boxzilla-' + element);\n\t}\n\n\tif (!element) {\n\t\tconsole.error(\"Unable to find option element.\");\n\t}\n\n\tthis.element = element;\n};\n\nOption.prototype.getColorValue = function () {\n\tif (this.element.value.length > 0) {\n\t\tif ($(this.element).hasClass('wp-color-field')) {\n\t\t\treturn $(this.element).wpColorPicker('color');\n\t\t} else {\n\t\t\treturn this.element.value;\n\t\t}\n\t}\n\n\treturn '';\n};\n\nOption.prototype.getPxValue = function (fallbackValue) {\n\tif (this.element.value.length > 0) {\n\t\treturn parseInt(this.element.value) + \"px\";\n\t}\n\n\treturn fallbackValue || '';\n};\n\nOption.prototype.getValue = function (fallbackValue) {\n\n\tif (this.element.value.length > 0) {\n\t\treturn this.element.value;\n\t}\n\n\treturn fallbackValue || '';\n};\n\nOption.prototype.clear = function () {\n\tthis.element.value = '';\n};\n\nOption.prototype.setValue = function (value) {\n\tthis.element.value = value;\n};\n\nmodule.exports = Option;\n\n},{}],5:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.4 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(this || {}));\n\n},{}]},{},[1]);\n; })();"]}
1
+ {"version":3,"sources":["admin-script.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","window","Boxzilla_Admin","./admin/_admin.js","2","setContextualHelpers","context","this","tagName","toLowerCase","$","parents","get","condition","querySelector","value","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","querySelectorAll","remove","removeAttribute","className","parentNode","insertBefore","nextSibling","change","style","display","tnLoggedIn","removeChild","placeholder","i18n","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","jQuery","Option","optionControls","document","getElementById","$optionControls","createTextNode","events","Designer","rowTemplate","wp","template","boxzilla_i18n","ruleComparisonEl","rulesContainerEl","on","data","key","andor","or","and","html","append","row","prev","find","toggle","newText","text","load","tinyMCE","each","./_designer.js","./_option.js","wolfy87-eventemitter","3","_typeof","Symbol","iterator","obj","constructor","prototype","applyStyles","visualEditorInitialised","$innerEditor","css","border-color","options","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","width","color","trigger","$editor","$editorFrame","boxId","$appearanceControls","wpColorPicker","clear","not","init","contents","background","addClass","margin","min-width","position","cssText","resetStyles","substring","4","element","console","error","hasClass","fallbackValue","parseInt","setValue","5","EventEmitter","indexOfListener","listeners","listener","alias","name","apply","arguments","isValidListener","RegExp","proto","originalGlobalValue","getListeners","evt","response","_getEvents","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","TypeError","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAAIA,OAAUC,EAAgEC,OAASD,GAAW,WAAY,SAASE,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,EAAkB,mBAATV,GAAqBA,EAAQ,IAAIS,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,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,IACvCzM,EAAO,WACH,OAAOqJ,IAGY,iBAAXnI,GAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAUuI,EAGjBvI,EAAQuI,aAAeA,EA5d9B,CA8dC5H,oBAES,IA30BX","file":"admin-script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){\n'use strict';\n\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n'use strict';\n\n(function () {\n 'use strict';\n\n var $ = window.jQuery;\n var Option = require('./_option.js');\n var optionControls = document.getElementById('boxzilla-box-options-controls');\n var $optionControls = $(optionControls);\n var tnLoggedIn = document.createTextNode(' logged in');\n\n // sanity check, are we on the correct page?\n if ($optionControls.length === 0) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter');\n var events = new EventEmitter();\n var Designer = require('./_designer.js')($, Option, events);\n var rowTemplate = wp.template('rule-row-template');\n var i18n = boxzilla_i18n;\n var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');\n var rulesContainerEl = document.getElementById('boxzilla-box-rules');\n\n // events\n $optionControls.on('click', \".boxzilla-add-rule\", addRuleFields);\n $optionControls.on('click', \".boxzilla-remove-rule\", removeRule);\n $optionControls.on('change', \".boxzilla-rule-condition\", setContextualHelpers);\n $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);\n $(ruleComparisonEl).change(toggleAndOrTexts);\n\n $(window).load(function () {\n if (typeof window.tinyMCE === \"undefined\") {\n document.getElementById('notice-notinymce').style.display = '';\n }\n });\n\n // call contextual helper method for each row\n $('.boxzilla-rule-row').each(setContextualHelpers);\n\n function toggleAndOrTexts() {\n var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;\n $('.boxzilla-andor').text(newText);\n }\n\n function toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n }\n\n function removeRule() {\n var row = $(this).parents('tr');\n\n // delete andor row\n row.prev().remove();\n\n // delete rule row\n row.remove();\n }\n\n function setContextualHelpers() {\n var context = this.tagName.toLowerCase() === \"tr\" ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput);\n\n // remove previously added helpers\n $(context.querySelectorAll('.boxzilla-helper')).remove();\n\n // prepare better input\n betterInput.removeAttribute('name');\n betterInput.className = betterInput.className + ' boxzilla-helper';\n valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n $betterInput.change(function () {\n valueInput.value = this.value;\n });\n\n betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = 'none';\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = 'none';\n if (tnLoggedIn.parentNode) {\n tnLoggedIn.parentNode.removeChild(tnLoggedIn);\n }\n\n // change placeholder for textual help\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_url':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_user_logged_in':\n betterInput.style.display = 'none';\n valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);\n break;\n\n case 'is_referer':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n break;\n\n }\n }\n\n function addRuleFields() {\n var data = {\n 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length,\n 'andor': ruleComparisonEl.value === 'any' ? i18n.or : i18n.and\n };\n var html = rowTemplate(data);\n $(rulesContainerEl).append(html);\n return false;\n }\n\n module.exports = {\n 'Designer': Designer,\n 'Option': Option,\n 'events': events\n };\n})();\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar Designer = function Designer($, Option, events) {\n\n\t// vars\n\tvar boxId = document.getElementById('post_ID').value || 0,\n\t $editor,\n\t $editorFrame,\n\t $innerEditor,\n\t options = {},\n\t visualEditorInitialised = false;\n\n\tvar $appearanceControls = $(\"#boxzilla-box-appearance-controls\");\n\n\t// create Option objects\n\toptions.borderColor = new Option('border-color');\n\toptions.borderWidth = new Option('border-width');\n\toptions.borderStyle = new Option('border-style');\n\toptions.backgroundColor = new Option('background-color');\n\toptions.width = new Option('width');\n\toptions.color = new Option('color');\n\n\t// functions\n\tfunction init() {\n\n\t\t// Only run if TinyMCE has actually inited\n\t\tif (_typeof(window.tinyMCE) !== \"object\" || tinyMCE.get('content') === null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// add classes to TinyMCE <html>\n\t\t$editorFrame = $(\"#content_ifr\");\n\t\t$editor = $editorFrame.contents().find('html');\n\t\t$editor.css({\n\t\t\t'background': 'white'\n\t\t});\n\n\t\t// add content class and padding to TinyMCE <body>\n\t\t$innerEditor = $editor.find('#tinymce');\n\t\t$innerEditor.addClass('boxzilla boxzilla-' + boxId);\n\t\t$innerEditor.css({\n\t\t\t'margin': 0,\n\t\t\t'background': 'white',\n\t\t\t'display': 'inline-block',\n\t\t\t'width': 'auto',\n\t\t\t'min-width': '240px',\n\t\t\t'position': 'relative'\n\t\t});\n\t\t$innerEditor.get(0).style.cssText += ';padding: 25px !important;';\n\n\t\tvisualEditorInitialised = true;\n\n\t\t/* @since 2.0.3 */\n\t\tevents.trigger('editor.init');\n\t}\n\n\t/**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n\tfunction applyStyles() {\n\n\t\tif (!visualEditorInitialised) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// apply styles from CSS editor\n\t\t$innerEditor.css({\n\t\t\t'border-color': options.borderColor.getColorValue(), //getColorValue( 'borderColor', '' ),\n\t\t\t'border-width': options.borderWidth.getPxValue(), //getPxValue( 'borderWidth', '' ),\n\t\t\t'border-style': options.borderStyle.getValue(), //getValue('borderStyle', '' ),\n\t\t\t'background-color': options.backgroundColor.getColorValue(), //getColorValue( 'backgroundColor', ''),\n\t\t\t'width': options.width.getPxValue(), //getPxValue( 'width', 'auto' ),\n\t\t\t'color': options.color.getColorValue() // getColorValue( 'color', '' )\n\t\t});\n\n\t\t/* @since 2.0.3 */\n\t\tevents.trigger('editor.styles.apply');\n\n\t\treturn true;\n\t}\n\n\tfunction resetStyles() {\n\t\tfor (var key in options) {\n\t\t\tif (key.substring(0, 5) === 'theme') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\toptions[key].clear();\n\t\t}\n\t\tapplyStyles();\n\n\t\t/* @since 2.0.3 */\n\t\tevents.trigger('editor.styles.reset');\n\t}\n\n\t// event binders\n\t$appearanceControls.find('input.boxzilla-color-field').wpColorPicker({ change: applyStyles, clear: applyStyles });\n\t$appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n\tevents.on('editor.init', applyStyles);\n\n\t// public methods\n\treturn {\n\t\t'init': init,\n\t\t'resetStyles': resetStyles,\n\t\t'options': options\n\t};\n};\n\nmodule.exports = Designer;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\n\nvar Option = function Option(element) {\n\n\t// find corresponding element\n\tif (typeof element == \"string\") {\n\t\telement = document.getElementById('boxzilla-' + element);\n\t}\n\n\tif (!element) {\n\t\tconsole.error(\"Unable to find option element.\");\n\t}\n\n\tthis.element = element;\n};\n\nOption.prototype.getColorValue = function () {\n\tif (this.element.value.length > 0) {\n\t\tif ($(this.element).hasClass('wp-color-field')) {\n\t\t\treturn $(this.element).wpColorPicker('color');\n\t\t} else {\n\t\t\treturn this.element.value;\n\t\t}\n\t}\n\n\treturn '';\n};\n\nOption.prototype.getPxValue = function (fallbackValue) {\n\tif (this.element.value.length > 0) {\n\t\treturn parseInt(this.element.value) + \"px\";\n\t}\n\n\treturn fallbackValue || '';\n};\n\nOption.prototype.getValue = function (fallbackValue) {\n\n\tif (this.element.value.length > 0) {\n\t\treturn this.element.value;\n\t}\n\n\treturn fallbackValue || '';\n};\n\nOption.prototype.clear = function () {\n\tthis.element.value = '';\n};\n\nOption.prototype.setValue = function (value) {\n\tthis.element.value = value;\n};\n\nmodule.exports = Option;\n\n},{}],5:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.4 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(this || {}));\n\n},{}]},{},[1]);\n; })();"]}
assets/scss/admin-styles.scss CHANGED
@@ -92,6 +92,14 @@
92
  }
93
  }
94
  }
 
 
 
 
 
 
 
 
95
 
96
  .boxzilla-is-dismissible {
97
  padding-right: 38px;
@@ -170,4 +178,4 @@
170
  .boxzilla-sidebar {
171
  margin-top: 40px;
172
  }
173
- }
92
  }
93
  }
94
  }
95
+ .boxzilla-muted {
96
+ color: #888;
97
+ }
98
+
99
+ .boxzilla-no-vpadding {
100
+ padding-top: 0 !important;
101
+ padding-bottom: 0 !important;
102
+ }
103
 
104
  .boxzilla-is-dismissible {
105
  padding-right: 38px;
178
  .boxzilla-sidebar {
179
  margin-top: 40px;
180
  }
181
+ }
boxzilla.php CHANGED
@@ -1,68 +1,68 @@
1
- <?php
2
- /*
3
- Plugin Name: Boxzilla
4
- Version: 3.2.5
5
- Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
- Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
- Author: ibericode
8
- Author URI: https://ibericode.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
9
- Text Domain: boxzilla
10
- Domain Path: /languages/
11
- License: GPL v3
12
-
13
- Boxzilla Plugin
14
- Copyright (C) 2013-2018, Danny van Kooten, hi@dannyvankooten.com
15
-
16
- This program is free software: you can redistribute it and/or modify
17
- it under the terms of the GNU General Public License as published by
18
- the Free Software Foundation, either version 3 of the License, or
19
- (at your option) any later version.
20
-
21
- This program is distributed in the hope that it will be useful,
22
- but WITHOUT ANY WARRANTY; without even the implied warranty of
23
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
- GNU General Public License for more details.
25
-
26
- You should have received a copy of the GNU General Public License
27
- along with this program. If not, see <http://www.gnu.org/licenses/>.
28
- */
29
-
30
- if ( ! defined( 'ABSPATH' ) ) {
31
- header( 'Status: 403 Forbidden' );
32
- header( 'HTTP/1.1 403 Forbidden' );
33
- exit;
34
- }
35
-
36
-
37
- /**
38
- * @ignore
39
- * @internal
40
- */
41
- function _load_boxzilla() {
42
-
43
- define( 'BOXZILLA_FILE', __FILE__ );
44
- define( 'BOXZILLA_VERSION', '3.2.5' );
45
-
46
- require __DIR__ . '/bootstrap.php';
47
- }
48
-
49
- // Check if we're on PHP 5.2, if so: bail early.
50
- if( version_compare( PHP_VERSION, '5.3', '<' ) ) {
51
- require dirname( __FILE__ ) . '/src/class-php-fallback.php';
52
- new Boxzilla_PHP_Fallback( 'Boxzilla', plugin_basename( __FILE__ ) );
53
- return;
54
- }
55
-
56
- // load autoloader but only if not loaded already (for compat with sitewide autoloader)
57
- if( ! function_exists( 'boxzilla' ) ) {
58
- require __DIR__ . '/vendor/autoload.php';
59
- }
60
-
61
- // register activation hook
62
- register_activation_hook( __FILE__, array( 'Boxzilla\\Admin\\Installer', 'run' ) );
63
-
64
- // hook into plugins_loaded for boostrapping
65
- add_action( 'plugins_loaded', '_load_boxzilla', 8 );
66
-
67
-
68
-
1
+ <?php
2
+ /*
3
+ Plugin Name: Boxzilla
4
+ Version: 3.2.6
5
+ Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
+ Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
+ Author: ibericode
8
+ Author URI: https://ibericode.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
9
+ Text Domain: boxzilla
10
+ Domain Path: /languages/
11
+ License: GPL v3
12
+
13
+ Boxzilla Plugin
14
+ Copyright (C) 2013-2018, Danny van Kooten, hi@dannyvankooten.com
15
+
16
+ This program is free software: you can redistribute it and/or modify
17
+ it under the terms of the GNU General Public License as published by
18
+ the Free Software Foundation, either version 3 of the License, or
19
+ (at your option) any later version.
20
+
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
+
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ if ( ! defined( 'ABSPATH' ) ) {
31
+ header( 'Status: 403 Forbidden' );
32
+ header( 'HTTP/1.1 403 Forbidden' );
33
+ exit;
34
+ }
35
+
36
+
37
+ /**
38
+ * @ignore
39
+ * @internal
40
+ */
41
+ function _load_boxzilla() {
42
+
43
+ define( 'BOXZILLA_FILE', __FILE__ );
44
+ define( 'BOXZILLA_VERSION', '3.2.6' );
45
+
46
+ require __DIR__ . '/bootstrap.php';
47
+ }
48
+
49
+ // Check if we're on PHP 5.2, if so: bail early.
50
+ if( version_compare( PHP_VERSION, '5.3', '<' ) ) {
51
+ require dirname( __FILE__ ) . '/src/class-php-fallback.php';
52
+ new Boxzilla_PHP_Fallback( 'Boxzilla', plugin_basename( __FILE__ ) );
53
+ return;
54
+ }
55
+
56
+ // load autoloader but only if not loaded already (for compat with sitewide autoloader)
57
+ if( ! function_exists( 'boxzilla' ) ) {
58
+ require __DIR__ . '/vendor/autoload.php';
59
+ }
60
+
61
+ // register activation hook
62
+ register_activation_hook( __FILE__, array( 'Boxzilla\\Admin\\Installer', 'run' ) );
63
+
64
+ // hook into plugins_loaded for boostrapping
65
+ add_action( 'plugins_loaded', '_load_boxzilla', 8 );
66
+
67
+
68
+
languages/boxzilla.pot CHANGED
@@ -77,39 +77,47 @@ msgstr ""
77
  msgid "Extensions"
78
  msgstr ""
79
 
80
- #: src/admin/class-admin.php:308
 
 
 
 
 
 
 
 
81
  msgid "Enter a comma-separated list of values."
82
  msgstr ""
83
 
84
- #: src/admin/class-admin.php:309
85
  msgid "Enter a comma-separated list of post slugs or post ID's.."
86
  msgstr ""
87
 
88
- #: src/admin/class-admin.php:310
89
  msgid "Enter a comma-separated list of page slugs or page ID's.."
90
  msgstr ""
91
 
92
- #: src/admin/class-admin.php:311
93
  msgid "Enter a comma-separated list of post types.."
94
  msgstr ""
95
 
96
- #: src/admin/class-admin.php:312
97
  msgid "Enter a comma-separated list of relative URL's, eg /contact/"
98
  msgstr ""
99
 
100
- #: src/admin/class-admin.php:344
101
  msgid "Box Appearance"
102
  msgstr ""
103
 
104
- #: src/admin/class-admin.php:353
105
  msgid "Box Options"
106
  msgstr ""
107
 
108
- #: src/admin/class-admin.php:362
109
  msgid "Looking for help?"
110
  msgstr ""
111
 
112
- #: src/admin/class-admin.php:370
113
  msgid "Subscribe to our newsletter"
114
  msgstr ""
115
 
@@ -149,11 +157,11 @@ msgstr ""
149
  msgid "If not, please click here: %s."
150
  msgstr ""
151
 
152
- #: src/admin/views/settings.php:20, src/admin/views/metaboxes/box-option-controls.php:198
153
  msgid "Enable test mode?"
154
  msgstr ""
155
 
156
- #: src/admin/views/settings.php:24, src/admin/views/metaboxes/box-option-controls.php:202
157
  msgid "If test mode is enabled, all boxes will show up regardless of whether a cookie has been set."
158
  msgstr ""
159
 
@@ -289,147 +297,147 @@ msgstr ""
289
  msgid "of the following conditions."
290
  msgstr ""
291
 
292
- #: src/admin/views/metaboxes/box-option-controls.php:56, src/admin/views/metaboxes/box-option-controls.php:218
293
  msgid "Remove rule"
294
  msgstr ""
295
 
296
- #: src/admin/views/metaboxes/box-option-controls.php:66, src/admin/views/metaboxes/box-option-controls.php:227
297
  msgid "is"
298
  msgstr ""
299
 
300
- #: src/admin/views/metaboxes/box-option-controls.php:67, src/admin/views/metaboxes/box-option-controls.php:228
301
  msgid "is not"
302
  msgstr ""
303
 
304
- #: src/admin/views/metaboxes/box-option-controls.php:68, src/admin/views/metaboxes/box-option-controls.php:229
305
  msgid "contains"
306
  msgstr ""
307
 
308
- #: src/admin/views/metaboxes/box-option-controls.php:69, src/admin/views/metaboxes/box-option-controls.php:230
309
  msgid "does not contain"
310
  msgstr ""
311
 
312
- #: src/admin/views/metaboxes/box-option-controls.php:72, src/admin/views/metaboxes/box-option-controls.php:233
313
  msgid "Leave empty for any or enter (comma-separated) names or ID's"
314
  msgstr ""
315
 
316
- #: src/admin/views/metaboxes/box-option-controls.php:80
317
- msgid "Add rule"
318
  msgstr ""
319
 
320
- #: src/admin/views/metaboxes/box-option-controls.php:83
321
  msgid "Box Position"
322
  msgstr ""
323
 
324
- #: src/admin/views/metaboxes/box-option-controls.php:89
325
  msgid "Top Left"
326
  msgstr ""
327
 
328
- #: src/admin/views/metaboxes/box-option-controls.php:96
329
  msgid "Top Right"
330
  msgstr ""
331
 
332
- #: src/admin/views/metaboxes/box-option-controls.php:105
333
  msgid "Center"
334
  msgstr ""
335
 
336
- #: src/admin/views/metaboxes/box-option-controls.php:114
337
  msgid "Bottom Left"
338
  msgstr ""
339
 
340
- #: src/admin/views/metaboxes/box-option-controls.php:121
341
  msgid "Bottom Right"
342
  msgstr ""
343
 
344
- #: src/admin/views/metaboxes/box-option-controls.php:130
345
  msgid "Animation"
346
  msgstr ""
347
 
348
- #: src/admin/views/metaboxes/box-option-controls.php:132
349
  msgid "Fade In"
350
  msgstr ""
351
 
352
- #: src/admin/views/metaboxes/box-option-controls.php:133
353
  msgid "Slide In"
354
  msgstr ""
355
 
356
- #: src/admin/views/metaboxes/box-option-controls.php:134
357
  msgid "Which animation type should be used to show the box when triggered?"
358
  msgstr ""
359
 
360
- #: src/admin/views/metaboxes/box-option-controls.php:138
361
  msgid "Auto-show box?"
362
  msgstr ""
363
 
364
- #: src/admin/views/metaboxes/box-option-controls.php:140
365
  msgid "Never"
366
  msgstr ""
367
 
368
- #: src/admin/views/metaboxes/box-option-controls.php:141
369
  msgid "Yes, after %s seconds on the page."
370
  msgstr ""
371
 
372
- #: src/admin/views/metaboxes/box-option-controls.php:142
373
  msgid "Yes, when at %s of page height"
374
  msgstr ""
375
 
376
- #: src/admin/views/metaboxes/box-option-controls.php:143
377
  msgid "Yes, when at element %s"
378
  msgstr ""
379
 
380
- #: src/admin/views/metaboxes/box-option-controls.php:143
381
  msgid "Example: #comments"
382
  msgstr ""
383
 
384
- #: src/admin/views/metaboxes/box-option-controls.php:149
385
  msgid "Cookie expiration"
386
  msgstr ""
387
 
388
- #: src/admin/views/metaboxes/box-option-controls.php:154, src/admin/views/metaboxes/box-option-controls.php:159
389
  msgid "hours"
390
  msgstr ""
391
 
392
- #: src/admin/views/metaboxes/box-option-controls.php:163
393
  msgid "After this box is triggered or dismissed, how many hours should it stay hidden?"
394
  msgstr ""
395
 
396
- #: src/admin/views/metaboxes/box-option-controls.php:167
397
  msgid "Screen width"
398
  msgstr ""
399
 
400
- #: src/admin/views/metaboxes/box-option-controls.php:172
401
  msgid "larger"
402
  msgstr ""
403
 
404
- #: src/admin/views/metaboxes/box-option-controls.php:172
405
  msgid "smaller"
406
  msgstr ""
407
 
408
- #: src/admin/views/metaboxes/box-option-controls.php:173
409
  msgid "Only show on screens %s than %s."
410
  msgstr ""
411
 
412
- #: src/admin/views/metaboxes/box-option-controls.php:174
413
  msgid "Leave empty if you want to show the box on all screen sizes."
414
  msgstr ""
415
 
416
- #: src/admin/views/metaboxes/box-option-controls.php:179
417
  msgid "Auto-hide?"
418
  msgstr ""
419
 
420
- #: src/admin/views/metaboxes/box-option-controls.php:183
421
  msgid "Hide box again when visitors scroll back up?"
422
  msgstr ""
423
 
424
- #: src/admin/views/metaboxes/box-option-controls.php:187
425
  msgid "Show close icon?"
426
  msgstr ""
427
 
428
- #: src/admin/views/metaboxes/box-option-controls.php:192
429
  msgid "If you decide to hide the close icon, make sure to offer an alternative way to close the box."
430
  msgstr ""
431
 
432
- #: src/admin/views/metaboxes/box-option-controls.php:193
433
  msgid "Example: "
434
  msgstr ""
435
 
77
  msgid "Extensions"
78
  msgstr ""
79
 
80
+ #: src/admin/class-admin.php:308, src/admin/views/metaboxes/box-option-controls.php:60
81
+ msgid "and"
82
+ msgstr ""
83
+
84
+ #: src/admin/class-admin.php:309, src/admin/views/metaboxes/box-option-controls.php:59
85
+ msgid "or"
86
+ msgstr ""
87
+
88
+ #: src/admin/class-admin.php:310
89
  msgid "Enter a comma-separated list of values."
90
  msgstr ""
91
 
92
+ #: src/admin/class-admin.php:311
93
  msgid "Enter a comma-separated list of post slugs or post ID's.."
94
  msgstr ""
95
 
96
+ #: src/admin/class-admin.php:312
97
  msgid "Enter a comma-separated list of page slugs or page ID's.."
98
  msgstr ""
99
 
100
+ #: src/admin/class-admin.php:313
101
  msgid "Enter a comma-separated list of post types.."
102
  msgstr ""
103
 
104
+ #: src/admin/class-admin.php:314
105
  msgid "Enter a comma-separated list of relative URL's, eg /contact/"
106
  msgstr ""
107
 
108
+ #: src/admin/class-admin.php:346
109
  msgid "Box Appearance"
110
  msgstr ""
111
 
112
+ #: src/admin/class-admin.php:355
113
  msgid "Box Options"
114
  msgstr ""
115
 
116
+ #: src/admin/class-admin.php:364
117
  msgid "Looking for help?"
118
  msgstr ""
119
 
120
+ #: src/admin/class-admin.php:372
121
  msgid "Subscribe to our newsletter"
122
  msgstr ""
123
 
157
  msgid "If not, please click here: %s."
158
  msgstr ""
159
 
160
+ #: src/admin/views/settings.php:20, src/admin/views/metaboxes/box-option-controls.php:213
161
  msgid "Enable test mode?"
162
  msgstr ""
163
 
164
+ #: src/admin/views/settings.php:24, src/admin/views/metaboxes/box-option-controls.php:217
165
  msgid "If test mode is enabled, all boxes will show up regardless of whether a cookie has been set."
166
  msgstr ""
167
 
297
  msgid "of the following conditions."
298
  msgstr ""
299
 
300
+ #: src/admin/views/metaboxes/box-option-controls.php:71, src/admin/views/metaboxes/box-option-controls.php:237
301
  msgid "Remove rule"
302
  msgstr ""
303
 
304
+ #: src/admin/views/metaboxes/box-option-controls.php:81, src/admin/views/metaboxes/box-option-controls.php:246
305
  msgid "is"
306
  msgstr ""
307
 
308
+ #: src/admin/views/metaboxes/box-option-controls.php:82, src/admin/views/metaboxes/box-option-controls.php:247
309
  msgid "is not"
310
  msgstr ""
311
 
312
+ #: src/admin/views/metaboxes/box-option-controls.php:83, src/admin/views/metaboxes/box-option-controls.php:248
313
  msgid "contains"
314
  msgstr ""
315
 
316
+ #: src/admin/views/metaboxes/box-option-controls.php:84, src/admin/views/metaboxes/box-option-controls.php:249
317
  msgid "does not contain"
318
  msgstr ""
319
 
320
+ #: src/admin/views/metaboxes/box-option-controls.php:87, src/admin/views/metaboxes/box-option-controls.php:252
321
  msgid "Leave empty for any or enter (comma-separated) names or ID's"
322
  msgstr ""
323
 
324
+ #: src/admin/views/metaboxes/box-option-controls.php:95
325
+ msgid "Add another rule"
326
  msgstr ""
327
 
328
+ #: src/admin/views/metaboxes/box-option-controls.php:98
329
  msgid "Box Position"
330
  msgstr ""
331
 
332
+ #: src/admin/views/metaboxes/box-option-controls.php:104
333
  msgid "Top Left"
334
  msgstr ""
335
 
336
+ #: src/admin/views/metaboxes/box-option-controls.php:111
337
  msgid "Top Right"
338
  msgstr ""
339
 
340
+ #: src/admin/views/metaboxes/box-option-controls.php:120
341
  msgid "Center"
342
  msgstr ""
343
 
344
+ #: src/admin/views/metaboxes/box-option-controls.php:129
345
  msgid "Bottom Left"
346
  msgstr ""
347
 
348
+ #: src/admin/views/metaboxes/box-option-controls.php:136
349
  msgid "Bottom Right"
350
  msgstr ""
351
 
352
+ #: src/admin/views/metaboxes/box-option-controls.php:145
353
  msgid "Animation"
354
  msgstr ""
355
 
356
+ #: src/admin/views/metaboxes/box-option-controls.php:147
357
  msgid "Fade In"
358
  msgstr ""
359
 
360
+ #: src/admin/views/metaboxes/box-option-controls.php:148
361
  msgid "Slide In"
362
  msgstr ""
363
 
364
+ #: src/admin/views/metaboxes/box-option-controls.php:149
365
  msgid "Which animation type should be used to show the box when triggered?"
366
  msgstr ""
367
 
368
+ #: src/admin/views/metaboxes/box-option-controls.php:153
369
  msgid "Auto-show box?"
370
  msgstr ""
371
 
372
+ #: src/admin/views/metaboxes/box-option-controls.php:155
373
  msgid "Never"
374
  msgstr ""
375
 
376
+ #: src/admin/views/metaboxes/box-option-controls.php:156
377
  msgid "Yes, after %s seconds on the page."
378
  msgstr ""
379
 
380
+ #: src/admin/views/metaboxes/box-option-controls.php:157
381
  msgid "Yes, when at %s of page height"
382
  msgstr ""
383
 
384
+ #: src/admin/views/metaboxes/box-option-controls.php:158
385
  msgid "Yes, when at element %s"
386
  msgstr ""
387
 
388
+ #: src/admin/views/metaboxes/box-option-controls.php:158
389
  msgid "Example: #comments"
390
  msgstr ""
391
 
392
+ #: src/admin/views/metaboxes/box-option-controls.php:164
393
  msgid "Cookie expiration"
394
  msgstr ""
395
 
396
+ #: src/admin/views/metaboxes/box-option-controls.php:169, src/admin/views/metaboxes/box-option-controls.php:174
397
  msgid "hours"
398
  msgstr ""
399
 
400
+ #: src/admin/views/metaboxes/box-option-controls.php:178
401
  msgid "After this box is triggered or dismissed, how many hours should it stay hidden?"
402
  msgstr ""
403
 
404
+ #: src/admin/views/metaboxes/box-option-controls.php:182
405
  msgid "Screen width"
406
  msgstr ""
407
 
408
+ #: src/admin/views/metaboxes/box-option-controls.php:187
409
  msgid "larger"
410
  msgstr ""
411
 
412
+ #: src/admin/views/metaboxes/box-option-controls.php:187
413
  msgid "smaller"
414
  msgstr ""
415
 
416
+ #: src/admin/views/metaboxes/box-option-controls.php:188
417
  msgid "Only show on screens %s than %s."
418
  msgstr ""
419
 
420
+ #: src/admin/views/metaboxes/box-option-controls.php:189
421
  msgid "Leave empty if you want to show the box on all screen sizes."
422
  msgstr ""
423
 
424
+ #: src/admin/views/metaboxes/box-option-controls.php:194
425
  msgid "Auto-hide?"
426
  msgstr ""
427
 
428
+ #: src/admin/views/metaboxes/box-option-controls.php:198
429
  msgid "Hide box again when visitors scroll back up?"
430
  msgstr ""
431
 
432
+ #: src/admin/views/metaboxes/box-option-controls.php:202
433
  msgid "Show close icon?"
434
  msgstr ""
435
 
436
+ #: src/admin/views/metaboxes/box-option-controls.php:207
437
  msgid "If you decide to hide the close icon, make sure to offer an alternative way to close the box."
438
  msgstr ""
439
 
440
+ #: src/admin/views/metaboxes/box-option-controls.php:208
441
  msgid "Example: "
442
  msgstr ""
443
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=bo
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.1
6
  Tested up to: 4.9.6
7
- Stable tag: 3.2.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
@@ -150,6 +150,13 @@ Have a look at the [frequently asked questions](https://wordpress.org/plugins/bo
150
  == Changelog ==
151
 
152
 
 
 
 
 
 
 
 
153
 
154
  #### 3.2.5 - June 6, 2018
155
 
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.1
6
  Tested up to: 4.9.6
7
+ Stable tag: 3.2.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
150
  == Changelog ==
151
 
152
 
153
+ #### 3.2.6 - June 27, 2018
154
+
155
+ **Improvements**
156
+
157
+ - Show and/or between rules to help clarify rule logic.
158
+ - Consistent line endings in main plugin file.
159
+
160
 
161
  #### 3.2.5 - June 6, 2018
162
 
src/admin/class-admin.php CHANGED
@@ -305,6 +305,8 @@ class Admin {
305
  wp_enqueue_script( 'boxzilla-admin' );
306
 
307
  $data = array(
 
 
308
  'enterCommaSeparatedValues' => __( 'Enter a comma-separated list of values.', 'boxzilla' ),
309
  'enterCommaSeparatedPosts' => __( "Enter a comma-separated list of post slugs or post ID's..", 'boxzilla' ),
310
  'enterCommaSeparatedPages' => __( "Enter a comma-separated list of page slugs or page ID's..", 'boxzilla' ),
305
  wp_enqueue_script( 'boxzilla-admin' );
306
 
307
  $data = array(
308
+ 'and' => __( 'and', 'boxzilla' ),
309
+ 'or' => __( 'or', 'boxzilla' ),
310
  'enterCommaSeparatedValues' => __( 'Enter a comma-separated list of values.', 'boxzilla' ),
311
  'enterCommaSeparatedPosts' => __( "Enter a comma-separated list of post slugs or post ID's..", 'boxzilla' ),
312
  'enterCommaSeparatedPages' => __( "Enter a comma-separated list of page slugs or page ID's..", 'boxzilla' ),
src/admin/views/metaboxes/box-option-controls.php CHANGED
@@ -39,7 +39,7 @@ $rule_options = apply_filters( 'boxzilla_rules_options', $rule_options );
39
  <td>
40
  <label>
41
  <?php _e( 'Request matches', 'boxzilla' ); ?>
42
- <select name="boxzilla_box[rules_comparision]">
43
  <option value="any" <?php selected( $opts['rules_comparision'], 'any' ); ?>><?php _e( 'any', 'boxzilla' ); ?></option>
44
  <option value="all" <?php selected( $opts['rules_comparision'], 'all' ); ?>><?php _e( 'all', 'boxzilla' ); ?></option>
45
  </select>
@@ -50,7 +50,22 @@ $rule_options = apply_filters( 'boxzilla_rules_options', $rule_options );
50
  <tbody id="boxzilla-box-rules">
51
  <?php
52
  $key = 0;
53
- foreach( $opts['rules'] as $rule ) { if( ! array_key_exists( 'condition', $rule ) ) { continue; } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  <tr valign="top" class="boxzilla-rule-row boxzilla-rule-row-<?php echo $key; ?>">
55
  <th style="text-align: right; font-weight: normal;">
56
  <span class="boxzilla-close boxzilla-remove-rule" title="<?php esc_attr_e( 'Remove rule', 'boxzilla' ); ?>"><span class="dashicons dashicons-dismiss"></span></span>
@@ -62,7 +77,7 @@ $rule_options = apply_filters( 'boxzilla_rules_options', $rule_options );
62
  } ?>
63
  </select>
64
 
65
- <select class="boxzilla-rule-qualifier" name="boxzilla_box[rules][<?php echo $key; ?>][qualifier]">
66
  <option value="1" <?php selected( ! isset( $rule['qualifier'] ) || $rule['qualifier'] ); ?>><?php _e( 'is', 'boxzilla' ); ?></option>
67
  <option value="0" <?php selected( isset( $rule['qualifier'] ) && !$rule['qualifier'] ); ?>><?php _e( 'is not', 'boxzilla' ); ?></option>
68
  <option value="contains" <?php selected( isset( $rule['qualifier'] ) && $rule['qualifier'] === 'contains' ); ?> style="display: none;"><?php _e( 'contains', 'boxzilla' ); ?>
@@ -77,7 +92,7 @@ $rule_options = apply_filters( 'boxzilla_rules_options', $rule_options );
77
  </tbody>
78
  <tr>
79
  <th></th>
80
- <td><button type="button" class="button boxzilla-add-rule"><?php _e( 'Add rule', 'boxzilla' ); ?></button></td>
81
  </tr>
82
  <tr valign="top">
83
  <th><label for="boxzilla_position"><?php _e( 'Box Position', 'boxzilla' ); ?></label></th>
@@ -213,6 +228,10 @@ $rule_options = apply_filters( 'boxzilla_rules_options', $rule_options );
213
 
214
 
215
  <script type="text/html" id="tmpl-rule-row-template">
 
 
 
 
216
  <tr valign="top" class="boxzilla-rule-row boxzilla-rule-row-{{{data.key}}}">
217
  <th style="text-align: right; font-weight: normal;">
218
  <span class="boxzilla-close boxzilla-remove-rule" title="<?php esc_attr_e( 'Remove rule', 'boxzilla' ); ?>"><span class="dashicons dashicons-dismiss"></span></span>
@@ -223,7 +242,7 @@ $rule_options = apply_filters( 'boxzilla_rules_options', $rule_options );
223
  printf( '<option value="%s" %s %s>%s</option>', $value, disabled( $value, '', false ), '', $label );
224
  } ?>
225
  </select>
226
- <select class="boxzilla-rule-qualifier" name="boxzilla_box[rules][{{{data.key}}}][qualifier]" style="display: none;" >
227
  <option value="1" selected><?php _e( 'is', 'boxzilla' ); ?></option>
228
  <option value="0"><?php _e( 'is not', 'boxzilla' ); ?></option>
229
  <option value="contains" style="display: none;"><?php _e( 'contains', 'boxzilla' ); ?></option>
39
  <td>
40
  <label>
41
  <?php _e( 'Request matches', 'boxzilla' ); ?>
42
+ <select name="boxzilla_box[rules_comparision]" id="boxzilla-rule-comparison">
43
  <option value="any" <?php selected( $opts['rules_comparision'], 'any' ); ?>><?php _e( 'any', 'boxzilla' ); ?></option>
44
  <option value="all" <?php selected( $opts['rules_comparision'], 'all' ); ?>><?php _e( 'all', 'boxzilla' ); ?></option>
45
  </select>
50
  <tbody id="boxzilla-box-rules">
51
  <?php
52
  $key = 0;
53
+ foreach( $opts['rules'] as $rule ) {
54
+ // skip invalid looking rules
55
+ if( ! array_key_exists( 'condition', $rule ) ) { continue; }
56
+
57
+ // output row showing "and" or "or" between rules
58
+ if($key > 0) {
59
+ $or = __( 'or', 'boxzilla' );
60
+ $and = __( 'and', 'boxzilla' );
61
+ $text = $opts['rules_comparision'] === 'any' ? $or : $and;
62
+
63
+ echo '<tr>';
64
+ echo '<th class="boxzilla-no-vpadding"></th>';
65
+ echo '<td class="boxzilla-no-vpadding"><span class="boxzilla-andor boxzilla-muted">' . $text . '</span></td>';
66
+ echo '</tr>';
67
+ }
68
+ ?>
69
  <tr valign="top" class="boxzilla-rule-row boxzilla-rule-row-<?php echo $key; ?>">
70
  <th style="text-align: right; font-weight: normal;">
71
  <span class="boxzilla-close boxzilla-remove-rule" title="<?php esc_attr_e( 'Remove rule', 'boxzilla' ); ?>"><span class="dashicons dashicons-dismiss"></span></span>
77
  } ?>
78
  </select>
79
 
80
+ <select class="boxzilla-rule-qualifier" name="boxzilla_box[rules][<?php echo $key; ?>][qualifier]" style="min-width: 135px;">
81
  <option value="1" <?php selected( ! isset( $rule['qualifier'] ) || $rule['qualifier'] ); ?>><?php _e( 'is', 'boxzilla' ); ?></option>
82
  <option value="0" <?php selected( isset( $rule['qualifier'] ) && !$rule['qualifier'] ); ?>><?php _e( 'is not', 'boxzilla' ); ?></option>
83
  <option value="contains" <?php selected( isset( $rule['qualifier'] ) && $rule['qualifier'] === 'contains' ); ?> style="display: none;"><?php _e( 'contains', 'boxzilla' ); ?>
92
  </tbody>
93
  <tr>
94
  <th></th>
95
+ <td><button type="button" class="button boxzilla-add-rule"><?php _e( 'Add another rule', 'boxzilla' ); ?></button></td>
96
  </tr>
97
  <tr valign="top">
98
  <th><label for="boxzilla_position"><?php _e( 'Box Position', 'boxzilla' ); ?></label></th>
228
 
229
 
230
  <script type="text/html" id="tmpl-rule-row-template">
231
+ <tr>
232
+ <th class="boxzilla-no-vpadding"></th>
233
+ <td class="boxzilla-no-vpadding"><span class="boxzilla-andor boxzilla-muted">{{data.andor}}</span></td>
234
+ </tr>
235
  <tr valign="top" class="boxzilla-rule-row boxzilla-rule-row-{{{data.key}}}">
236
  <th style="text-align: right; font-weight: normal;">
237
  <span class="boxzilla-close boxzilla-remove-rule" title="<?php esc_attr_e( 'Remove rule', 'boxzilla' ); ?>"><span class="dashicons dashicons-dismiss"></span></span>
242
  printf( '<option value="%s" %s %s>%s</option>', $value, disabled( $value, '', false ), '', $label );
243
  } ?>
244
  </select>
245
+ <select class="boxzilla-rule-qualifier" name="boxzilla_box[rules][{{{data.key}}}][qualifier]" style="display: none; min-width: 135px;" >
246
  <option value="1" selected><?php _e( 'is', 'boxzilla' ); ?></option>
247
  <option value="0"><?php _e( 'is not', 'boxzilla' ); ?></option>
248
  <option value="contains" style="display: none;"><?php _e( 'contains', 'boxzilla' ); ?></option>