Boxzilla - Version 3.2.5

Version Description

Download this release

Release Info

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

Code changes from version 3.2.4 to 3.2.5

assets/browserify/admin/_admin.js CHANGED
@@ -63,6 +63,7 @@
63
  betterInput.style.display = '';
64
  valueInput.style.display = 'none';
65
  qualifierInput.style.display = '';
 
66
  qualifierInput.querySelector('option[value="contains"]').style.display = 'none';
67
  if (tnLoggedIn.parentNode) {
68
  tnLoggedIn.parentNode.removeChild(tnLoggedIn);
@@ -109,6 +110,7 @@
109
 
110
  case 'is_url':
111
  qualifierInput.querySelector('option[value="contains"]').style.display = '';
 
112
  betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;
113
  break;
114
 
@@ -133,6 +135,7 @@
133
 
134
  case 'is_referer':
135
  qualifierInput.querySelector('option[value="contains"]').style.display = '';
 
136
  break;
137
 
138
  }
63
  betterInput.style.display = '';
64
  valueInput.style.display = 'none';
65
  qualifierInput.style.display = '';
66
+ qualifierInput.querySelector('option[value="not_contains"]').style.display = 'none';
67
  qualifierInput.querySelector('option[value="contains"]').style.display = 'none';
68
  if (tnLoggedIn.parentNode) {
69
  tnLoggedIn.parentNode.removeChild(tnLoggedIn);
110
 
111
  case 'is_url':
112
  qualifierInput.querySelector('option[value="contains"]').style.display = '';
113
+ qualifierInput.querySelector('option[value="not_contains"]').style.display = '';
114
  betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;
115
  break;
116
 
135
 
136
  case 'is_referer':
137
  qualifierInput.querySelector('option[value="contains"]').style.display = '';
138
+ qualifierInput.querySelector('option[value="not_contains"]').style.display = '';
139
  break;
140
 
141
  }
assets/browserify/script.js CHANGED
@@ -42,9 +42,10 @@
42
  }
43
 
44
  // create boxes from options
45
- for( var i=0; i < options.boxes.length; i++ ) {
 
46
  // get opts
47
- var boxOpts = options.boxes[i];
48
  boxOpts.testMode = isLoggedIn && options.testMode;
49
 
50
  // find box content element, bail if not found
42
  }
43
 
44
  // create boxes from options
45
+ for(var key in options.boxes) {
46
+
47
  // get opts
48
+ var boxOpts = options.boxes[key];
49
  boxOpts.testMode = isLoggedIn && options.testMode;
50
 
51
  // find box content element, bail if not found
assets/js/admin-script.js CHANGED
@@ -71,6 +71,7 @@ window.Boxzilla_Admin = require('./admin/_admin.js');
71
  betterInput.style.display = '';
72
  valueInput.style.display = 'none';
73
  qualifierInput.style.display = '';
 
74
  qualifierInput.querySelector('option[value="contains"]').style.display = 'none';
75
  if (tnLoggedIn.parentNode) {
76
  tnLoggedIn.parentNode.removeChild(tnLoggedIn);
@@ -117,6 +118,7 @@ window.Boxzilla_Admin = require('./admin/_admin.js');
117
 
118
  case 'is_url':
119
  qualifierInput.querySelector('option[value="contains"]').style.display = '';
 
120
  betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;
121
  break;
122
 
@@ -141,6 +143,7 @@ window.Boxzilla_Admin = require('./admin/_admin.js');
141
 
142
  case 'is_referer':
143
  qualifierInput.querySelector('option[value="contains"]').style.display = '';
 
144
  break;
145
 
146
  }
71
  betterInput.style.display = '';
72
  valueInput.style.display = 'none';
73
  qualifierInput.style.display = '';
74
+ qualifierInput.querySelector('option[value="not_contains"]').style.display = 'none';
75
  qualifierInput.querySelector('option[value="contains"]').style.display = 'none';
76
  if (tnLoggedIn.parentNode) {
77
  tnLoggedIn.parentNode.removeChild(tnLoggedIn);
118
 
119
  case 'is_url':
120
  qualifierInput.querySelector('option[value="contains"]').style.display = '';
121
+ qualifierInput.querySelector('option[value="not_contains"]').style.display = '';
122
  betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;
123
  break;
124
 
143
 
144
  case 'is_referer':
145
  qualifierInput.querySelector('option[value="contains"]').style.display = '';
146
+ qualifierInput.querySelector('option[value="not_contains"]').style.display = '';
147
  break;
148
 
149
  }
assets/js/admin-script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var e=void 0,t=void 0;!function(){function t(n,r,o){function i(s,a){if(!r[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=r[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,r,o)}return r[s].exports}for(var l="function"==typeof e&&e,s=0;s<o.length;s++)i(o[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:r(this).parents("tr").get(0),t=e.querySelector(".boxzilla-rule-condition").value,n=e.querySelector(".boxzilla-rule-value"),o=e.querySelector(".boxzilla-rule-qualifier"),i=n.cloneNode(!0),l=r(i);switch(r(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",o.style.display="",o.querySelector('option[value="contains"]').style.display="none",s.parentNode&&s.parentNode.removeChild(s),t){default:i.placeholder=p.enterCommaSeparatedValues;break;case"":case"everywhere":o.value="1",n.value="",i.style.display="none",o.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":o.querySelector('option[value="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":o.querySelector('option[value="contains"]').style.display=""}}var r=window.jQuery,o=e("./_option.js"),i=document.getElementById("boxzilla-box-options-controls"),l=r(i),s=document.createTextNode(" logged in");if(0!==l.length){var a=new(e("wolfy87-eventemitter")),u=e("./_designer.js")(r,o,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 r(document.getElementById("boxzilla-box-rules")).after(t),!1}),l.on("click",".boxzilla-remove-rule",function(){r(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)}),r(window).load(function(){void 0===window.tinyMCE&&(document.getElementById("notice-notinymce").style.display="")}),r(".boxzilla-rule-row").each(n),t.exports={Designer:u,Option:o,events:a}}}()},{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(e,t,n){"use strict";var r="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 o(){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:o,clear:o}),p.find(":input").not(".boxzilla-color-field").change(o),n.on("editor.init",o),{init:function(){"object"===r(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();o(),n.trigger("editor.styles.reset")},options:u}}},{}],4:[function(e,t,n){"use strict";var r=window.jQuery,o=function(e){"string"==typeof e&&(e=document.getElementById("boxzilla-"+e)),e||console.error("Unable to find option element."),this.element=e};o.prototype.getColorValue=function(){return this.element.value.length>0?r(this.element).hasClass("wp-color-field")?r(this.element).wpColorPicker("color"):this.element.value:""},o.prototype.getPxValue=function(e){return this.element.value.length>0?parseInt(this.element.value)+"px":e||""},o.prototype.getValue=function(e){return this.element.value.length>0?this.element.value:e||""},o.prototype.clear=function(){this.element.value=""},o.prototype.setValue=function(e){this.element.value=e},t.exports=o},{}],5:[function(e,n,r){!function(e){"use strict";function r(){}function o(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=r.prototype,a=e.EventEmitter;s.getListeners=function(e){var t,n,r=this._getEvents();if(e instanceof RegExp){t={};for(n in r)r.hasOwnProperty(n)&&e.test(n)&&(t[n]=r[n])}else t=r[e]||(r[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,r=this.getListenersAsObject(e),i="object"==typeof t;for(n in r)r.hasOwnProperty(n)&&-1===o(r[n],t)&&r[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,r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&-1!==(n=o(i[r],t))&&i[r].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 r,o,i=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(r=n.length;r--;)i.call(this,t,n[r]);else for(r in t)t.hasOwnProperty(r)&&(o=t[r])&&("function"==typeof o?i.call(this,r,o):l.call(this,r,o));return this},s.removeEvent=function(e){var t,n=typeof e,r=this._getEvents();if("string"===n)delete r[e];else if(e instanceof RegExp)for(t in r)r.hasOwnProperty(t)&&e.test(t)&&delete r[t];else delete this._events;return this},s.removeAllListeners=i("removeEvent"),s.emitEvent=function(e,t){var n,r,o,i,l=this.getListenersAsObject(e);for(i in l)if(l.hasOwnProperty(i))for(n=l[i].slice(0),o=0;o<n.length;o++)!0===(r=n[o]).once&&this.removeListener(e,r.listener),r.listener.apply(this,t||[])===this._getOnceReturnValue()&&this.removeListener(e,r.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={})},r.noConflict=function(){return e.EventEmitter=a,r},"function"==typeof t&&t.amd?t(function(){return r}):"object"==typeof n&&n.exports?n.exports=r:e.EventEmitter=r}(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;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
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,EAAQ,IAAIS,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,IAAIQ,YAAYZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAG,IAAIE,EAAED,EAAEI,GAAG,GAAGL,GAAG,OAAOI,EAAEF,GAAIF,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGQ,QAAkD,IAAI,IAA1CL,EAAkB,mBAATX,GAAqBA,EAAgBQ,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAAE,OAAOJ,EAA3c,EAAA,EAAkdgB,GAAG,SAASnB,EAAQoB,EAAOJ,GAC9lB,aAEAK,OAAOC,eAAiBtB,EAAQ,uBAE7BuB,oBAAoB,IAAIC,GAAG,SAASxB,EAAQoB,EAAOJ,GACtD,cAEA,WA2CI,SAASS,IACL,IAAIC,EAAyC,OAA/BC,KAAKC,QAAQC,cAAyBF,KAAOG,EAAEH,MAAMI,QAAQ,MAAMC,IAAI,GACjFC,EAAYP,EAAQQ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amD,WAAa,WAEtB,OADAjL,EAAQ8H,aAAeW,EAChBX,GAIW,mBAAX5I,GAAyBA,EAAOgM,IACvChM,EAAO,WACH,OAAO4I,IAGY,iBAAX1H,GAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAU8H,EAGjB9H,EAAQ8H,aAAeA,EA5d9B,CA8dCnH,oBAES,IAzzBX","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\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=\"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 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 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","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,EAAQ,IAAIS,GAAGC,E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uF,eAAe/E,IAAQ4E,EAAII,KAAKhF,WAChCR,EAAOQ,eAMfpD,KAAK4J,QAGhB,OAAO5J,MAQX6H,EAAMgC,mBAAqBtC,EAAM,eAcjCM,EAAMiC,UAAY,SAAmB9B,EAAK+B,GACtC,IACI1C,EACAC,EACAtI,EACAoE,EAJA4G,EAAehK,KAAKwI,qBAAqBR,GAO7C,IAAK5E,KAAO4G,EACR,GAAIA,EAAa7B,eAAe/E,GAG5B,IAFAiE,EAAY2C,EAAa5G,GAAK6G,MAAM,GAE/BjL,EAAI,EAAGA,EAAIqI,EAAU9H,OAAQP,KAKR,KAFtBsI,EAAWD,EAAUrI,IAER6J,MACT7I,KAAKkJ,eAAelB,EAAKV,EAASA,UAG3BA,EAASA,SAASG,MAAMzH,KAAM+J,SAExB/J,KAAKkK,uBAClBlK,KAAKkJ,eAAelB,EAAKV,EAASA,UAMlD,OAAOtH,MAMX6H,EAAMrC,QAAU+B,EAAM,aAUtBM,EAAMsC,KAAO,SAAcnC,GACvB,IAAI+B,EAAOtB,MAAMpE,UAAU4F,MAAM3K,KAAKoI,UAAW,GACjD,OAAO1H,KAAK8J,UAAU9B,EAAK+B,IAW/BlC,EAAMuC,mBAAqB,SAA4B5J,GAEnD,OADAR,KAAKqK,iBAAmB7J,EACjBR,MAWX6H,EAAMqC,oBAAsB,WACxB,OAAIlK,KAAKmI,eAAe,qBACbnI,KAAKqK,kBAapBxC,EAAMK,WAAa,WACf,OAAOlI,KAAK4J,UAAY5J,KAAK4J,aAQjCzC,EAAamD,WAAa,WAEtB,OADAjL,EAAQ8H,aAAeW,EAChBX,GAIW,mBAAX5I,GAAyBA,EAAOgM,IACvChM,EAAO,WACH,OAAO4I,IAGY,iBAAX1H,GAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAU8H,EAGjB9H,EAAQ8H,aAAeA,EA5d9B,CA8dCnH,oBAES,IA5zBX","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\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; })();"]}
assets/js/script.js CHANGED
@@ -47,9 +47,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
47
  }
48
 
49
  // create boxes from options
50
- for (var i = 0; i < options.boxes.length; i++) {
 
51
  // get opts
52
- var boxOpts = options.boxes[i];
53
  boxOpts.testMode = isLoggedIn && options.testMode;
54
 
55
  // find box content element, bail if not found
47
  }
48
 
49
  // create boxes from options
50
+ for (var key in options.boxes) {
51
+
52
  // get opts
53
+ var boxOpts = options.boxes[key];
54
  boxOpts.testMode = isLoggedIn && options.testMode;
55
 
56
  // find box content element, bail if not found
assets/js/script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var t=void 0,e=void 0;!function(){function e(i,n,o){function r(l,a){if(!n[l]){if(!i[l]){var c="function"==typeof t&&t;if(!a&&c)return c(l,!0);if(s)return s(l,!0);var d=new Error("Cannot find module '"+l+"'");throw d.code="MODULE_NOT_FOUND",d}var h=n[l]={exports:{}};i[l][0].call(h.exports,function(t){var e=i[l][1][t];return r(e||t)},h,h.exports,e,i,n,o)}return n[l].exports}for(var s="function"==typeof t&&t,l=0;l<o.length;l++)r(o[l]);return r}return e}()({1:[function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){function e(t,e){e.background_color&&(t.style.background=e.background_color),e.color&&(t.style.color=e.color),e.border_color&&(t.style.borderColor=e.border_color),e.border_width&&(t.style.borderWidth=parseInt(e.border_width)+"px"),e.border_style&&(t.style.borderStyle=e.border_style),e.width&&(t.style.maxWidth=parseInt(e.width)+"px")}var i=t("boxzilla"),o=window.boxzilla_options;window.Boxzilla=i;var r=document.body.className.indexOf("logged-in")>-1;r&&o.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),i.init(),window.addEventListener("load",function(){if(!o.inited){for(var t=0;t<o.boxes.length;t++){var s=o.boxes[t];s.testMode=r&&o.testMode;var l=document.getElementById("boxzilla-box-"+s.id+"-content");if(l){s.content=l;var a=i.create(s.id,s);a.element.className=a.element.className+" boxzilla-"+s.post.slug,e(a.element,s.css),a.element.firstChild.firstChild.className+=" first-child",a.element.firstChild.lastChild.className+=" last-child",a.fits()&&function(t){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.substring(1);return!!/^[a-zA-Z\-\_0-9]+$/.test(e)&&(e===t.element.id||!!t.element.querySelector("#"+e))}(a)&&a.show()}}o.inited=!0,i.trigger("done"),function(){if("object"===n(window.mc4wp_forms_config)&&window.mc4wp_forms_config.submitted_form){var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=i.boxes;for(var o in e)if(e.hasOwnProperty(o)){var r=e[o];if(r.element.querySelector(t))return void r.show()}}}()}})}()},{boxzilla:5}],2:[function(t,i,n){(function(){"use strict";function t(){}function n(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}var r=t.prototype,s=this,l=s.EventEmitter;r.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp){e={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},r.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},r.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},r.addListener=function(t,e){var i,o=this.getListenersAsObject(t),r="object"==typeof e;for(i in o)o.hasOwnProperty(i)&&-1===n(o[i],e)&&o[i].push(r?e:{listener:e,once:!1});return this},r.on=o("addListener"),r.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},r.once=o("addOnceListener"),r.defineEvent=function(t){return this.getListeners(t),this},r.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},r.removeListener=function(t,e){var i,o,r=this.getListenersAsObject(t);for(o in r)r.hasOwnProperty(o)&&-1!==(i=n(r[o],e))&&r[o].splice(i,1);return this},r.off=o("removeListener"),r.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},r.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},r.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},r.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},r.removeAllListeners=o("removeEvent"),r.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(o=(i=s[r].slice(0)).length;o--;)!0===(n=i[o]).once&&this.removeListener(t,n.listener),n.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},r.trigger=o("emitEvent"),r.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},r.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},r._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},r._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return s.EventEmitter=l,t},"function"==typeof e&&e.amd?e(function(){return t}):"object"==typeof i&&i.exports?i.exports=t:s.EventEmitter=t}).call(this)},{}],3:[function(t,e,i){"use strict";function n(t,e){for(var i in e)t.style[i]=e[i]}function o(t,e,i){var n=+new Date,o=window.getComputedStyle(t),s={},l={};for(var a in e){e[a]=parseFloat(e[a]);var c=e[a],d=parseFloat(o[a]);d!=c?(l[a]=(c-d)/r,s[a]=d):delete e[a]}!function o(){var r,a,c,d,h=+new Date-n,f=!0;for(var u in e){r=l[u],a=e[u],c=r*h,d=s[u]+c,r>0&&d>=a||r<0&&d<=a?d=a:f=!1,s[u]=d;var g="opacity"!==u?"px":"";t.style[u]=d+g}n=+new Date,f?i&&i():window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,32)}()}var r=320;e.exports={toggle:function(t,e,i){var r="none"!=t.style.display||t.offsetLeft>0,s=t.cloneNode(!0),l=function(){t.removeAttribute("data-animated"),t.setAttribute("style",s.getAttribute("style")),t.style.display=r?"none":"",i&&i()};t.setAttribute("data-animated","true"),r||(t.style.display="");var a,c;if("slide"===e){if(a=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),c={},!r){if(c=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],window.getComputedStyle(t)),!isFinite(c.height)){var d=t.getBoundingClientRect();c.height=d.height}n(t,a)}t.style.overflowY="hidden",o(t,r?a:c,l)}else a={opacity:0},c={opacity:1},r||n(t,a),o(t,r?a:c,l)},animate:o,animated:function(t){return!!t.getAttribute("data-animated")}}},{}],4:[function(t,e,i){"use strict";var n,o={animation:"fade",rehide:!1,content:"",cookie:null,icon:"&times",screenWidthCondition:null,position:"center",testMode:!1,trigger:!1,closable:!0},r=t("./animator.js"),s=function(t,e){this.id=t,this.config=function(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i}(o,e),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()};s.prototype.events=function(){var t=this;this.closeIcon&&this.closeIcon.addEventListener("click",this.dismiss.bind(this)),this.element.addEventListener("click",function(e){"A"===e.target.tagName&&n.trigger("box.interactions.link",[t,e.target])},!1),this.element.addEventListener("submit",function(e){t.setCookie(),n.trigger("box.interactions.form",[t,e.target])},!1)},s.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e=document.createElement("div");e.setAttribute("id","boxzilla-"+this.id),e.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,e.style.display="none",t.appendChild(e);var i;if("string"==typeof this.config.content?(i=document.createElement("div")).innerHTML=this.config.content:(i=this.config.content).style.display="",i.className="boxzilla-content",e.appendChild(i),this.config.closable&&this.config.icon){var n=document.createElement("span");n.className="boxzilla-close-icon",n.innerHTML=this.config.icon,e.appendChild(n),this.closeIcon=n}document.body.appendChild(t),this.contentElement=i,this.element=e},s.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="auto",this.element.style.maxHeight="none";var e=window.innerHeight,i=this.element.clientHeight;if(i>e&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(e-i)/2;n=n>=0?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=t},s.prototype.toggle=function(t){return void 0===t&&(t=!this.visible),t!==this.visible&&(!r.animated(this.element)&&(!(!t&&!this.config.closable)&&(this.visible=t,this.setCustomBoxStyling(),n.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),r.toggle(this.overlay,"fade")),r.toggle(this.element,this.config.animation,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)),!0)))},s.prototype.show=function(){return this.toggle(!0)},s.prototype.hide=function(){return this.toggle(!1)},s.prototype.calculateTriggerHeight=function(){var t=0;if(this.config.trigger)if("element"===this.config.trigger.method){var e=document.body.querySelector(this.config.trigger.value);if(e){t=e.getBoundingClientRect().top}}else"percentage"===this.config.trigger.method&&(t=this.config.trigger.value/100*function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}());return t},s.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},s.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},s.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},s.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},s.prototype.isCookieSet=function(){if(this.config.testMode||!this.config.trigger)return!1;if(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)return!1;return"true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1")},s.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},s.prototype.trigger=function(){this.show()&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},s.prototype.dismiss=function(t){return t&&t.preventDefault(),!!this.visible&&(this.hide(),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,n.trigger("box.dismiss",[this]),!0)},e.exports=function(t){return n=t,s}},{"./animator.js":3}],5:[function(t,e,i){"use strict";function n(t,e,i){e||(e=250);var n,o;return function(){var r=i||this,s=+new Date,l=arguments;n&&s<n+e?(clearTimeout(o),o=setTimeout(function(){n=s,t.apply(r,l)},e)):(n=s,t.apply(r,l))}}function o(t){27==t.keyCode&&E.dismiss()}function r(){f()||_.forEach(function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&w>=t.config.trigger.value&&t.trigger()})}function s(){f()||_.forEach(function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&b.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&y.time>=t.config.trigger.value&&t.trigger())})}function l(){var t=C.hasOwnProperty("pageYOffset")?C.pageYOffset:C.scrollTop;t+=.9*window.innerHeight,_.forEach(function(e){if(e.mayAutoShow()&&!(e.triggerHeight<=0))if(t>e.triggerHeight){if(f())return;e.trigger()}else e.mayRehide()&&e.hide()})}function a(){_.forEach(function(t){t.onResize()})}function c(t){var e=t.offsetX,i=t.offsetY;_.forEach(function(t){var n=t.element.getBoundingClientRect();(e<n.left-40||e>n.right+40||i<n.top-40||i>n.bottom+40)&&t.dismiss()})}function d(){v||f()||(_.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()}),v=!0)}function h(t){t.clientY<=0&&(p=window.setTimeout(d,400))}function f(){for(var t=0;t<_.length;t++){if(_[t].visible)return!0}return!1}function u(){p&&(window.clearInterval(p),p=null)}function g(t){for(var e=t.target||t.srcElement,i=0;i<=3&&(e&&"A"!==e.tagName);i++)e=e.parentElement;if(e&&"A"===e.tagName&&e.getAttribute("href")&&0===e.getAttribute("href").toLowerCase().indexOf("#boxzilla-")){var n=e.getAttribute("href").toLowerCase().substring("#boxzilla-".length);E.toggle(n)}}var m,p,v,b,y,w,x=t("wolfy87-eventemitter"),E=Object.create(x.prototype),z=t("./box.js")(E),L=t("./timer.js"),_=[],C=window,k=function(){try{var t=sessionStorage.getItem("boxzilla_timer");t&&(b.time=t)}catch(t){}b.start(),y.start()},S=function(){sessionStorage.setItem("boxzilla_timer",b.time),b.stop(),y.stop()};E.init=function(){document.body.addEventListener("click",g,!0);try{w=sessionStorage.getItem("boxzilla_pageviews")||0}catch(t){w=0}b=new L(0),y=new L(0);var e=t("./styles.js"),i=document.createElement("style");i.setAttribute("type","text/css"),i.innerHTML=e,document.head.appendChild(i),(m=document.createElement("div")).style.display="none",m.id="boxzilla-overlay",document.body.appendChild(m),C.addEventListener("touchstart",n(l),!0),C.addEventListener("scroll",n(l),!0),window.addEventListener("resize",n(a)),window.addEventListener("load",a),m.addEventListener("click",c),window.setInterval(s,1e3),window.setTimeout(r,1e3),document.documentElement.addEventListener("mouseleave",h),document.documentElement.addEventListener("mouseenter",u),document.addEventListener("keyup",o),k(),window.addEventListener("focus",k),window.addEventListener("beforeunload",function(){S(),sessionStorage.setItem("boxzilla_pageviews",++w)}),window.addEventListener("blur",S),E.trigger("ready")},E.create=function(t,e){void 0!==e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new z(t,e);return _.push(i),i},E.get=function(t){for(var e=0;e<_.length;e++){var i=_[e];if(i.id==t)return i}throw new Error("No box exists with ID "+t)},E.dismiss=function(t){void 0===t?_.forEach(function(t){t.dismiss()}):E.get(t).dismiss()},E.hide=function(t){void 0===t?_.forEach(function(t){t.hide()}):E.get(t).hide()},E.show=function(t){void 0===t?_.forEach(function(t){t.show()}):E.get(t).show()},E.toggle=function(t){void 0===t?_.forEach(function(t){t.toggle()}):E.get(t).toggle()},E.boxes=_,window.Boxzilla=E,void 0!==e&&e.exports&&(e.exports=E)},{"./box.js":4,"./styles.js":6,"./timer.js":7,"wolfy87-eventemitter":2}],6:[function(t,e,i){"use strict";e.exports="#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"},{}],7:[function(t,e,i){"use strict";var n=function(t){this.time=t,this.interval=0};n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}]},{},[1])}();
2
  //# sourceMappingURL=script.min.js.map
1
+ !function(){var t=void 0,e=void 0;!function(){function e(i,n,o){function r(l,a){if(!n[l]){if(!i[l]){var c="function"==typeof t&&t;if(!a&&c)return c(l,!0);if(s)return s(l,!0);var d=new Error("Cannot find module '"+l+"'");throw d.code="MODULE_NOT_FOUND",d}var h=n[l]={exports:{}};i[l][0].call(h.exports,function(t){var e=i[l][1][t];return r(e||t)},h,h.exports,e,i,n,o)}return n[l].exports}for(var s="function"==typeof t&&t,l=0;l<o.length;l++)r(o[l]);return r}return e}()({1:[function(t,e,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){function e(t,e){e.background_color&&(t.style.background=e.background_color),e.color&&(t.style.color=e.color),e.border_color&&(t.style.borderColor=e.border_color),e.border_width&&(t.style.borderWidth=parseInt(e.border_width)+"px"),e.border_style&&(t.style.borderStyle=e.border_style),e.width&&(t.style.maxWidth=parseInt(e.width)+"px")}var i=t("boxzilla"),o=window.boxzilla_options;window.Boxzilla=i;var r=document.body.className.indexOf("logged-in")>-1;r&&o.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),i.init(),window.addEventListener("load",function(){if(!o.inited){for(var t in o.boxes){var s=o.boxes[t];s.testMode=r&&o.testMode;var l=document.getElementById("boxzilla-box-"+s.id+"-content");if(l){s.content=l;var a=i.create(s.id,s);a.element.className=a.element.className+" boxzilla-"+s.post.slug,e(a.element,s.css),a.element.firstChild.firstChild.className+=" first-child",a.element.firstChild.lastChild.className+=" last-child",a.fits()&&function(t){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.substring(1);return!!/^[a-zA-Z\-\_0-9]+$/.test(e)&&(e===t.element.id||!!t.element.querySelector("#"+e))}(a)&&a.show()}}o.inited=!0,i.trigger("done"),function(){if("object"===n(window.mc4wp_forms_config)&&window.mc4wp_forms_config.submitted_form){var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=i.boxes;for(var o in e)if(e.hasOwnProperty(o)){var r=e[o];if(r.element.querySelector(t))return void r.show()}}}()}})}()},{boxzilla:5}],2:[function(t,i,n){(function(){"use strict";function t(){}function n(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}var r=t.prototype,s=this,l=s.EventEmitter;r.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp){e={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},r.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},r.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},r.addListener=function(t,e){var i,o=this.getListenersAsObject(t),r="object"==typeof e;for(i in o)o.hasOwnProperty(i)&&-1===n(o[i],e)&&o[i].push(r?e:{listener:e,once:!1});return this},r.on=o("addListener"),r.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},r.once=o("addOnceListener"),r.defineEvent=function(t){return this.getListeners(t),this},r.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},r.removeListener=function(t,e){var i,o,r=this.getListenersAsObject(t);for(o in r)r.hasOwnProperty(o)&&-1!==(i=n(r[o],e))&&r[o].splice(i,1);return this},r.off=o("removeListener"),r.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},r.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},r.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},r.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},r.removeAllListeners=o("removeEvent"),r.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(o=(i=s[r].slice(0)).length;o--;)!0===(n=i[o]).once&&this.removeListener(t,n.listener),n.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},r.trigger=o("emitEvent"),r.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},r.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},r._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},r._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return s.EventEmitter=l,t},"function"==typeof e&&e.amd?e(function(){return t}):"object"==typeof i&&i.exports?i.exports=t:s.EventEmitter=t}).call(this)},{}],3:[function(t,e,i){"use strict";function n(t,e){for(var i in e)t.style[i]=e[i]}function o(t,e,i){var n=+new Date,o=window.getComputedStyle(t),s={},l={};for(var a in e){e[a]=parseFloat(e[a]);var c=e[a],d=parseFloat(o[a]);d!=c?(l[a]=(c-d)/r,s[a]=d):delete e[a]}!function o(){var r,a,c,d,h=+new Date-n,f=!0;for(var u in e){r=l[u],a=e[u],c=r*h,d=s[u]+c,r>0&&d>=a||r<0&&d<=a?d=a:f=!1,s[u]=d;var g="opacity"!==u?"px":"";t.style[u]=d+g}n=+new Date,f?i&&i():window.requestAnimationFrame&&requestAnimationFrame(o)||setTimeout(o,32)}()}var r=320;e.exports={toggle:function(t,e,i){var r="none"!=t.style.display||t.offsetLeft>0,s=t.cloneNode(!0),l=function(){t.removeAttribute("data-animated"),t.setAttribute("style",s.getAttribute("style")),t.style.display=r?"none":"",i&&i()};t.setAttribute("data-animated","true"),r||(t.style.display="");var a,c;if("slide"===e){if(a=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),c={},!r){if(c=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],window.getComputedStyle(t)),!isFinite(c.height)){var d=t.getBoundingClientRect();c.height=d.height}n(t,a)}t.style.overflowY="hidden",o(t,r?a:c,l)}else a={opacity:0},c={opacity:1},r||n(t,a),o(t,r?a:c,l)},animate:o,animated:function(t){return!!t.getAttribute("data-animated")}}},{}],4:[function(t,e,i){"use strict";var n,o={animation:"fade",rehide:!1,content:"",cookie:null,icon:"&times",screenWidthCondition:null,position:"center",testMode:!1,trigger:!1,closable:!0},r=t("./animator.js"),s=function(t,e){this.id=t,this.config=function(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i}(o,e),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()};s.prototype.events=function(){var t=this;this.closeIcon&&this.closeIcon.addEventListener("click",this.dismiss.bind(this)),this.element.addEventListener("click",function(e){"A"===e.target.tagName&&n.trigger("box.interactions.link",[t,e.target])},!1),this.element.addEventListener("submit",function(e){t.setCookie(),n.trigger("box.interactions.form",[t,e.target])},!1)},s.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e=document.createElement("div");e.setAttribute("id","boxzilla-"+this.id),e.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,e.style.display="none",t.appendChild(e);var i;if("string"==typeof this.config.content?(i=document.createElement("div")).innerHTML=this.config.content:(i=this.config.content).style.display="",i.className="boxzilla-content",e.appendChild(i),this.config.closable&&this.config.icon){var n=document.createElement("span");n.className="boxzilla-close-icon",n.innerHTML=this.config.icon,e.appendChild(n),this.closeIcon=n}document.body.appendChild(t),this.contentElement=i,this.element=e},s.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="auto",this.element.style.maxHeight="none";var e=window.innerHeight,i=this.element.clientHeight;if(i>e&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(e-i)/2;n=n>=0?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=t},s.prototype.toggle=function(t){return void 0===t&&(t=!this.visible),t!==this.visible&&(!r.animated(this.element)&&(!(!t&&!this.config.closable)&&(this.visible=t,this.setCustomBoxStyling(),n.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),r.toggle(this.overlay,"fade")),r.toggle(this.element,this.config.animation,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)),!0)))},s.prototype.show=function(){return this.toggle(!0)},s.prototype.hide=function(){return this.toggle(!1)},s.prototype.calculateTriggerHeight=function(){var t=0;if(this.config.trigger)if("element"===this.config.trigger.method){var e=document.body.querySelector(this.config.trigger.value);if(e){t=e.getBoundingClientRect().top}}else"percentage"===this.config.trigger.method&&(t=this.config.trigger.value/100*function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}());return t},s.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},s.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},s.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},s.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},s.prototype.isCookieSet=function(){if(this.config.testMode||!this.config.trigger)return!1;if(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)return!1;return"true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1")},s.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},s.prototype.trigger=function(){this.show()&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},s.prototype.dismiss=function(t){return t&&t.preventDefault(),!!this.visible&&(this.hide(),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,n.trigger("box.dismiss",[this]),!0)},e.exports=function(t){return n=t,s}},{"./animator.js":3}],5:[function(t,e,i){"use strict";function n(t,e,i){e||(e=250);var n,o;return function(){var r=i||this,s=+new Date,l=arguments;n&&s<n+e?(clearTimeout(o),o=setTimeout(function(){n=s,t.apply(r,l)},e)):(n=s,t.apply(r,l))}}function o(t){27==t.keyCode&&E.dismiss()}function r(){f()||_.forEach(function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&w>=t.config.trigger.value&&t.trigger()})}function s(){f()||_.forEach(function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&b.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&y.time>=t.config.trigger.value&&t.trigger())})}function l(){var t=C.hasOwnProperty("pageYOffset")?C.pageYOffset:C.scrollTop;t+=.9*window.innerHeight,_.forEach(function(e){if(e.mayAutoShow()&&!(e.triggerHeight<=0))if(t>e.triggerHeight){if(f())return;e.trigger()}else e.mayRehide()&&e.hide()})}function a(){_.forEach(function(t){t.onResize()})}function c(t){var e=t.offsetX,i=t.offsetY;_.forEach(function(t){var n=t.element.getBoundingClientRect();(e<n.left-40||e>n.right+40||i<n.top-40||i>n.bottom+40)&&t.dismiss()})}function d(){v||f()||(_.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()}),v=!0)}function h(t){t.clientY<=0&&(p=window.setTimeout(d,400))}function f(){for(var t=0;t<_.length;t++){if(_[t].visible)return!0}return!1}function u(){p&&(window.clearInterval(p),p=null)}function g(t){for(var e=t.target||t.srcElement,i=0;i<=3&&(e&&"A"!==e.tagName);i++)e=e.parentElement;if(e&&"A"===e.tagName&&e.getAttribute("href")&&0===e.getAttribute("href").toLowerCase().indexOf("#boxzilla-")){var n=e.getAttribute("href").toLowerCase().substring("#boxzilla-".length);E.toggle(n)}}var m,p,v,b,y,w,x=t("wolfy87-eventemitter"),E=Object.create(x.prototype),z=t("./box.js")(E),L=t("./timer.js"),_=[],C=window,k=function(){try{var t=sessionStorage.getItem("boxzilla_timer");t&&(b.time=t)}catch(t){}b.start(),y.start()},S=function(){sessionStorage.setItem("boxzilla_timer",b.time),b.stop(),y.stop()};E.init=function(){document.body.addEventListener("click",g,!0);try{w=sessionStorage.getItem("boxzilla_pageviews")||0}catch(t){w=0}b=new L(0),y=new L(0);var e=t("./styles.js"),i=document.createElement("style");i.setAttribute("type","text/css"),i.innerHTML=e,document.head.appendChild(i),(m=document.createElement("div")).style.display="none",m.id="boxzilla-overlay",document.body.appendChild(m),C.addEventListener("touchstart",n(l),!0),C.addEventListener("scroll",n(l),!0),window.addEventListener("resize",n(a)),window.addEventListener("load",a),m.addEventListener("click",c),window.setInterval(s,1e3),window.setTimeout(r,1e3),document.documentElement.addEventListener("mouseleave",h),document.documentElement.addEventListener("mouseenter",u),document.addEventListener("keyup",o),k(),window.addEventListener("focus",k),window.addEventListener("beforeunload",function(){S(),sessionStorage.setItem("boxzilla_pageviews",++w)}),window.addEventListener("blur",S),E.trigger("ready")},E.create=function(t,e){void 0!==e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new z(t,e);return _.push(i),i},E.get=function(t){for(var e=0;e<_.length;e++){var i=_[e];if(i.id==t)return i}throw new Error("No box exists with ID "+t)},E.dismiss=function(t){void 0===t?_.forEach(function(t){t.dismiss()}):E.get(t).dismiss()},E.hide=function(t){void 0===t?_.forEach(function(t){t.hide()}):E.get(t).hide()},E.show=function(t){void 0===t?_.forEach(function(t){t.show()}):E.get(t).show()},E.toggle=function(t){void 0===t?_.forEach(function(t){t.toggle()}):E.get(t).toggle()},E.boxes=_,window.Boxzilla=E,void 0!==e&&e.exports&&(e.exports=E)},{"./box.js":4,"./styles.js":6,"./timer.js":7,"wolfy87-eventemitter":2}],6:[function(t,e,i){"use strict";e.exports="#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"},{}],7:[function(t,e,i){"use strict";var n=function(t){this.time=t,this.interval=0};n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}]},{},[1])}();
2
  //# sourceMappingURL=script.min.js.map
assets/js/script.min.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["script.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","_typeof","Symbol","iterator","obj","constructor","prototype","css","element","styles","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","Boxzilla","options","window","boxzilla_options","isLoggedIn","document","body","className","indexOf","testMode","console","log","init","addEventListener","inited","boxes","boxOpts","boxContentElement","getElementById","id","content","box","create","post","slug","firstChild","lastChild","fits","location","hash","elementId","substring","test","querySelector","locationHashRefersBox","show","trigger","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","maybeOpenMailChimpForWordPressBox","boxzilla","2","EventEmitter","indexOfListener","listeners","listener","alias","name","this","apply","arguments","proto","originalGlobalValue","getListeners","evt","response","key","events","_getEvents","RegExp","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","listenerIsWrapped","once","on","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","value","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd","3","property","animate","targetStyles","fn","last","Date","initialStyles","getComputedStyle","currentStyles","propSteps","parseFloat","to","current","duration","tick","step","increment","newValue","timeSinceLastTick","done","suffix","requestAnimationFrame","setTimeout","toggle","animation","callbackFn","nowVisible","display","offsetLeft","clone","cloneNode","cleanup","removeAttribute","setAttribute","getAttribute","hiddenStyles","visibleStyles","properties","newObject","initObjectProperties","object","copyObjectProperties","isFinite","height","clientRect","getBoundingClientRect","overflowY","opacity","animated","4","defaults","rehide","cookie","icon","screenWidthCondition","position","closable","Animator","Box","config","obj1","obj2","obj3","attrname","merge","overlay","visible","dismissed","triggered","triggerHeight","calculateTriggerHeight","cookieSet","isCookieSet","contentElement","closeIcon","dom","dismiss","bind","target","tagName","setCookie","wrapper","createElement","appendChild","innerHTML","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","clientHeight","newTopMargin","marginTop","classList","hide","method","triggerElement","top","html","documentElement","Math","max","scrollHeight","offsetHeight","getDocumentHeight","condition","innerWidth","onResize","mayAutoShow","mayRehide","replace","hours","expiryDate","setHours","getHours","toUTCString","preventDefault","_Boxzilla","./animator.js","5","throttle","threshhold","scope","deferTimer","context","now","clearTimeout","onKeyUp","keyCode","checkPageViewsCriteria","isAnyBoxVisible","forEach","pageViews","checkTimeCriteria","siteTimer","time","pageTimer","checkHeightCriteria","scrollY","scrollElement","pageYOffset","scrollTop","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","left","right","bottom","triggerExitIntent","exitIntentTriggered","onMouseLeave","clientY","exitIntentDelayTimer","onMouseEnter","clearInterval","onElementClick","el","srcElement","parentElement","toLowerCase","Object","Timer","timers","sessionTime","sessionStorage","getItem","start","setItem","stop","styleElement","head","setInterval","opts","minimumScreenWidth","get","./box.js","./styles.js","./timer.js","wolfy87-eventemitter","6","7","interval"],"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,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,IAAIQ,YAAYZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAG,IAAIE,EAAED,EAAEI,GAAG,GAAGL,GAAG,OAAOI,EAAEF,GAAIF,IAAIY,EAAEA,EAAEC,QAAQb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R,WAAW,EAAEC,cAAc,EAAEC,aAAa,EAAEC,uBAAuB,IAAIC,GAAG,SAAS1U,EAAQoB,EAAOJ,GACrG,aAGAI,EAAOJ,QADM,8hCAGP2T,GAAG,SAAS3U,EAAQoB,EAAOJ,GACjC,aAEA,IAAIwS,EAAQ,SAAeK,GACvB9N,KAAK2L,KAAOmC,EACZ9N,KAAK6O,SAAW,GAGpBpB,EAAM9R,UAAUsI,KAAO,WACnBjE,KAAK2L,QAGT8B,EAAM9R,UAAUmS,MAAQ,WACf9N,KAAK6O,WACN7O,KAAK6O,SAAW/R,OAAOqR,YAAYnO,KAAKiE,KAAK+D,KAAKhI,MAAO,OAIjEyN,EAAM9R,UAAUqS,KAAO,WACfhO,KAAK6O,WACL/R,OAAOoQ,cAAclN,KAAK6O,UAC1B7O,KAAK6O,SAAW,IAIxBxT,EAAOJ,QAAUwS,YAEN,IAv/CX","file":"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\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\n(function () {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n var options = window.boxzilla_options;\n\n // expose Boxzilla object to window\n window.Boxzilla = Boxzilla;\n\n // helper function for setting CSS styles\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n function createBoxesFromConfig() {\n\n // failsafe against including script twice.\n if (options.inited) {\n return;\n }\n\n // create boxes from options\n for (var i = 0; i < options.boxes.length; i++) {\n // get opts\n var boxOpts = options.boxes[i];\n boxOpts.testMode = isLoggedIn && options.testMode;\n\n // find box content element, bail if not found\n var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');\n if (!boxContentElement) {\n continue;\n }\n\n // use element as content option\n boxOpts.content = boxContentElement;\n\n // create box\n var box = Boxzilla.create(boxOpts.id, boxOpts);\n\n // add box slug to box element as classname\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug;\n\n // add custom css to box\n css(box.element, boxOpts.css);\n\n box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n\n // maybe show box right away\n if (box.fits() && locationHashRefersBox(box)) {\n box.show();\n }\n }\n\n // set flag to prevent initialising twice\n options.inited = true;\n\n // trigger \"done\" event.\n Boxzilla.trigger('done');\n\n // maybe open box with MC4WP form in it\n maybeOpenMailChimpForWordPressBox();\n }\n\n function locationHashRefersBox(box) {\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n }\n\n var elementId = window.location.hash.substring(1);\n\n // only attempt on strings looking like an ID \n var regex = /^[a-zA-Z\\-\\_0-9]+$/;\n if (!regex.test(elementId)) {\n return false;\n }\n\n if (elementId === box.element.id) {\n return true;\n } else if (box.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n }\n\n function maybeOpenMailChimpForWordPressBox() {\n if (_typeof(window.mc4wp_forms_config) !== \"object\" || !window.mc4wp_forms_config.submitted_form) {\n return;\n }\n\n var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;\n var boxes = Boxzilla.boxes;\n for (var boxId in boxes) {\n if (!boxes.hasOwnProperty(boxId)) {\n continue;\n }\n var box = boxes[boxId];\n if (box.element.querySelector(selector)) {\n box.show();\n return;\n }\n }\n }\n\n // print message when test mode is enabled\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n }\n\n // init boxzilla\n Boxzilla.init();\n\n // on window.load, create DOM elements for boxes\n window.addEventListener('load', createBoxesFromConfig);\n})();\n\n},{\"boxzilla\":5}],2:[function(require,module,exports){\n/*!\n * EventEmitter v4.2.11 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function () {\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 exports = this;\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 /**\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 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 second 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 second 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 i = listeners.length;\n\n while (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}.call(this));\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar duration = 320;\n\nfunction css(element, styles) {\n for (var property in styles) {\n element.style[property] = styles[property];\n }\n}\n\nfunction initObjectProperties(properties, value) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n return newObject;\n}\n\nfunction copyObjectProperties(properties, object) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n return newObject;\n}\n\n/**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\nfunction animated(element) {\n return !!element.getAttribute('data-animated');\n}\n\n/**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n */\nfunction toggle(element, animation, callbackFn) {\n var nowVisible = element.style.display != 'none' || element.offsetLeft > 0;\n\n // create clone for reference\n var clone = element.cloneNode(true);\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n if (callbackFn) {\n callbackFn();\n }\n };\n\n // store attribute so everyone knows we're animating this element\n element.setAttribute('data-animated', \"true\");\n\n // toggle element visiblity right away if we're making something visible\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles, visibleStyles;\n\n // animate properties\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles);\n\n // in some browsers, getComputedStyle returns \"auto\" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.\n if (!isFinite(visibleStyles.height)) {\n var clientRect = element.getBoundingClientRect();\n visibleStyles.height = clientRect.height;\n }\n css(element, hiddenStyles);\n }\n\n // don't show a scrollbar during animation\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = { opacity: 0 };\n visibleStyles = { opacity: 1 };\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n}\n\nfunction animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n // make sure we have an object filled with floats\n targetStyles[property] = parseFloat(targetStyles[property]);\n\n // calculate step size & current value\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]);\n\n // is there something to do?\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n\n var step, to, increment, newValue;\n for (var property in targetStyles) {\n step = propSteps[property];\n to = targetStyles[property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n }\n\n // store new value\n currentStyles[property] = newValue;\n\n var suffix = property !== \"opacity\" ? \"px\" : \"\";\n element.style[property] = newValue + suffix;\n }\n\n last = +new Date();\n\n // keep going until we're done for all props\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n}\n\nmodule.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n};\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'screenWidthCondition': null,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n},\n Boxzilla,\n Animator = require('./animator.js');\n\n/**\n* Merge 2 objects, values of the latter overwriting the former.\n*\n* @param obj1\n* @param obj2\n* @returns {*}\n*/\nfunction merge(obj1, obj2) {\n var obj3 = {};\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n return obj3;\n}\n\n/**\n* Get the real height of entire document.\n* @returns {number}\n*/\nfunction getDocumentHeight() {\n var body = document.body,\n html = document.documentElement;\n\n var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n\n return height;\n}\n\n// Box Object\nvar Box = function Box(id, config) {\n this.id = id;\n\n // store config values\n this.config = merge(defaults, config);\n\n // store ref to overlay\n this.overlay = document.getElementById('boxzilla-overlay');\n\n // state\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = this.calculateTriggerHeight();\n this.cookieSet = this.isCookieSet();\n this.element = null;\n this.contentElement = null;\n this.closeIcon = null;\n\n // create dom elements for this box\n this.dom();\n\n // further initialise the box\n this.events();\n};\n\n// initialise the box\nBox.prototype.events = function () {\n var box = this;\n\n // attach event to \"close\" icon inside box\n if (this.closeIcon) {\n this.closeIcon.addEventListener('click', this.dismiss.bind(this));\n }\n\n this.element.addEventListener('click', function (e) {\n if (e.target.tagName === 'A') {\n Boxzilla.trigger('box.interactions.link', [box, e.target]);\n }\n }, false);\n\n this.element.addEventListener('submit', function (e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [box, e.target]);\n }, false);\n};\n\n// generate dom elements for this box\nBox.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n\n var content;\n if (typeof this.config.content === \"string\") {\n content = document.createElement('div');\n content.innerHTML = this.config.content;\n } else {\n content = this.config.content;\n\n // make sure element is visible\n content.style.display = '';\n }\n content.className = 'boxzilla-content';\n box.appendChild(content);\n\n if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = \"boxzilla-close-icon\";\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.contentElement = content;\n this.element = box;\n};\n\n// set (calculate) custom box styling depending on box options\nBox.prototype.setCustomBoxStyling = function () {\n\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = 'auto';\n this.element.style.maxHeight = 'none';\n\n // get new dimensions\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight;\n\n // add scrollbar to box and limit height\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n }\n\n // set new top margin for boxes which are centered\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n};\n\n// toggle visibility of the box\nBox.prototype.toggle = function (show) {\n\n // revert visibility if no explicit argument is given\n if (typeof show === \"undefined\") {\n show = !this.visible;\n }\n\n // is box already at desired visibility?\n if (show === this.visible) {\n return false;\n }\n\n // is box being animated?\n if (Animator.animated(this.element)) {\n return false;\n }\n\n // if box should be hidden but is not closable, bail.\n if (!show && !this.config.closable) {\n return false;\n }\n\n // set new visibility status\n this.visible = show;\n\n // calculate new styling rules\n this.setCustomBoxStyling();\n\n // trigger event\n Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]);\n\n // show or hide box using selected animation\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n Animator.toggle(this.overlay, \"fade\");\n }\n\n Animator.toggle(this.element, this.config.animation, function () {\n if (this.visible) {\n return;\n }\n this.contentElement.innerHTML = this.contentElement.innerHTML;\n }.bind(this));\n\n return true;\n};\n\n// show the box\nBox.prototype.show = function () {\n return this.toggle(true);\n};\n\n// hide the box\nBox.prototype.hide = function () {\n return this.toggle(false);\n};\n\n// calculate trigger height\nBox.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger) {\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n }\n\n return triggerHeight;\n};\n\nBox.prototype.fits = function () {\n if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {\n return true;\n }\n\n switch (this.config.screenWidthCondition.condition) {\n case \"larger\":\n return window.innerWidth > this.config.screenWidthCondition.value;\n case \"smaller\":\n return window.innerWidth < this.config.screenWidthCondition.value;\n }\n\n // meh.. condition should be \"smaller\" or \"larger\", just return true.\n return true;\n};\n\nBox.prototype.onResize = function () {\n this.triggerHeight = this.calculateTriggerHeight();\n this.setCustomBoxStyling();\n};\n\n// is this box enabled?\nBox.prototype.mayAutoShow = function () {\n\n if (this.dismissed) {\n return false;\n }\n\n // check if box fits on given minimum screen width\n if (!this.fits()) {\n return false;\n }\n\n // if trigger empty or error in calculating triggerHeight, return false\n if (!this.config.trigger) {\n return false;\n }\n\n // rely on cookie value (show if not set, don't show if set)\n return !this.cookieSet;\n};\n\nBox.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function () {\n // always show on test mode or when no auto-trigger is configured\n if (this.config.testMode || !this.config.trigger) {\n return false;\n }\n\n // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n};\n\n// set cookie that disables automatically showing the box\nBox.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n};\n\nBox.prototype.trigger = function () {\n var shown = this.show();\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n};\n\n/**\n* Dismisses the box and optionally sets a cookie.\n*\n* @param e The event that triggered this dismissal.\n* @returns {boolean}\n*/\nBox.prototype.dismiss = function (e) {\n // prevent default action\n e && e.preventDefault();\n\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n }\n\n // hide box element\n this.hide();\n\n // set cookie\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n Boxzilla.trigger('box.dismiss', [this]);\n return true;\n};\n\nmodule.exports = function (_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n};\n\n},{\"./animator.js\":3}],5:[function(require,module,exports){\n'use strict';\n\nvar EventEmitter = require('wolfy87-eventemitter'),\n Boxzilla = Object.create(EventEmitter.prototype),\n Box = require('./box.js')(Boxzilla),\n Timer = require('./timer.js'),\n boxes = [],\n overlay,\n scrollElement = window,\n exitIntentDelayTimer,\n exitIntentTriggered,\n siteTimer,\n pageTimer,\n pageViews;\n\nfunction throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n\n var now = +new Date(),\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n}\n\n// \"keyup\" listener\nfunction onKeyUp(e) {\n if (e.keyCode == 27) {\n Boxzilla.dismiss();\n }\n}\n\n// check \"pageviews\" criteria for each box\nfunction checkPageViewsCriteria() {\n\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {\n box.trigger();\n }\n });\n}\n\n// check time trigger criteria for each box\nfunction checkTimeCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n // check \"time on site\" trigger\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n\n // check \"time on page\" trigger\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n}\n\n// check triggerHeight criteria for all boxes\nfunction checkHeightCriteria() {\n\n var scrollY = scrollElement.hasOwnProperty('pageYOffset') ? scrollElement.pageYOffset : scrollElement.scrollTop;\n scrollY = scrollY + window.innerHeight * 0.9;\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n // trigger box\n box.trigger();\n } else if (box.mayRehide()) {\n box.hide();\n }\n });\n}\n\n// recalculate heights and variables based on height\nfunction recalculateHeights() {\n boxes.forEach(function (box) {\n box.onResize();\n });\n}\n\nfunction onOverlayClick(e) {\n var x = e.offsetX;\n var y = e.offsetY;\n\n // calculate if click was less than 40px outside box to avoid closing it by accident\n boxes.forEach(function (box) {\n var rect = box.element.getBoundingClientRect();\n var margin = 40;\n\n // if click was not anywhere near box, dismiss it.\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n}\n\nfunction triggerExitIntent() {\n // do nothing if already triggered OR another box is visible.\n if (exitIntentTriggered || isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n\n exitIntentTriggered = true;\n}\n\nfunction onMouseLeave(e) {\n var delay = 400;\n\n // did mouse leave at top of window?\n if (e.clientY <= 0) {\n exitIntentDelayTimer = window.setTimeout(triggerExitIntent, delay);\n }\n}\n\nfunction isAnyBoxVisible() {\n\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n\n if (box.visible) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction onMouseEnter() {\n if (exitIntentDelayTimer) {\n window.clearInterval(exitIntentDelayTimer);\n exitIntentDelayTimer = null;\n }\n}\n\nfunction onElementClick(e) {\n // find <a> element in up to 3 parent elements\n var el = e.target || e.srcElement;\n var depth = 3;\n for (var i = 0; i <= depth; i++) {\n if (!el || el.tagName === 'A') {\n break;\n }\n\n el = el.parentElement;\n }\n\n if (!el || el.tagName !== 'A' || !el.getAttribute('href')) {\n return;\n }\n\n if (el.getAttribute('href').toLowerCase().indexOf('#boxzilla-') === 0) {\n var boxId = el.getAttribute('href').toLowerCase().substring(\"#boxzilla-\".length);\n Boxzilla.toggle(boxId);\n }\n}\n\nvar timers = {\n start: function start() {\n try {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if (sessionTime) siteTimer.time = sessionTime;\n } catch (e) {}\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n};\n\n// initialise & add event listeners\nBoxzilla.init = function () {\n document.body.addEventListener('click', onElementClick, true);\n\n try {\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n } catch (e) {\n pageViews = 0;\n }\n\n siteTimer = new Timer(0);\n pageTimer = new Timer(0);\n\n // insert styles into DOM\n var styles = require('./styles.js');\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement);\n\n // add overlay element to dom\n overlay = document.createElement('div');\n overlay.style.display = 'none';\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay);\n\n // event binds\n scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true);\n scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true);\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n overlay.addEventListener('click', onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.addEventListener('keyup', onKeyUp);\n\n timers.start();\n window.addEventListener('focus', timers.start);\n window.addEventListener('beforeunload', function () {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n window.addEventListener('blur', timers.stop);\n\n Boxzilla.trigger('ready');\n};\n\n/**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\nBoxzilla.create = function (id, opts) {\n\n // preserve backwards compat for minimumScreenWidth option\n if (typeof opts.minimumScreenWidth !== \"undefined\") {\n opts.screenWidthCondition = {\n condition: \"larger\",\n value: opts.minimumScreenWidth\n };\n }\n\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n};\n\nBoxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n if (box.id == id) {\n return box;\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n};\n\n// dismiss a single box (or all by omitting id param)\nBoxzilla.dismiss = function (id) {\n // if no id given, dismiss all current open boxes\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.dismiss();\n });\n } else {\n Boxzilla.get(id).dismiss();\n }\n};\n\nBoxzilla.hide = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.hide();\n });\n } else {\n Boxzilla.get(id).hide();\n }\n};\n\nBoxzilla.show = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.show();\n });\n } else {\n Boxzilla.get(id).show();\n }\n};\n\nBoxzilla.toggle = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.toggle();\n });\n } else {\n Boxzilla.get(id).toggle();\n }\n};\n\n// expose each individual box.\nBoxzilla.boxes = boxes;\n\n// expose boxzilla object\nwindow.Boxzilla = Boxzilla;\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n}\n\n},{\"./box.js\":4,\"./styles.js\":6,\"./timer.js\":7,\"wolfy87-eventemitter\":2}],6:[function(require,module,exports){\n\"use strict\";\n\nvar styles = \"#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\nmodule.exports = styles;\n\n},{}],7:[function(require,module,exports){\n'use strict';\n\nvar Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function () {\n this.time++;\n};\n\nTimer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n};\n\nmodule.exports = Timer;\n\n},{}]},{},[1]);\n; })();"]}
1
+ {"version":3,"sources":["script.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","_typeof","Symbol","iterator","obj","constructor","prototype","css","element","styles","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","Boxzilla","options","window","boxzilla_options","isLoggedIn","document","body","className","indexOf","testMode","console","log","init","addEventListener","inited","key","boxes","boxOpts","boxContentElement","getElementById","id","content","box","create","post","slug","firstChild","lastChild","fits","location","hash","elementId","substring","test","querySelector","locationHashRefersBox","show","trigger","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","maybeOpenMailChimpForWordPressBox","boxzilla","2","EventEmitter","indexOfListener","listeners","listener","alias","name","this","apply","arguments","proto","originalGlobalValue","getListeners","evt","response","events","_getEvents","RegExp","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","listenerIsWrapped","once","on","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","value","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd","3","property","animate","targetStyles","fn","last","Date","initialStyles","getComputedStyle","currentStyles","propSteps","parseFloat","to","current","duration","tick","step","increment","newValue","timeSinceLastTick","done","suffix","requestAnimationFrame","setTimeout","toggle","animation","callbackFn","nowVisible","display","offsetLeft","clone","cloneNode","cleanup","removeAttribute","setAttribute","getAttribute","hiddenStyles","visibleStyles","properties","newObject","initObjectProperties","object","copyObjectProperties","isFinite","height","clientRect","getBoundingClientRect","overflowY","opacity","animated","4","defaults","rehide","cookie","icon","screenWidthCondition","position","closable","Animator","Box","config","obj1","obj2","obj3","attrname","merge","overlay","visible","dismissed","triggered","triggerHeight","calculateTriggerHeight","cookieSet","isCookieSet","contentElement","closeIcon","dom","dismiss","bind","target","tagName","setCookie","wrapper","createElement","appendChild","innerHTML","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","clientHeight","newTopMargin","marginTop","classList","hide","method","triggerElement","top","html","documentElement","Math","max","scrollHeight","offsetHeight","getDocumentHeight","condition","innerWidth","onResize","mayAutoShow","mayRehide","replace","hours","expiryDate","setHours","getHours","toUTCString","preventDefault","_Boxzilla","./animator.js","5","throttle","threshhold","scope","deferTimer","context","now","clearTimeout","onKeyUp","keyCode","checkPageViewsCriteria","isAnyBoxVisible","forEach","pageViews","checkTimeCriteria","siteTimer","time","pageTimer","checkHeightCriteria","scrollY","scrollElement","pageYOffset","scrollTop","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","left","right","bottom","triggerExitIntent","exitIntentTriggered","onMouseLeave","clientY","exitIntentDelayTimer","onMouseEnter","clearInterval","onElementClick","el","srcElement","parentElement","toLowerCase","Object","Timer","timers","sessionTime","sessionStorage","getItem","start","setItem","stop","styleElement","head","setInterval","opts","minimumScreenWidth","get","./box.js","./styles.js","./timer.js","wolfy87-eventemitter","6","7","interval"],"mappings":"CAAA,WAAe,IAAIA,OAAUC,EAAgEC,OAASD,GAAW,WAAY,SAASE,EAAEC,EAAEC,EAAEC,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AIzBnL,EAASsM,KAAO,SAAUlL,QACJ,IAAPA,EACPJ,EAAM2N,QAAQ,SAAUrN,GACpBA,EAAIgL,SAGRtM,EAAS0R,IAAItQ,GAAIkL,QAIzBtM,EAASoC,KAAO,SAAUhB,QACJ,IAAPA,EACPJ,EAAM2N,QAAQ,SAAUrN,GACpBA,EAAIc,SAGRpC,EAAS0R,IAAItQ,GAAIgB,QAIzBpC,EAAS8H,OAAS,SAAU1G,QACN,IAAPA,EACPJ,EAAM2N,QAAQ,SAAUrN,GACpBA,EAAIwG,WAGR9H,EAAS0R,IAAItQ,GAAI0G,UAKzB9H,EAASgB,MAAQA,EAGjBd,OAAOF,SAAWA,OAEI,IAAXvB,GAA0BA,EAAOJ,UACxCI,EAAOJ,QAAU2B,KAGlB2R,WAAW,EAAEC,cAAc,EAAEC,aAAa,EAAEC,uBAAuB,IAAIC,GAAG,SAAS1U,EAAQoB,EAAOJ,GACrG,aAGAI,EAAOJ,QADM,8hCAGP2T,GAAG,SAAS3U,EAAQoB,EAAOJ,GACjC,aAEA,IAAIwS,EAAQ,SAAeK,GACvB7N,KAAK0L,KAAOmC,EACZ7N,KAAK4O,SAAW,GAGpBpB,EAAM9R,UAAUsI,KAAO,WACnBhE,KAAK0L,QAGT8B,EAAM9R,UAAUmS,MAAQ,WACf7N,KAAK4O,WACN5O,KAAK4O,SAAW/R,OAAOqR,YAAYlO,KAAKgE,KAAK+D,KAAK/H,MAAO,OAIjEwN,EAAM9R,UAAUqS,KAAO,WACf/N,KAAK4O,WACL/R,OAAOoQ,cAAcjN,KAAK4O,UAC1B5O,KAAK4O,SAAW,IAIxBxT,EAAOJ,QAAUwS,YAEN,IAx/CX","file":"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\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\n(function () {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n var options = window.boxzilla_options;\n\n // expose Boxzilla object to window\n window.Boxzilla = Boxzilla;\n\n // helper function for setting CSS styles\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n function createBoxesFromConfig() {\n\n // failsafe against including script twice.\n if (options.inited) {\n return;\n }\n\n // create boxes from options\n for (var key in options.boxes) {\n\n // get opts\n var boxOpts = options.boxes[key];\n boxOpts.testMode = isLoggedIn && options.testMode;\n\n // find box content element, bail if not found\n var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');\n if (!boxContentElement) {\n continue;\n }\n\n // use element as content option\n boxOpts.content = boxContentElement;\n\n // create box\n var box = Boxzilla.create(boxOpts.id, boxOpts);\n\n // add box slug to box element as classname\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug;\n\n // add custom css to box\n css(box.element, boxOpts.css);\n\n box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n\n // maybe show box right away\n if (box.fits() && locationHashRefersBox(box)) {\n box.show();\n }\n }\n\n // set flag to prevent initialising twice\n options.inited = true;\n\n // trigger \"done\" event.\n Boxzilla.trigger('done');\n\n // maybe open box with MC4WP form in it\n maybeOpenMailChimpForWordPressBox();\n }\n\n function locationHashRefersBox(box) {\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n }\n\n var elementId = window.location.hash.substring(1);\n\n // only attempt on strings looking like an ID \n var regex = /^[a-zA-Z\\-\\_0-9]+$/;\n if (!regex.test(elementId)) {\n return false;\n }\n\n if (elementId === box.element.id) {\n return true;\n } else if (box.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n }\n\n function maybeOpenMailChimpForWordPressBox() {\n if (_typeof(window.mc4wp_forms_config) !== \"object\" || !window.mc4wp_forms_config.submitted_form) {\n return;\n }\n\n var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;\n var boxes = Boxzilla.boxes;\n for (var boxId in boxes) {\n if (!boxes.hasOwnProperty(boxId)) {\n continue;\n }\n var box = boxes[boxId];\n if (box.element.querySelector(selector)) {\n box.show();\n return;\n }\n }\n }\n\n // print message when test mode is enabled\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n }\n\n // init boxzilla\n Boxzilla.init();\n\n // on window.load, create DOM elements for boxes\n window.addEventListener('load', createBoxesFromConfig);\n})();\n\n},{\"boxzilla\":5}],2:[function(require,module,exports){\n/*!\n * EventEmitter v4.2.11 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function () {\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 exports = this;\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 /**\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 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 second 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 second 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 i = listeners.length;\n\n while (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}.call(this));\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar duration = 320;\n\nfunction css(element, styles) {\n for (var property in styles) {\n element.style[property] = styles[property];\n }\n}\n\nfunction initObjectProperties(properties, value) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n return newObject;\n}\n\nfunction copyObjectProperties(properties, object) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n return newObject;\n}\n\n/**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\nfunction animated(element) {\n return !!element.getAttribute('data-animated');\n}\n\n/**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n */\nfunction toggle(element, animation, callbackFn) {\n var nowVisible = element.style.display != 'none' || element.offsetLeft > 0;\n\n // create clone for reference\n var clone = element.cloneNode(true);\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n if (callbackFn) {\n callbackFn();\n }\n };\n\n // store attribute so everyone knows we're animating this element\n element.setAttribute('data-animated', \"true\");\n\n // toggle element visiblity right away if we're making something visible\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles, visibleStyles;\n\n // animate properties\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles);\n\n // in some browsers, getComputedStyle returns \"auto\" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.\n if (!isFinite(visibleStyles.height)) {\n var clientRect = element.getBoundingClientRect();\n visibleStyles.height = clientRect.height;\n }\n css(element, hiddenStyles);\n }\n\n // don't show a scrollbar during animation\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = { opacity: 0 };\n visibleStyles = { opacity: 1 };\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n}\n\nfunction animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n // make sure we have an object filled with floats\n targetStyles[property] = parseFloat(targetStyles[property]);\n\n // calculate step size & current value\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]);\n\n // is there something to do?\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n\n var step, to, increment, newValue;\n for (var property in targetStyles) {\n step = propSteps[property];\n to = targetStyles[property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n }\n\n // store new value\n currentStyles[property] = newValue;\n\n var suffix = property !== \"opacity\" ? \"px\" : \"\";\n element.style[property] = newValue + suffix;\n }\n\n last = +new Date();\n\n // keep going until we're done for all props\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n}\n\nmodule.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n};\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'screenWidthCondition': null,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n},\n Boxzilla,\n Animator = require('./animator.js');\n\n/**\n* Merge 2 objects, values of the latter overwriting the former.\n*\n* @param obj1\n* @param obj2\n* @returns {*}\n*/\nfunction merge(obj1, obj2) {\n var obj3 = {};\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n return obj3;\n}\n\n/**\n* Get the real height of entire document.\n* @returns {number}\n*/\nfunction getDocumentHeight() {\n var body = document.body,\n html = document.documentElement;\n\n var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n\n return height;\n}\n\n// Box Object\nvar Box = function Box(id, config) {\n this.id = id;\n\n // store config values\n this.config = merge(defaults, config);\n\n // store ref to overlay\n this.overlay = document.getElementById('boxzilla-overlay');\n\n // state\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = this.calculateTriggerHeight();\n this.cookieSet = this.isCookieSet();\n this.element = null;\n this.contentElement = null;\n this.closeIcon = null;\n\n // create dom elements for this box\n this.dom();\n\n // further initialise the box\n this.events();\n};\n\n// initialise the box\nBox.prototype.events = function () {\n var box = this;\n\n // attach event to \"close\" icon inside box\n if (this.closeIcon) {\n this.closeIcon.addEventListener('click', this.dismiss.bind(this));\n }\n\n this.element.addEventListener('click', function (e) {\n if (e.target.tagName === 'A') {\n Boxzilla.trigger('box.interactions.link', [box, e.target]);\n }\n }, false);\n\n this.element.addEventListener('submit', function (e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [box, e.target]);\n }, false);\n};\n\n// generate dom elements for this box\nBox.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n\n var content;\n if (typeof this.config.content === \"string\") {\n content = document.createElement('div');\n content.innerHTML = this.config.content;\n } else {\n content = this.config.content;\n\n // make sure element is visible\n content.style.display = '';\n }\n content.className = 'boxzilla-content';\n box.appendChild(content);\n\n if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = \"boxzilla-close-icon\";\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.contentElement = content;\n this.element = box;\n};\n\n// set (calculate) custom box styling depending on box options\nBox.prototype.setCustomBoxStyling = function () {\n\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = 'auto';\n this.element.style.maxHeight = 'none';\n\n // get new dimensions\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight;\n\n // add scrollbar to box and limit height\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n }\n\n // set new top margin for boxes which are centered\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n};\n\n// toggle visibility of the box\nBox.prototype.toggle = function (show) {\n\n // revert visibility if no explicit argument is given\n if (typeof show === \"undefined\") {\n show = !this.visible;\n }\n\n // is box already at desired visibility?\n if (show === this.visible) {\n return false;\n }\n\n // is box being animated?\n if (Animator.animated(this.element)) {\n return false;\n }\n\n // if box should be hidden but is not closable, bail.\n if (!show && !this.config.closable) {\n return false;\n }\n\n // set new visibility status\n this.visible = show;\n\n // calculate new styling rules\n this.setCustomBoxStyling();\n\n // trigger event\n Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]);\n\n // show or hide box using selected animation\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n Animator.toggle(this.overlay, \"fade\");\n }\n\n Animator.toggle(this.element, this.config.animation, function () {\n if (this.visible) {\n return;\n }\n this.contentElement.innerHTML = this.contentElement.innerHTML;\n }.bind(this));\n\n return true;\n};\n\n// show the box\nBox.prototype.show = function () {\n return this.toggle(true);\n};\n\n// hide the box\nBox.prototype.hide = function () {\n return this.toggle(false);\n};\n\n// calculate trigger height\nBox.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger) {\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n }\n\n return triggerHeight;\n};\n\nBox.prototype.fits = function () {\n if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {\n return true;\n }\n\n switch (this.config.screenWidthCondition.condition) {\n case \"larger\":\n return window.innerWidth > this.config.screenWidthCondition.value;\n case \"smaller\":\n return window.innerWidth < this.config.screenWidthCondition.value;\n }\n\n // meh.. condition should be \"smaller\" or \"larger\", just return true.\n return true;\n};\n\nBox.prototype.onResize = function () {\n this.triggerHeight = this.calculateTriggerHeight();\n this.setCustomBoxStyling();\n};\n\n// is this box enabled?\nBox.prototype.mayAutoShow = function () {\n\n if (this.dismissed) {\n return false;\n }\n\n // check if box fits on given minimum screen width\n if (!this.fits()) {\n return false;\n }\n\n // if trigger empty or error in calculating triggerHeight, return false\n if (!this.config.trigger) {\n return false;\n }\n\n // rely on cookie value (show if not set, don't show if set)\n return !this.cookieSet;\n};\n\nBox.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function () {\n // always show on test mode or when no auto-trigger is configured\n if (this.config.testMode || !this.config.trigger) {\n return false;\n }\n\n // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n};\n\n// set cookie that disables automatically showing the box\nBox.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n};\n\nBox.prototype.trigger = function () {\n var shown = this.show();\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n};\n\n/**\n* Dismisses the box and optionally sets a cookie.\n*\n* @param e The event that triggered this dismissal.\n* @returns {boolean}\n*/\nBox.prototype.dismiss = function (e) {\n // prevent default action\n e && e.preventDefault();\n\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n }\n\n // hide box element\n this.hide();\n\n // set cookie\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n Boxzilla.trigger('box.dismiss', [this]);\n return true;\n};\n\nmodule.exports = function (_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n};\n\n},{\"./animator.js\":3}],5:[function(require,module,exports){\n'use strict';\n\nvar EventEmitter = require('wolfy87-eventemitter'),\n Boxzilla = Object.create(EventEmitter.prototype),\n Box = require('./box.js')(Boxzilla),\n Timer = require('./timer.js'),\n boxes = [],\n overlay,\n scrollElement = window,\n exitIntentDelayTimer,\n exitIntentTriggered,\n siteTimer,\n pageTimer,\n pageViews;\n\nfunction throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n\n var now = +new Date(),\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n}\n\n// \"keyup\" listener\nfunction onKeyUp(e) {\n if (e.keyCode == 27) {\n Boxzilla.dismiss();\n }\n}\n\n// check \"pageviews\" criteria for each box\nfunction checkPageViewsCriteria() {\n\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {\n box.trigger();\n }\n });\n}\n\n// check time trigger criteria for each box\nfunction checkTimeCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n // check \"time on site\" trigger\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n\n // check \"time on page\" trigger\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n}\n\n// check triggerHeight criteria for all boxes\nfunction checkHeightCriteria() {\n\n var scrollY = scrollElement.hasOwnProperty('pageYOffset') ? scrollElement.pageYOffset : scrollElement.scrollTop;\n scrollY = scrollY + window.innerHeight * 0.9;\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n // trigger box\n box.trigger();\n } else if (box.mayRehide()) {\n box.hide();\n }\n });\n}\n\n// recalculate heights and variables based on height\nfunction recalculateHeights() {\n boxes.forEach(function (box) {\n box.onResize();\n });\n}\n\nfunction onOverlayClick(e) {\n var x = e.offsetX;\n var y = e.offsetY;\n\n // calculate if click was less than 40px outside box to avoid closing it by accident\n boxes.forEach(function (box) {\n var rect = box.element.getBoundingClientRect();\n var margin = 40;\n\n // if click was not anywhere near box, dismiss it.\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n}\n\nfunction triggerExitIntent() {\n // do nothing if already triggered OR another box is visible.\n if (exitIntentTriggered || isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n\n exitIntentTriggered = true;\n}\n\nfunction onMouseLeave(e) {\n var delay = 400;\n\n // did mouse leave at top of window?\n if (e.clientY <= 0) {\n exitIntentDelayTimer = window.setTimeout(triggerExitIntent, delay);\n }\n}\n\nfunction isAnyBoxVisible() {\n\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n\n if (box.visible) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction onMouseEnter() {\n if (exitIntentDelayTimer) {\n window.clearInterval(exitIntentDelayTimer);\n exitIntentDelayTimer = null;\n }\n}\n\nfunction onElementClick(e) {\n // find <a> element in up to 3 parent elements\n var el = e.target || e.srcElement;\n var depth = 3;\n for (var i = 0; i <= depth; i++) {\n if (!el || el.tagName === 'A') {\n break;\n }\n\n el = el.parentElement;\n }\n\n if (!el || el.tagName !== 'A' || !el.getAttribute('href')) {\n return;\n }\n\n if (el.getAttribute('href').toLowerCase().indexOf('#boxzilla-') === 0) {\n var boxId = el.getAttribute('href').toLowerCase().substring(\"#boxzilla-\".length);\n Boxzilla.toggle(boxId);\n }\n}\n\nvar timers = {\n start: function start() {\n try {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if (sessionTime) siteTimer.time = sessionTime;\n } catch (e) {}\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n};\n\n// initialise & add event listeners\nBoxzilla.init = function () {\n document.body.addEventListener('click', onElementClick, true);\n\n try {\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n } catch (e) {\n pageViews = 0;\n }\n\n siteTimer = new Timer(0);\n pageTimer = new Timer(0);\n\n // insert styles into DOM\n var styles = require('./styles.js');\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement);\n\n // add overlay element to dom\n overlay = document.createElement('div');\n overlay.style.display = 'none';\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay);\n\n // event binds\n scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true);\n scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true);\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n overlay.addEventListener('click', onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.addEventListener('keyup', onKeyUp);\n\n timers.start();\n window.addEventListener('focus', timers.start);\n window.addEventListener('beforeunload', function () {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n window.addEventListener('blur', timers.stop);\n\n Boxzilla.trigger('ready');\n};\n\n/**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\nBoxzilla.create = function (id, opts) {\n\n // preserve backwards compat for minimumScreenWidth option\n if (typeof opts.minimumScreenWidth !== \"undefined\") {\n opts.screenWidthCondition = {\n condition: \"larger\",\n value: opts.minimumScreenWidth\n };\n }\n\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n};\n\nBoxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n if (box.id == id) {\n return box;\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n};\n\n// dismiss a single box (or all by omitting id param)\nBoxzilla.dismiss = function (id) {\n // if no id given, dismiss all current open boxes\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.dismiss();\n });\n } else {\n Boxzilla.get(id).dismiss();\n }\n};\n\nBoxzilla.hide = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.hide();\n });\n } else {\n Boxzilla.get(id).hide();\n }\n};\n\nBoxzilla.show = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.show();\n });\n } else {\n Boxzilla.get(id).show();\n }\n};\n\nBoxzilla.toggle = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.toggle();\n });\n } else {\n Boxzilla.get(id).toggle();\n }\n};\n\n// expose each individual box.\nBoxzilla.boxes = boxes;\n\n// expose boxzilla object\nwindow.Boxzilla = Boxzilla;\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n}\n\n},{\"./box.js\":4,\"./styles.js\":6,\"./timer.js\":7,\"wolfy87-eventemitter\":2}],6:[function(require,module,exports){\n\"use strict\";\n\nvar styles = \"#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\nmodule.exports = styles;\n\n},{}],7:[function(require,module,exports){\n'use strict';\n\nvar Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function () {\n this.time++;\n};\n\nTimer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n};\n\nmodule.exports = Timer;\n\n},{}]},{},[1]);\n; })();"]}
boxzilla.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
- Version: 3.2.4
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
@@ -41,7 +41,7 @@ if ( ! defined( 'ABSPATH' ) ) {
41
  function _load_boxzilla() {
42
 
43
  define( 'BOXZILLA_FILE', __FILE__ );
44
- define( 'BOXZILLA_VERSION', '3.2.4' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
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
41
  function _load_boxzilla() {
42
 
43
  define( 'BOXZILLA_FILE', __FILE__ );
44
+ define( 'BOXZILLA_VERSION', '3.2.5' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
languages/boxzilla-cs_CZ.mo CHANGED
Binary file
languages/boxzilla-es_ES.mo CHANGED
Binary file
languages/boxzilla-fr_FR.mo CHANGED
Binary file
languages/boxzilla-nl_NL.mo CHANGED
Binary file
languages/boxzilla-ro_RO.mo CHANGED
Binary file
languages/boxzilla.pot CHANGED
@@ -149,11 +149,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:197
153
  msgid "Enable test mode?"
154
  msgstr ""
155
 
156
- #: src/admin/views/settings.php:24, src/admin/views/metaboxes/box-option-controls.php:201
157
  msgid "If test mode is enabled, all boxes will show up regardless of whether a cookie has been set."
158
  msgstr ""
159
 
@@ -289,143 +289,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:217
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:226
297
  msgid "is"
298
  msgstr ""
299
 
300
- #: src/admin/views/metaboxes/box-option-controls.php:67, src/admin/views/metaboxes/box-option-controls.php:227
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:228
305
  msgid "contains"
306
  msgstr ""
307
 
308
- #: src/admin/views/metaboxes/box-option-controls.php:71, src/admin/views/metaboxes/box-option-controls.php:231
 
 
 
 
309
  msgid "Leave empty for any or enter (comma-separated) names or ID's"
310
  msgstr ""
311
 
312
- #: src/admin/views/metaboxes/box-option-controls.php:79
313
  msgid "Add rule"
314
  msgstr ""
315
 
316
- #: src/admin/views/metaboxes/box-option-controls.php:82
317
  msgid "Box Position"
318
  msgstr ""
319
 
320
- #: src/admin/views/metaboxes/box-option-controls.php:88
321
  msgid "Top Left"
322
  msgstr ""
323
 
324
- #: src/admin/views/metaboxes/box-option-controls.php:95
325
  msgid "Top Right"
326
  msgstr ""
327
 
328
- #: src/admin/views/metaboxes/box-option-controls.php:104
329
  msgid "Center"
330
  msgstr ""
331
 
332
- #: src/admin/views/metaboxes/box-option-controls.php:113
333
  msgid "Bottom Left"
334
  msgstr ""
335
 
336
- #: src/admin/views/metaboxes/box-option-controls.php:120
337
  msgid "Bottom Right"
338
  msgstr ""
339
 
340
- #: src/admin/views/metaboxes/box-option-controls.php:129
341
  msgid "Animation"
342
  msgstr ""
343
 
344
- #: src/admin/views/metaboxes/box-option-controls.php:131
345
  msgid "Fade In"
346
  msgstr ""
347
 
348
- #: src/admin/views/metaboxes/box-option-controls.php:132
349
  msgid "Slide In"
350
  msgstr ""
351
 
352
- #: src/admin/views/metaboxes/box-option-controls.php:133
353
  msgid "Which animation type should be used to show the box when triggered?"
354
  msgstr ""
355
 
356
- #: src/admin/views/metaboxes/box-option-controls.php:137
357
  msgid "Auto-show box?"
358
  msgstr ""
359
 
360
- #: src/admin/views/metaboxes/box-option-controls.php:139
361
  msgid "Never"
362
  msgstr ""
363
 
364
- #: src/admin/views/metaboxes/box-option-controls.php:140
365
  msgid "Yes, after %s seconds on the page."
366
  msgstr ""
367
 
368
- #: src/admin/views/metaboxes/box-option-controls.php:141
369
  msgid "Yes, when at %s of page height"
370
  msgstr ""
371
 
372
- #: src/admin/views/metaboxes/box-option-controls.php:142
373
  msgid "Yes, when at element %s"
374
  msgstr ""
375
 
376
- #: src/admin/views/metaboxes/box-option-controls.php:142
377
  msgid "Example: #comments"
378
  msgstr ""
379
 
380
- #: src/admin/views/metaboxes/box-option-controls.php:148
381
  msgid "Cookie expiration"
382
  msgstr ""
383
 
384
- #: src/admin/views/metaboxes/box-option-controls.php:153, src/admin/views/metaboxes/box-option-controls.php:158
385
  msgid "hours"
386
  msgstr ""
387
 
388
- #: src/admin/views/metaboxes/box-option-controls.php:162
389
  msgid "After this box is triggered or dismissed, how many hours should it stay hidden?"
390
  msgstr ""
391
 
392
- #: src/admin/views/metaboxes/box-option-controls.php:166
393
  msgid "Screen width"
394
  msgstr ""
395
 
396
- #: src/admin/views/metaboxes/box-option-controls.php:171
397
  msgid "larger"
398
  msgstr ""
399
 
400
- #: src/admin/views/metaboxes/box-option-controls.php:171
401
  msgid "smaller"
402
  msgstr ""
403
 
404
- #: src/admin/views/metaboxes/box-option-controls.php:172
405
  msgid "Only show on screens %s than %s."
406
  msgstr ""
407
 
408
- #: src/admin/views/metaboxes/box-option-controls.php:173
409
  msgid "Leave empty if you want to show the box on all screen sizes."
410
  msgstr ""
411
 
412
- #: src/admin/views/metaboxes/box-option-controls.php:178
413
  msgid "Auto-hide?"
414
  msgstr ""
415
 
416
- #: src/admin/views/metaboxes/box-option-controls.php:182
417
  msgid "Hide box again when visitors scroll back up?"
418
  msgstr ""
419
 
420
- #: src/admin/views/metaboxes/box-option-controls.php:186
421
  msgid "Show close icon?"
422
  msgstr ""
423
 
424
- #: src/admin/views/metaboxes/box-option-controls.php:191
425
  msgid "If you decide to hide the close icon, make sure to offer an alternative way to close the box."
426
  msgstr ""
427
 
428
- #: src/admin/views/metaboxes/box-option-controls.php:192
429
  msgid "Example: "
430
  msgstr ""
431
 
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
  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
 
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.4
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,19 @@ Have a look at the [frequently asked questions](https://wordpress.org/plugins/bo
150
  == Changelog ==
151
 
152
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  #### 3.2.4 - May 31, 2018
154
 
155
  **Fixes**
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
  == Changelog ==
151
 
152
 
153
+
154
+ #### 3.2.5 - June 6, 2018
155
+
156
+ **Fixes**
157
+
158
+ - Some JSON encoders would print Boxzilla config as object, resulting in no boxes actually being loaded.
159
+
160
+ **Additions**
161
+
162
+ - Add "does not contain" qualifier in URL and referrer conditions.
163
+
164
+
165
+
166
  #### 3.2.4 - May 31, 2018
167
 
168
  **Fixes**
src/admin/views/metaboxes/box-option-controls.php CHANGED
@@ -16,7 +16,7 @@ $rule_options = array(
16
  'is_post_type' => __( 'if post type', 'boxzilla' ),
17
  'is_url' => __( 'if URL', 'boxzilla' ),
18
  'is_referer' => __( 'if referer', 'boxzilla' ),
19
- 'is_user_logged_in' => __( 'if user', 'boxzilla' ),
20
  );
21
 
22
  /**
@@ -65,7 +65,8 @@ $rule_options = apply_filters( 'boxzilla_rules_options', $rule_options );
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' ); ?></option>
 
69
  </select>
70
 
71
  <input class="boxzilla-rule-value regular-text" name="boxzilla_box[rules][<?php echo $key; ?>][value]" type="text" value="<?php echo esc_attr( $rule['value'] ); ?>" placeholder="<?php _e( 'Leave empty for any or enter (comma-separated) names or ID\'s', 'boxzilla' ); ?>" style="<?php if( in_array( $rule['condition'], array( '', 'everywhere' ) ) ) { echo 'display: none;'; } ?>" />
@@ -226,6 +227,7 @@ $rule_options = apply_filters( 'boxzilla_rules_options', $rule_options );
226
  <option value="1" selected><?php _e( 'is', 'boxzilla' ); ?></option>
227
  <option value="0"><?php _e( 'is not', 'boxzilla' ); ?></option>
228
  <option value="contains" style="display: none;"><?php _e( 'contains', 'boxzilla' ); ?></option>
 
229
  </select>
230
 
231
  <input class="boxzilla-rule-value regular-text" name="boxzilla_box[rules][{{{data.key}}}][value]" type="text" value="" placeholder="<?php _e( 'Leave empty for any or enter (comma-separated) names or ID\'s', 'boxzilla' ); ?>" style="display: none;" />
16
  'is_post_type' => __( 'if post type', 'boxzilla' ),
17
  'is_url' => __( 'if URL', 'boxzilla' ),
18
  'is_referer' => __( 'if referer', 'boxzilla' ),
19
+ 'is_user_logged_in' => __( 'if user', 'boxzilla' ),
20
  );
21
 
22
  /**
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' ); ?>
69
+ <option value="not_contains" <?php selected( isset( $rule['qualifier'] ) && $rule['qualifier'] === 'not_contains' ); ?> style="display: none;"><?php _e( 'does not contain', 'boxzilla' ); ?></option>
70
  </select>
71
 
72
  <input class="boxzilla-rule-value regular-text" name="boxzilla_box[rules][<?php echo $key; ?>][value]" type="text" value="<?php echo esc_attr( $rule['value'] ); ?>" placeholder="<?php _e( 'Leave empty for any or enter (comma-separated) names or ID\'s', 'boxzilla' ); ?>" style="<?php if( in_array( $rule['condition'], array( '', 'everywhere' ) ) ) { echo '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>
230
+ <option value="not_contains" style="display: none;"><?php _e( 'does not contain', 'boxzilla' ); ?></option>
231
  </select>
232
 
233
  <input class="boxzilla-rule-value regular-text" name="boxzilla_box[rules][{{{data.key}}}][value]" type="text" value="" placeholder="<?php _e( 'Leave empty for any or enter (comma-separated) names or ID\'s', 'boxzilla' ); ?>" style="display: none;" />
src/class-loader.php CHANGED
@@ -75,7 +75,7 @@ class BoxLoader {
75
  $pattern = rtrim( $pattern, '/' );
76
  $pattern = strtolower( $pattern );
77
 
78
- // contains means we should do a simple occurence check
79
  // does not support wildcards
80
  if( $contains ) {
81
  return strpos( $string, $pattern ) !== false;
@@ -127,13 +127,13 @@ class BoxLoader {
127
 
128
  case 'is_url':
129
  $url = $this->get_request_url();
130
- $matched = $this->match_patterns( $url, $value, $qualifier === 'contains' );
131
  break;
132
 
133
  case 'is_referer':
134
  if( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
135
  $referer = $_SERVER['HTTP_REFERER'];
136
- $matched = $this->match_patterns( $referer, $value, $qualifier === 'contains' );
137
  }
138
  break;
139
 
@@ -178,7 +178,7 @@ class BoxLoader {
178
  $matched = apply_filters( 'boxzilla_box_rule_matches_' . $condition, $matched, $value );
179
 
180
  // if qualifier is set to false, we need to reverse this value here.
181
- if( ! $qualifier ) {
182
  $matched = ! $matched;
183
  }
184
 
@@ -265,7 +265,7 @@ class BoxLoader {
265
 
266
  $data = array(
267
  'testMode' => (bool) $plugin_options['test_mode'],
268
- 'boxes' => array_map( function(Box $box) { return $box->get_client_options(); }, $boxes ),
269
  );
270
 
271
  wp_localize_script( 'boxzilla', 'boxzilla_options', $data );
75
  $pattern = rtrim( $pattern, '/' );
76
  $pattern = strtolower( $pattern );
77
 
78
+ // contains means we should do a simple occurrence check
79
  // does not support wildcards
80
  if( $contains ) {
81
  return strpos( $string, $pattern ) !== false;
127
 
128
  case 'is_url':
129
  $url = $this->get_request_url();
130
+ $matched = $this->match_patterns( $url, $value, $qualifier === 'contains' || $qualifier === 'not_contains' );
131
  break;
132
 
133
  case 'is_referer':
134
  if( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
135
  $referer = $_SERVER['HTTP_REFERER'];
136
+ $matched = $this->match_patterns( $referer, $value, $qualifier === 'contains' || $qualifier === 'not_contains' );
137
  }
138
  break;
139
 
178
  $matched = apply_filters( 'boxzilla_box_rule_matches_' . $condition, $matched, $value );
179
 
180
  // if qualifier is set to false, we need to reverse this value here.
181
+ if( ! $qualifier || $qualifier === 'not_contains' ) {
182
  $matched = ! $matched;
183
  }
184
 
265
 
266
  $data = array(
267
  'testMode' => (bool) $plugin_options['test_mode'],
268
+ 'boxes' => (array) array_map( function(Box $box) { return $box->get_client_options(); }, $boxes ),
269
  );
270
 
271
  wp_localize_script( 'boxzilla', 'boxzilla_options', $data );
vendor/autoload.php CHANGED
@@ -2,6 +2,6 @@
2
 
3
  // autoload.php @generated by Composer
4
 
5
- require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
  return ComposerAutoloaderInit38e5bd5c00bdfd9a6ae58e314c6ae5ae::getLoader();
2
 
3
  // autoload.php @generated by Composer
4
 
5
+ require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
  return ComposerAutoloaderInit38e5bd5c00bdfd9a6ae58e314c6ae5ae::getLoader();
vendor/composer/ClassLoader.php CHANGED
@@ -53,8 +53,9 @@ class ClassLoader
53
 
54
  private $useIncludePath = false;
55
  private $classMap = array();
56
-
57
  private $classMapAuthoritative = false;
 
 
58
 
59
  public function getPrefixes()
60
  {
@@ -271,6 +272,26 @@ class ClassLoader
271
  return $this->classMapAuthoritative;
272
  }
273
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
274
  /**
275
  * Registers this instance as an autoloader.
276
  *
@@ -313,29 +334,34 @@ class ClassLoader
313
  */
314
  public function findFile($class)
315
  {
316
- // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
- if ('\\' == $class[0]) {
318
- $class = substr($class, 1);
319
- }
320
-
321
  // class map lookup
322
  if (isset($this->classMap[$class])) {
323
  return $this->classMap[$class];
324
  }
325
- if ($this->classMapAuthoritative) {
326
  return false;
327
  }
 
 
 
 
 
 
328
 
329
  $file = $this->findFileWithExtension($class, '.php');
330
 
331
  // Search for Hack files if we are running on HHVM
332
- if ($file === null && defined('HHVM_VERSION')) {
333
  $file = $this->findFileWithExtension($class, '.hh');
334
  }
335
 
336
- if ($file === null) {
 
 
 
 
337
  // Remember that this class does not exist.
338
- return $this->classMap[$class] = false;
339
  }
340
 
341
  return $file;
@@ -348,9 +374,13 @@ class ClassLoader
348
 
349
  $first = $class[0];
350
  if (isset($this->prefixLengthsPsr4[$first])) {
351
- foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
- if (0 === strpos($class, $prefix)) {
353
- foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
 
 
 
 
354
  if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
  return $file;
356
  }
@@ -399,6 +429,8 @@ class ClassLoader
399
  if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
  return $file;
401
  }
 
 
402
  }
403
  }
404
 
53
 
54
  private $useIncludePath = false;
55
  private $classMap = array();
 
56
  private $classMapAuthoritative = false;
57
+ private $missingClasses = array();
58
+ private $apcuPrefix;
59
 
60
  public function getPrefixes()
61
  {
272
  return $this->classMapAuthoritative;
273
  }
274
 
275
+ /**
276
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
+ *
278
+ * @param string|null $apcuPrefix
279
+ */
280
+ public function setApcuPrefix($apcuPrefix)
281
+ {
282
+ $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
283
+ }
284
+
285
+ /**
286
+ * The APCu prefix in use, or null if APCu caching is not enabled.
287
+ *
288
+ * @return string|null
289
+ */
290
+ public function getApcuPrefix()
291
+ {
292
+ return $this->apcuPrefix;
293
+ }
294
+
295
  /**
296
  * Registers this instance as an autoloader.
297
  *
334
  */
335
  public function findFile($class)
336
  {
 
 
 
 
 
337
  // class map lookup
338
  if (isset($this->classMap[$class])) {
339
  return $this->classMap[$class];
340
  }
341
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
  return false;
343
  }
344
+ if (null !== $this->apcuPrefix) {
345
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
+ if ($hit) {
347
+ return $file;
348
+ }
349
+ }
350
 
351
  $file = $this->findFileWithExtension($class, '.php');
352
 
353
  // Search for Hack files if we are running on HHVM
354
+ if (false === $file && defined('HHVM_VERSION')) {
355
  $file = $this->findFileWithExtension($class, '.hh');
356
  }
357
 
358
+ if (null !== $this->apcuPrefix) {
359
+ apcu_add($this->apcuPrefix.$class, $file);
360
+ }
361
+
362
+ if (false === $file) {
363
  // Remember that this class does not exist.
364
+ $this->missingClasses[$class] = true;
365
  }
366
 
367
  return $file;
374
 
375
  $first = $class[0];
376
  if (isset($this->prefixLengthsPsr4[$first])) {
377
+ $subPath = $class;
378
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
379
+ $subPath = substr($subPath, 0, $lastPos);
380
+ $search = $subPath.'\\';
381
+ if (isset($this->prefixDirsPsr4[$search])) {
382
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
383
+ $length = $this->prefixLengthsPsr4[$first][$search];
384
  if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
385
  return $file;
386
  }
429
  if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
  return $file;
431
  }
432
+
433
+ return false;
434
  }
435
  }
436
 
vendor/composer/LICENSE CHANGED
@@ -1,5 +1,5 @@
1
 
2
- Copyright (c) 2016 Nils Adermann, Jordi Boggiano
3
 
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
  of this software and associated documentation files (the "Software"), to deal
1
 
2
+ Copyright (c) Nils Adermann, Jordi Boggiano
3
 
4
  Permission is hereby granted, free of charge, to any person obtaining a copy
5
  of this software and associated documentation files (the "Software"), to deal
vendor/composer/autoload_real.php CHANGED
@@ -23,24 +23,35 @@ class ComposerAutoloaderInit38e5bd5c00bdfd9a6ae58e314c6ae5ae
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
  spl_autoload_unregister(array('ComposerAutoloaderInit38e5bd5c00bdfd9a6ae58e314c6ae5ae', 'loadClassLoader'));
25
 
26
- $map = require __DIR__ . '/autoload_namespaces.php';
27
- foreach ($map as $namespace => $path) {
28
- $loader->set($namespace, $path);
29
- }
30
 
31
- $map = require __DIR__ . '/autoload_psr4.php';
32
- foreach ($map as $namespace => $path) {
33
- $loader->setPsr4($namespace, $path);
34
- }
 
 
35
 
36
- $classMap = require __DIR__ . '/autoload_classmap.php';
37
- if ($classMap) {
38
- $loader->addClassMap($classMap);
 
 
 
 
 
 
39
  }
40
 
41
  $loader->register(true);
42
 
43
- $includeFiles = require __DIR__ . '/autoload_files.php';
 
 
 
 
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
  composerRequire38e5bd5c00bdfd9a6ae58e314c6ae5ae($fileIdentifier, $file);
46
  }
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
  spl_autoload_unregister(array('ComposerAutoloaderInit38e5bd5c00bdfd9a6ae58e314c6ae5ae', 'loadClassLoader'));
25
 
26
+ $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
+ if ($useStaticLoader) {
28
+ require_once __DIR__ . '/autoload_static.php';
 
29
 
30
+ call_user_func(\Composer\Autoload\ComposerStaticInit38e5bd5c00bdfd9a6ae58e314c6ae5ae::getInitializer($loader));
31
+ } else {
32
+ $map = require __DIR__ . '/autoload_namespaces.php';
33
+ foreach ($map as $namespace => $path) {
34
+ $loader->set($namespace, $path);
35
+ }
36
 
37
+ $map = require __DIR__ . '/autoload_psr4.php';
38
+ foreach ($map as $namespace => $path) {
39
+ $loader->setPsr4($namespace, $path);
40
+ }
41
+
42
+ $classMap = require __DIR__ . '/autoload_classmap.php';
43
+ if ($classMap) {
44
+ $loader->addClassMap($classMap);
45
+ }
46
  }
47
 
48
  $loader->register(true);
49
 
50
+ if ($useStaticLoader) {
51
+ $includeFiles = Composer\Autoload\ComposerStaticInit38e5bd5c00bdfd9a6ae58e314c6ae5ae::$files;
52
+ } else {
53
+ $includeFiles = require __DIR__ . '/autoload_files.php';
54
+ }
55
  foreach ($includeFiles as $fileIdentifier => $file) {
56
  composerRequire38e5bd5c00bdfd9a6ae58e314c6ae5ae($fileIdentifier, $file);
57
  }