Boxzilla - Version 3.0.3

Version Description

Download this release

Release Info

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

Code changes from version 3.0.2 to 3.0.3

assets/browserify/script.js CHANGED
@@ -18,13 +18,19 @@ for( var i=0; i < options.boxes.length; i++ ) {
18
  var boxOpts = options.boxes[i];
19
  boxOpts.testMode = isLoggedIn && options.testMode;
20
 
 
 
 
 
 
21
  // create box
22
  var box = Boxzilla.create( boxOpts.id, boxOpts);
23
-
24
  // add custom css to box
25
  css(box.element, boxOpts.css);
26
  }
27
 
 
28
  function css(element, styles) {
29
  if( styles.background_color ) {
30
  element.style.background = styles.background_color;
@@ -51,4 +57,24 @@ function css(element, styles) {
51
  }
52
  }
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  window.Boxzilla = Boxzilla;
18
  var boxOpts = options.boxes[i];
19
  boxOpts.testMode = isLoggedIn && options.testMode;
20
 
21
+ // fix http:// links in box content....
22
+ if( window.location.origin.substring(0, 5) === "https" ) {
23
+ boxOpts.content = boxOpts.content.replace(window.location.origin.replace("https", "http"), window.location.origin);
24
+ }
25
+
26
  // create box
27
  var box = Boxzilla.create( boxOpts.id, boxOpts);
28
+
29
  // add custom css to box
30
  css(box.element, boxOpts.css);
31
  }
32
 
33
+ // helper function for setting CSS styles
34
  function css(element, styles) {
35
  if( styles.background_color ) {
36
  element.style.background = styles.background_color;
57
  }
58
  }
59
 
60
+ /**
61
+ * If a MailChimp for WordPress form was submitted, open the box containing that form (if any)
62
+ *
63
+ * TODO: Just set location hash from MailChimp for WP?
64
+ */
65
+ window.addEventListener('load', function() {
66
+ if( typeof(window.mc4wp_forms_config) === "object" && window.mc4wp_forms_config.submitted_form ) {
67
+ var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;
68
+ var boxes = Boxzilla.boxes;
69
+ for( var boxId in boxes ) {
70
+ if(!boxes.hasOwnProperty(boxId)) { continue; }
71
+ var box = boxes[boxId];
72
+ if( box.element.querySelector(selector)) {
73
+ box.show();
74
+ return;
75
+ }
76
+ }
77
+ }
78
+ });
79
+
80
  window.Boxzilla = Boxzilla;
assets/js/admin-script.js CHANGED
@@ -1,4 +1,4 @@
1
- (function () { var require = undefined; var define = undefined; (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})({1:[function(require,module,exports){
2
  window.Boxzilla_Admin = require('./admin/_admin.js');
3
  },{"./admin/_admin.js":2}],2:[function(require,module,exports){
4
  'use strict';
@@ -767,4 +767,4 @@ module.exports = Option;
767
  }.call(this));
768
 
769
  },{}]},{},[1]);
770
- })();
1
+ (function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (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})({1:[function(require,module,exports){
2
  window.Boxzilla_Admin = require('./admin/_admin.js');
3
  },{"./admin/_admin.js":2}],2:[function(require,module,exports){
4
  'use strict';
767
  }.call(this));
768
 
769
  },{}]},{},[1]);
770
+ ; })();
assets/js/admin-script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var e=void 0,t=void 0;!function n(t,r,o){function i(s,a){if(!r[s]){if(!t[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:{}};t[s][0].call(p.exports,function(e){var n=t[s][1][e];return i(n?n:e)},p,p.exports,n,t,r,o)}return r[s].exports}for(var l="function"==typeof e&&e,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(e,t,n){window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(e,t,n){"use strict";function r(){c.find(".boxzilla-trigger-options").toggle(""!==this.value)}function o(){s(this).parents("tr").remove()}function i(){var e="tr"===this.tagName.toLowerCase()?this:s(this).parents("tr").get(0),t=e.querySelector(".boxzilla-rule-condition").value,n=e.querySelector(".boxzilla-rule-value"),r=e.querySelector(".boxzilla-rule-qualifier"),o=n.cloneNode(!0),i=s(o);switch(s(e.querySelectorAll(".boxzilla-helper")).remove(),o.removeAttribute("name"),o.className=o.className+" boxzilla-helper",n.parentNode.insertBefore(o,n.nextSibling),i.change(function(){n.value=this.value}),o.style.display="",n.style.display="none",r.style.display="",t){default:o.placeholder=g.enterCommaSeparatedValues;break;case"":case"everywhere":r.value="1",n.value="",o.style.display="none",r.style.display="none";break;case"is_single":case"is_post":o.placeholder=g.enterCommaSeparatedPosts,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":o.placeholder=g.enterCommaSeparatedPages,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":o.placeholder=g.enterCommaSeparatedPostTypes,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":o.placeholder=g.enterCommaSeparatedRelativeUrls;break;case"is_post_in_category":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=category",{multiple:!0,multipleSep:","});break;case"is_post_with_tag":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_tag",{multiple:!0,multipleSep:","})}}function l(){var e={key:u.querySelectorAll(".boxzilla-rule-row").length},t=h(e);return s(document.getElementById("boxzilla-box-rules")).after(t),!1}var s=window.jQuery,a=e("./_option.js"),u=document.getElementById("boxzilla-box-options-controls"),c=s(u);if(0!==c.length){var p=e("wolfy87-eventemitter"),d=new p,f=e("./_designer.js")(s,a,d),h=wp.template("rule-row-template"),g=boxzilla_i18n;c.on("click",".boxzilla-add-rule",l),c.on("click",".boxzilla-remove-rule",o),c.on("change",".boxzilla-rule-condition",i),c.find(".boxzilla-auto-show-trigger").on("change",r),s(window).load(function(){"undefined"==typeof window.tinyMCE&&(document.getElementById("notice-notinymce").style.display="")}),s(".boxzilla-rule-row").each(i),t.exports={Designer:f,Option:a,events:d}}},{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(e,t,n){var r=function(e,t,n){function r(){"object"==typeof window.tinyMCE&&null!==tinyMCE.get("content")&&(s=e("#content_ifr"),l=s.contents().find("html"),l.css({background:"white"}),a=l.find("#tinymce"),a.addClass("boxzilla boxzilla-"+u),a.css({margin:0,background:"white",display:"inline-block",width:"auto","min-width":"240px",position:"relative"}),a.get(0).style.cssText+=";padding: 25px !important;",p=!0,n.trigger("editor.init"))}function o(){return p?(a.css({"border-color":c.borderColor.getColorValue(),"border-width":c.borderWidth.getPxValue(),"border-style":c.borderStyle.getValue(),"background-color":c.backgroundColor.getColorValue(),width:c.width.getPxValue(),color:c.color.getColorValue()}),n.trigger("editor.styles.apply"),!0):!1}function i(){for(var e in c)"theme"!==e.substring(0,5)&&c[e].clear();o(),n.trigger("editor.styles.reset")}var l,s,a,u=document.getElementById("post_ID").value||0,c={},p=!1,d=e("#boxzilla-box-appearance-controls");return c.borderColor=new t("border-color"),c.borderWidth=new t("border-width"),c.borderStyle=new t("border-style"),c.backgroundColor=new t("background-color"),c.width=new t("width"),c.color=new t("color"),d.find("input.boxzilla-color-field").wpColorPicker({change:o,clear:o}),d.find(":input").not(".boxzilla-color-field").change(o),n.on("editor.init",o),{init:r,resetStyles:i,options:c}};t.exports=r},{}],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(){"use strict";function e(){}function r(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function o(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,l=this,s=l.EventEmitter;i.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},i.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,t){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},i.on=o("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=o("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,t){var n,o,i=this.getListenersAsObject(e);for(o in i)i.hasOwnProperty(o)&&(n=r(i[o],t),-1!==n&&i[o].splice(n,1));return this},i.off=o("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.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},i.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},i.removeAllListeners=o("removeEvent"),i.emitEvent=function(e,t){var n,r,o,i,l,s=this.getListenersAsObject(e);for(i in s)if(s.hasOwnProperty(i))for(n=s[i].slice(0),o=n.length;o--;)r=n[o],r.once===!0&&this.removeListener(e,r.listener),l=r.listener.apply(this,t||[]),l===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},i.trigger=o("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return l.EventEmitter=s,e},"function"==typeof t&&t.amd?t(function(){return e}):"object"==typeof n&&n.exports?n.exports=e:l.EventEmitter=e}).call(this)},{}]},{},[1])}();
2
  //# sourceMappingURL=admin-script.min.js.map
1
+ !function(){var e=void 0,t=void 0;!function n(t,r,o){function i(s,a){if(!r[s]){if(!t[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:{}};t[s][0].call(p.exports,function(e){var n=t[s][1][e];return i(n?n:e)},p,p.exports,n,t,r,o)}return r[s].exports}for(var l="function"==typeof e&&e,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(e,t,n){window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(e,t,n){"use strict";function r(){c.find(".boxzilla-trigger-options").toggle(""!==this.value)}function o(){s(this).parents("tr").remove()}function i(){var e="tr"===this.tagName.toLowerCase()?this:s(this).parents("tr").get(0),t=e.querySelector(".boxzilla-rule-condition").value,n=e.querySelector(".boxzilla-rule-value"),r=e.querySelector(".boxzilla-rule-qualifier"),o=n.cloneNode(!0),i=s(o);switch(s(e.querySelectorAll(".boxzilla-helper")).remove(),o.removeAttribute("name"),o.className=o.className+" boxzilla-helper",n.parentNode.insertBefore(o,n.nextSibling),i.change(function(){n.value=this.value}),o.style.display="",n.style.display="none",r.style.display="",t){default:o.placeholder=g.enterCommaSeparatedValues;break;case"":case"everywhere":r.value="1",n.value="",o.style.display="none",r.style.display="none";break;case"is_single":case"is_post":o.placeholder=g.enterCommaSeparatedPosts,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":o.placeholder=g.enterCommaSeparatedPages,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":o.placeholder=g.enterCommaSeparatedPostTypes,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":o.placeholder=g.enterCommaSeparatedRelativeUrls;break;case"is_post_in_category":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=category",{multiple:!0,multipleSep:","});break;case"is_post_with_tag":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_tag",{multiple:!0,multipleSep:","})}}function l(){var e={key:u.querySelectorAll(".boxzilla-rule-row").length},t=h(e);return s(document.getElementById("boxzilla-box-rules")).after(t),!1}var s=window.jQuery,a=e("./_option.js"),u=document.getElementById("boxzilla-box-options-controls"),c=s(u);if(0!==c.length){var p=e("wolfy87-eventemitter"),d=new p,f=e("./_designer.js")(s,a,d),h=wp.template("rule-row-template"),g=boxzilla_i18n;c.on("click",".boxzilla-add-rule",l),c.on("click",".boxzilla-remove-rule",o),c.on("change",".boxzilla-rule-condition",i),c.find(".boxzilla-auto-show-trigger").on("change",r),s(window).load(function(){"undefined"==typeof window.tinyMCE&&(document.getElementById("notice-notinymce").style.display="")}),s(".boxzilla-rule-row").each(i),t.exports={Designer:f,Option:a,events:d}}},{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(e,t,n){var r=function(e,t,n){function r(){"object"==typeof window.tinyMCE&&null!==tinyMCE.get("content")&&(s=e("#content_ifr"),l=s.contents().find("html"),l.css({background:"white"}),a=l.find("#tinymce"),a.addClass("boxzilla boxzilla-"+u),a.css({margin:0,background:"white",display:"inline-block",width:"auto","min-width":"240px",position:"relative"}),a.get(0).style.cssText+=";padding: 25px !important;",p=!0,n.trigger("editor.init"))}function o(){return!!p&&(a.css({"border-color":c.borderColor.getColorValue(),"border-width":c.borderWidth.getPxValue(),"border-style":c.borderStyle.getValue(),"background-color":c.backgroundColor.getColorValue(),width:c.width.getPxValue(),color:c.color.getColorValue()}),n.trigger("editor.styles.apply"),!0)}function i(){for(var e in c)"theme"!==e.substring(0,5)&&c[e].clear();o(),n.trigger("editor.styles.reset")}var l,s,a,u=document.getElementById("post_ID").value||0,c={},p=!1,d=e("#boxzilla-box-appearance-controls");return c.borderColor=new t("border-color"),c.borderWidth=new t("border-width"),c.borderStyle=new t("border-style"),c.backgroundColor=new t("background-color"),c.width=new t("width"),c.color=new t("color"),d.find("input.boxzilla-color-field").wpColorPicker({change:o,clear:o}),d.find(":input").not(".boxzilla-color-field").change(o),n.on("editor.init",o),{init:r,resetStyles:i,options:c}};t.exports=r},{}],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(){"use strict";function e(){}function r(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function o(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,l=this,s=l.EventEmitter;i.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},i.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,t){var n,o=this.getListenersAsObject(e),i="object"==typeof t;for(n in o)o.hasOwnProperty(n)&&r(o[n],t)===-1&&o[n].push(i?t:{listener:t,once:!1});return this},i.on=o("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=o("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,t){var n,o,i=this.getListenersAsObject(e);for(o in i)i.hasOwnProperty(o)&&(n=r(i[o],t),n!==-1&&i[o].splice(n,1));return this},i.off=o("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.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},i.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},i.removeAllListeners=o("removeEvent"),i.emitEvent=function(e,t){var n,r,o,i,l,s=this.getListenersAsObject(e);for(i in s)if(s.hasOwnProperty(i))for(n=s[i].slice(0),o=n.length;o--;)r=n[o],r.once===!0&&this.removeListener(e,r.listener),l=r.listener.apply(this,t||[]),l===this._getOnceReturnValue()&&this.removeListener(e,r.listener);return this},i.trigger=o("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return l.EventEmitter=s,e},"function"==typeof t&&t.amd?t(function(){return e}):"object"==typeof n&&n.exports?n.exports=e:l.EventEmitter=e}).call(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","toggleTriggerOptions","$optionControls","find","toggle","this","value","removeRule","$","parents","remove","setContextualHelpers","context","tagName","toLowerCase","get","condition","querySelector","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","querySelectorAll","removeAttribute","className","parentNode","insertBefore","nextSibling","change","style","display","placeholder","i18n","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","addRuleFields","data","key","optionControls","html","rowTemplate","document","getElementById","after","jQuery","Option","EventEmitter","events","Designer","wp","template","boxzilla_i18n","on","load","each","./_designer.js","./_option.js","wolfy87-eventemitter","3","init","tinyMCE","$editorFrame","$editor","contents","css","background","$innerEditor","addClass","boxId","margin","width","min-width","position","cssText","visualEditorInitialised","trigger","applyStyles","border-color","options","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","color","resetStyles","substring","clear","$appearanceControls","wpColorPicker","not","4","element","console","error","prototype","hasClass","fallbackValue","parseInt","setValue","5","indexOfListener","listeners","listener","alias","name","apply","arguments","proto","originalGlobalValue","getListeners","evt","response","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","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,GAAIA,GAAUC,OAAeC,EAASD,QAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG,IAAIQ,WAAYZ,GAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,EAAEA,EAAEF,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,MAAOD,GAAEG,GAAGQ,QAAkD,IAAI,GAA1CL,GAAkB,kBAATX,IAAqBA,EAAgBQ,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,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fxC,MAAKmJ,OAGhB,OAAOnJ,OAQXoH,EAAMgC,mBAAqBpC,EAAM,eAcjCI,EAAMiC,UAAY,SAAmB9B,EAAK+B,GACtC,GACIxC,GACAC,EACAjI,EACA0D,EACAgF,EALA+B,EAAevJ,KAAKgI,qBAAqBT,EAO7C,KAAK/E,IAAO+G,GACR,GAAIA,EAAa5B,eAAenF,GAI5B,IAHAsE,EAAYyC,EAAa/G,GAAKgH,MAAM,GACpC1K,EAAIgI,EAAUzH,OAEPP,KAGHiI,EAAWD,EAAUhI,GAEjBiI,EAASqB,QAAS,GAClBpI,KAAKyI,eAAelB,EAAKR,EAASA,UAGtCS,EAAWT,EAASA,SAASG,MAAMlH,KAAMsJ,OAErC9B,IAAaxH,KAAKyJ,uBAClBzJ,KAAKyI,eAAelB,EAAKR,EAASA,SAMlD,OAAO/G,OAMXoH,EAAMtC,QAAUkC,EAAM,aAUtBI,EAAMsC,KAAO,SAAcnC,GACvB,GAAI+B,GAAOrB,MAAM1B,UAAUiD,MAAMpK,KAAK+H,UAAW,EACjD,OAAOnH,MAAKqJ,UAAU9B,EAAK+B,IAW/BlC,EAAMuC,mBAAqB,SAA4B1J,GAEnD,MADAD,MAAK4J,iBAAmB3J,EACjBD,MAWXoH,EAAMqC,oBAAsB,WACxB,MAAIzJ,MAAK2H,eAAe,oBACb3H,KAAK4J,kBAGL,GAUfxC,EAAMK,WAAa,WACf,MAAOzH,MAAKmJ,UAAYnJ,KAAKmJ,aAQjClG,EAAa4G,WAAa,WAEtB,MADA1K,GAAQ8D,aAAeoE,EAChBpE,GAIW,kBAAX5E,IAAyBA,EAAOyL,IACvCzL,EAAO,WACH,MAAO4E,KAGY,gBAAX1D,IAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAU8D,EAGjB9D,EAAQ8D,aAAeA,IAE7B7D,KAAKY,gBAEI","file":"admin-script.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (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})({1:[function(require,module,exports){\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\nvar Option = require('./_option.js');\nvar optionControls = document.getElementById('boxzilla-box-options-controls');\nvar $optionControls = $(optionControls);\n\n// sanity check, are we on the correct page?\nif( $optionControls.length === 0 ) {\n\treturn;\n}\n\nvar EventEmitter = require('wolfy87-eventemitter');\nvar events = new EventEmitter();\nvar Designer = require('./_designer.js')($, Option, events);\nvar rowTemplate = wp.template('rule-row-template');\nvar 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\tif( typeof(window.tinyMCE) === \"undefined\" ) {\n\t\tdocument.getElementById('notice-notinymce').style.display = '';\n\t}\n});\n\n// call contextual helper method for each row\n$('.boxzilla-rule-row').each(setContextualHelpers);\n\nfunction toggleTriggerOptions() {\n\t$optionControls.find('.boxzilla-trigger-options').toggle( this.value !== '' );\n}\n\nfunction removeRule() {\n\t$(this).parents('tr').remove();\n}\n\nfunction setContextualHelpers() {\n\n\tvar context = ( this.tagName.toLowerCase() === \"tr\" ) ? this : $(this).parents('tr').get(0);\n\tvar condition = context.querySelector('.boxzilla-rule-condition').value;\n\tvar valueInput = context.querySelector('.boxzilla-rule-value');\n\tvar qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n\tvar betterInput = valueInput.cloneNode(true);\n\tvar $betterInput = $(betterInput);\n\n\t// remove previously added helpers\n\t$(context.querySelectorAll('.boxzilla-helper')).remove();\n\n\t// prepare better input\n\tbetterInput.removeAttribute('name');\n\tbetterInput.className = betterInput.className + ' boxzilla-helper';\n\tvalueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n\t$betterInput.change(function() { valueInput.value = this.value; });\n\n\tbetterInput.style.display = '';\n\tvalueInput.style.display = 'none';\n\tqualifierInput.style.display = '';\n\n\t// change placeholder for textual help\n\tswitch(condition) {\n\t\tdefault:\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedValues;\n\t\t\tbreak;\n\n\t\tcase '':\n\t\tcase 'everywhere':\n\t\t\tqualifierInput.value = '1';\n\t\t\tvalueInput.value = '';\n\t\t\tbetterInput.style.display = 'none';\n\t\t\tqualifierInput.style.display = 'none';\n\t\t\tbreak;\n\n\t\tcase 'is_single':\n\t\tcase 'is_post':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedPosts;\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_page':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedPages;\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_post_type':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_url':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n\t\t\tbreak;\n\n\t\tcase 'is_post_in_category':\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_post_with_tag':\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\t}\n}\n\nfunction addRuleFields() {\n\tvar data = {\n\t\t'key': optionControls.querySelectorAll('.boxzilla-rule-row').length\n\t};\n\tvar html = rowTemplate(data);\n\t$(document.getElementById('boxzilla-box-rules')).after(html);\n\treturn false;\n}\n\nmodule.exports = {\n\t'Designer': Designer,\n\t'Option': Option,\n\t'events': events\n};\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\nvar Designer = function($, Option, events) {\n\n\t// vars\n\tvar boxId = document.getElementById('post_ID').value || 0,\n\t\t$editor, $editorFrame,\n\t\t$innerEditor,\n\t\toptions = {},\n\t\tvisualEditorInitialised = 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\t * Applies the styles from the options to the TinyMCE Editor\n\t *\n\t * @return bool\n\t */\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};\n\nmodule.exports = Designer;\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\n\nvar Option = function( 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},{}],5:[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},{}]},{},[1]);\n })();"],"sourceRoot":"/source/"}
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","toggleTriggerOptions","$optionControls","find","toggle","this","value","removeRule","$","parents","remove","setContextualHelpers","context","tagName","toLowerCase","get","condition","querySelector","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","querySelectorAll","removeAttribute","className","parentNode","insertBefore","nextSibling","change","style","display","placeholder","i18n","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","addRuleFields","data","key","optionControls","html","rowTemplate","document","getElementById","after","jQuery","Option","EventEmitter","events","Designer","wp","template","boxzilla_i18n","on","load","each","./_designer.js","./_option.js","wolfy87-eventemitter","3","init","tinyMCE","$editorFrame","$editor","contents","css","background","$innerEditor","addClass","boxId","margin","width","min-width","position","cssText","visualEditorInitialised","trigger","applyStyles","border-color","options","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","color","resetStyles","substring","clear","$appearanceControls","wpColorPicker","not","4","element","console","error","prototype","hasClass","fallbackValue","parseInt","setValue","5","indexOfListener","listeners","listener","alias","name","apply","arguments","proto","originalGlobalValue","getListeners","evt","response","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","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,GAAIA,GAAUC,OAAgEC,EAASD,QAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG,IAAIQ,WAAYZ,GAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,EAAEA,EAAEF,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,MAAOD,GAAEG,GAAGQ,QAAkD,IAAI,GAA1CL,GAAkB,kBAATX,IAAqBA,EAAgBQ,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,GAAI,OAAOD,KAAKY,GAAG,SAASnB,EAAQoB,EAAOJ,GACxkBK,OAAOC,eAAiBtB,EAAQ,uBAC7BuB,oBAAoB,IAAIC,GAAG,SAASxB,EAAQoB,EAAOJ,GACtD,YAiCA,SAASS,KAC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,GAAIA,EAAa5B,eAAenF,GAI5B,IAHAsE,EAAYyC,EAAa/G,GAAKgH,MAAM,GACpC1K,EAAIgI,EAAUzH,OAEPP,KAGHiI,EAAWD,EAAUhI,GAEjBiI,EAASqB,QAAS,GAClBpI,KAAKyI,eAAelB,EAAKR,EAASA,UAGtCS,EAAWT,EAASA,SAASG,MAAMlH,KAAMsJ,OAErC9B,IAAaxH,KAAKyJ,uBAClBzJ,KAAKyI,eAAelB,EAAKR,EAASA,SAMlD,OAAO/G,OAMXoH,EAAMtC,QAAUkC,EAAM,aAUtBI,EAAMsC,KAAO,SAAcnC,GACvB,GAAI+B,GAAOrB,MAAM1B,UAAUiD,MAAMpK,KAAK+H,UAAW,EACjD,OAAOnH,MAAKqJ,UAAU9B,EAAK+B,IAW/BlC,EAAMuC,mBAAqB,SAA4B1J,GAEnD,MADAD,MAAK4J,iBAAmB3J,EACjBD,MAWXoH,EAAMqC,oBAAsB,WACxB,OAAIzJ,KAAK2H,eAAe,qBACb3H,KAAK4J,kBAapBxC,EAAMK,WAAa,WACf,MAAOzH,MAAKmJ,UAAYnJ,KAAKmJ,aAQjClG,EAAa4G,WAAa,WAEtB,MADA1K,GAAQ8D,aAAeoE,EAChBpE,GAIW,kBAAX5E,IAAyBA,EAAOyL,IACvCzL,EAAO,WACH,MAAO4E,KAGY,gBAAX1D,IAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAU8D,EAGjB9D,EAAQ8D,aAAeA,IAE7B7D,KAAKY,gBAEI","file":"admin-script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (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})({1:[function(require,module,exports){\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\nvar Option = require('./_option.js');\nvar optionControls = document.getElementById('boxzilla-box-options-controls');\nvar $optionControls = $(optionControls);\n\n// sanity check, are we on the correct page?\nif( $optionControls.length === 0 ) {\n\treturn;\n}\n\nvar EventEmitter = require('wolfy87-eventemitter');\nvar events = new EventEmitter();\nvar Designer = require('./_designer.js')($, Option, events);\nvar rowTemplate = wp.template('rule-row-template');\nvar 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\tif( typeof(window.tinyMCE) === \"undefined\" ) {\n\t\tdocument.getElementById('notice-notinymce').style.display = '';\n\t}\n});\n\n// call contextual helper method for each row\n$('.boxzilla-rule-row').each(setContextualHelpers);\n\nfunction toggleTriggerOptions() {\n\t$optionControls.find('.boxzilla-trigger-options').toggle( this.value !== '' );\n}\n\nfunction removeRule() {\n\t$(this).parents('tr').remove();\n}\n\nfunction setContextualHelpers() {\n\n\tvar context = ( this.tagName.toLowerCase() === \"tr\" ) ? this : $(this).parents('tr').get(0);\n\tvar condition = context.querySelector('.boxzilla-rule-condition').value;\n\tvar valueInput = context.querySelector('.boxzilla-rule-value');\n\tvar qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n\tvar betterInput = valueInput.cloneNode(true);\n\tvar $betterInput = $(betterInput);\n\n\t// remove previously added helpers\n\t$(context.querySelectorAll('.boxzilla-helper')).remove();\n\n\t// prepare better input\n\tbetterInput.removeAttribute('name');\n\tbetterInput.className = betterInput.className + ' boxzilla-helper';\n\tvalueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n\t$betterInput.change(function() { valueInput.value = this.value; });\n\n\tbetterInput.style.display = '';\n\tvalueInput.style.display = 'none';\n\tqualifierInput.style.display = '';\n\n\t// change placeholder for textual help\n\tswitch(condition) {\n\t\tdefault:\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedValues;\n\t\t\tbreak;\n\n\t\tcase '':\n\t\tcase 'everywhere':\n\t\t\tqualifierInput.value = '1';\n\t\t\tvalueInput.value = '';\n\t\t\tbetterInput.style.display = 'none';\n\t\t\tqualifierInput.style.display = 'none';\n\t\t\tbreak;\n\n\t\tcase 'is_single':\n\t\tcase 'is_post':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedPosts;\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_page':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedPages;\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_post_type':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_url':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n\t\t\tbreak;\n\n\t\tcase 'is_post_in_category':\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_post_with_tag':\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\t}\n}\n\nfunction addRuleFields() {\n\tvar data = {\n\t\t'key': optionControls.querySelectorAll('.boxzilla-rule-row').length\n\t};\n\tvar html = rowTemplate(data);\n\t$(document.getElementById('boxzilla-box-rules')).after(html);\n\treturn false;\n}\n\nmodule.exports = {\n\t'Designer': Designer,\n\t'Option': Option,\n\t'events': events\n};\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\nvar Designer = function($, Option, events) {\n\n\t// vars\n\tvar boxId = document.getElementById('post_ID').value || 0,\n\t\t$editor, $editorFrame,\n\t\t$innerEditor,\n\t\toptions = {},\n\t\tvisualEditorInitialised = 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\t * Applies the styles from the options to the TinyMCE Editor\n\t *\n\t * @return bool\n\t */\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};\n\nmodule.exports = Designer;\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\n\nvar Option = function( 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},{}],5:[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},{}]},{},[1]);\n; })();"],"sourceRoot":"/source/"}
assets/js/script.js CHANGED
@@ -1,4 +1,4 @@
1
- (function () { var require = undefined; var define = undefined; (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})({1:[function(require,module,exports){
2
  'use strict';
3
 
4
  var Boxzilla = require('boxzilla');
@@ -19,13 +19,19 @@ for( var i=0; i < options.boxes.length; i++ ) {
19
  var boxOpts = options.boxes[i];
20
  boxOpts.testMode = isLoggedIn && options.testMode;
21
 
 
 
 
 
 
22
  // create box
23
  var box = Boxzilla.create( boxOpts.id, boxOpts);
24
-
25
  // add custom css to box
26
  css(box.element, boxOpts.css);
27
  }
28
 
 
29
  function css(element, styles) {
30
  if( styles.background_color ) {
31
  element.style.background = styles.background_color;
@@ -52,6 +58,26 @@ function css(element, styles) {
52
  }
53
  }
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  window.Boxzilla = Boxzilla;
56
  },{"boxzilla":3}],2:[function(require,module,exports){
57
  'use strict';
@@ -68,7 +94,8 @@ var $ = window.jQuery,
68
  'testMode': false,
69
  'trigger': false,
70
  'closable': true
71
- }, Boxzilla;
 
72
 
73
  /**
74
  * Merge 2 objects, values of the latter overwriting the former.
@@ -153,6 +180,7 @@ Box.prototype.dom = function() {
153
  wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';
154
 
155
  var box = document.createElement('div');
 
156
  box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;
157
  box.style.display = 'none';
158
  wrapper.appendChild(box);
@@ -162,7 +190,7 @@ Box.prototype.dom = function() {
162
  content.innerHTML = this.config.content;
163
  box.appendChild(content);
164
 
165
- // remove <script> from box content and append them to head
166
  var scripts = content.querySelectorAll('script');
167
  if(scripts.length) {
168
  var script = document.createElement('script');
@@ -170,9 +198,12 @@ Box.prototype.dom = function() {
170
  script.appendChild(document.createTextNode(scripts[i].text));
171
  scripts[i].parentNode.removeChild(scripts[i]);
172
  }
173
- document.head.appendChild(script);
174
  }
175
 
 
 
 
176
  if( this.config.closable && this.config.icon ) {
177
  var icon = document.createElement('span');
178
  icon.className = "boxzilla-close-icon";
@@ -1136,4 +1167,4 @@ module.exports = Timer;
1136
  }.call(this));
1137
 
1138
  },{}]},{},[1]);
1139
- })();
1
+ (function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (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})({1:[function(require,module,exports){
2
  'use strict';
3
 
4
  var Boxzilla = require('boxzilla');
19
  var boxOpts = options.boxes[i];
20
  boxOpts.testMode = isLoggedIn && options.testMode;
21
 
22
+ // fix http:// links in box content....
23
+ if( window.location.origin.substring(0, 5) === "https" ) {
24
+ boxOpts.content = boxOpts.content.replace(window.location.origin.replace("https", "http"), window.location.origin);
25
+ }
26
+
27
  // create box
28
  var box = Boxzilla.create( boxOpts.id, boxOpts);
29
+
30
  // add custom css to box
31
  css(box.element, boxOpts.css);
32
  }
33
 
34
+ // helper function for setting CSS styles
35
  function css(element, styles) {
36
  if( styles.background_color ) {
37
  element.style.background = styles.background_color;
58
  }
59
  }
60
 
61
+ /**
62
+ * If a MailChimp for WordPress form was submitted, open the box containing that form (if any)
63
+ *
64
+ * TODO: Just set location hash from MailChimp for WP?
65
+ */
66
+ window.addEventListener('load', function() {
67
+ if( typeof(window.mc4wp_forms_config) === "object" && window.mc4wp_forms_config.submitted_form ) {
68
+ var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;
69
+ var boxes = Boxzilla.boxes;
70
+ for( var boxId in boxes ) {
71
+ if(!boxes.hasOwnProperty(boxId)) { continue; }
72
+ var box = boxes[boxId];
73
+ if( box.element.querySelector(selector)) {
74
+ box.show();
75
+ return;
76
+ }
77
+ }
78
+ }
79
+ });
80
+
81
  window.Boxzilla = Boxzilla;
82
  },{"boxzilla":3}],2:[function(require,module,exports){
83
  'use strict';
94
  'testMode': false,
95
  'trigger': false,
96
  'closable': true
97
+ },
98
+ Boxzilla;
99
 
100
  /**
101
  * Merge 2 objects, values of the latter overwriting the former.
180
  wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';
181
 
182
  var box = document.createElement('div');
183
+ box.setAttribute('id', 'boxzilla-' + this.id);
184
  box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;
185
  box.style.display = 'none';
186
  wrapper.appendChild(box);
190
  content.innerHTML = this.config.content;
191
  box.appendChild(content);
192
 
193
+ // remove <script> from box content and append them to the document body
194
  var scripts = content.querySelectorAll('script');
195
  if(scripts.length) {
196
  var script = document.createElement('script');
198
  script.appendChild(document.createTextNode(scripts[i].text));
199
  scripts[i].parentNode.removeChild(scripts[i]);
200
  }
201
+ document.body.appendChild(script);
202
  }
203
 
204
+ // for safety measure, restore jQuery
205
+ window.jQuery = $;
206
+
207
  if( this.config.closable && this.config.icon ) {
208
  var icon = document.createElement('span');
209
  icon.className = "boxzilla-close-icon";
1167
  }.call(this));
1168
 
1169
  },{}]},{},[1]);
1170
+ ; })();
assets/js/script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !function(){var e=void 0,t=void 0;!function i(t,n,o){function r(c,l){if(!n[c]){if(!t[c]){var a="function"==typeof e&&e;if(!l&&a)return a(c,!0);if(s)return s(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var u=n[c]={exports:{}};t[c][0].call(u.exports,function(e){var i=t[c][1][e];return r(i?i:e)},u,u.exports,i,t,n,o)}return n[c].exports}for(var s="function"==typeof e&&e,c=0;c<o.length;c++)r(o[c]);return r}({1:[function(e,t,i){"use strict";function n(e,t){t.background_color&&(e.style.background=t.background_color),t.color&&(e.style.color=t.color),t.border_color&&(e.style.borderColor=t.border_color),t.border_width&&(e.style.borderWidth=parseInt(t.border_width)+"px"),t.border_style&&(e.style.borderStyle=t.border_style),t.width&&(e.style.maxWidth=parseInt(t.width)+"px")}var o=e("boxzilla"),r=window.boxzilla_options,s=document.body.className.indexOf("logged-in")>-1;s&&r.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),o.init();for(var c=0;c<r.boxes.length;c++){var l=r.boxes[c];l.testMode=s&&r.testMode;var a=o.create(l.id,l);n(a.element,l.css)}window.Boxzilla=o},{boxzilla:3}],2:[function(e,t,i){"use strict";function n(e,t){var i={};for(var n in e)i[n]=e[n];for(var n in t)i[n]=t[n];return i}var o,r=window.jQuery,s={animation:"fade",rehide:!1,content:"",cookieTime:0,icon:"&times",minimumScreenWidth:0,position:"center",testMode:!1,trigger:!1,closable:!0},c=function(e,t){this.id=e,this.config=n(s,t),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.closed=!1,this.triggered=!1,this.triggerHeight=0,this.cookieSet=!1,this.config.trigger&&("percentage"!==this.config.trigger.method&&"element"!==this.config.trigger.method||(this.triggerHeight=this.calculateTriggerHeight()),this.cookieSet=this.isCookieSet()),this.element=this.dom(),this.$element=r(this.element),this.events()};c.prototype.events=function(){var e=this;this.$element.find(".boxzilla-close-icon").click(e.dismiss.bind(this)),this.$element.on("click","a",function(t){o.trigger("box.interactions.link",[e,t.target])}),this.$element.on("submit","form",function(t){e.setCookie(),o.trigger("box.interactions.form",[e,t.target])}),r(document.body).on("click",'a[href="#boxzilla-'+e.id+'"]',function(){return e.toggle(),!1}),this.fits()&&this.locationHashRefersBox()&&r(window).load(this.show.bind(this))},c.prototype.dom=function(){var e=document.createElement("div");e.className="boxzilla-container boxzilla-"+this.config.position+"-container";var t=document.createElement("div");t.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,t.style.display="none",e.appendChild(t);var i=document.createElement("div");i.className="boxzilla-content",i.innerHTML=this.config.content,t.appendChild(i);var n=i.querySelectorAll("script");if(n.length){for(var o=document.createElement("script"),r=0;r<n.length;r++)o.appendChild(document.createTextNode(n[r].text)),n[r].parentNode.removeChild(n[r]);document.head.appendChild(o)}if(this.config.closable&&this.config.icon){var s=document.createElement("span");s.className="boxzilla-close-icon",s.innerHTML=this.config.icon,t.appendChild(s)}return document.body.appendChild(e),t},c.prototype.setCustomBoxStyling=function(){this.element.style.overflowY="auto",this.element.style.maxHeight="none";var e=window.innerHeight,t=this.$element.outerHeight();if(t>e&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var i=(e-t)/2;i=i>=0?i:0,this.element.style.marginTop=i+"px"}},c.prototype.toggle=function(e){return"undefined"==typeof e&&(e=!this.visible),this.$element.is(":animated")?!1:e===this.visible?!1:e||this.config.closable?(this.visible=e,this.setCustomBoxStyling(),"center"===this.config.position&&r(this.overlay).fadeToggle("slow"),o.trigger("box."+(e?"show":"hide"),[this]),"fade"===this.config.animation?this.$element.fadeToggle("slow"):this.$element.slideToggle("slow"),!0):!1},c.prototype.show=function(){return this.toggle(!0)},c.prototype.hide=function(){return this.toggle(!1)},c.prototype.calculateTriggerHeight=function(){var e=0;if("element"===this.config.trigger.method){var t=r(this.config.trigger.value).first();e=t.length>0?t.offset().top:0}else"percentage"===this.config.trigger.method&&(e=this.config.trigger.value/100*r(document).height());return e},c.prototype.setCookie=function(){if(this.config.cookieTime){var e=new Date;e.setDate(e.getDate()+this.config.cookieTime),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"}},c.prototype.locationHashRefersBox=function(){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.substring(1);return e===this.element.id?!0:!!this.element.querySelector("#"+e)},c.prototype.fits=function(){return this.config.minimumScreenWidth<=0?!0:window.innerWidth>this.config.minimumScreenWidth},c.prototype.mayAutoShow=function(){return this.closed?!1:this.fits()&&this.config.trigger?!this.cookieSet:!1},c.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},c.prototype.isCookieSet=function(){if(this.config.testMode)return!1;if(!this.config.cookieTime)return!1;var e="true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1");return e},c.prototype.trigger=function(){var e=this.show();e&&(this.triggered=!0)},c.prototype.dismiss=function(){this.hide(),this.setCookie(),this.closed=!0,o.trigger("box.dismiss",[this])},t.exports=function(e){return o=e,c}},{}],3:[function(e,t,i){"use strict";function n(e,t){for(var i in e)e.hasOwnProperty(i)&&t(e[i])}function o(e,t,i){t||(t=250);var n,o;return function(){var r=i||this,s=+new Date,c=arguments;n&&n+t>s?(clearTimeout(o),o=setTimeout(function(){n=s,e.apply(r,c)},t)):(n=s,e.apply(r,c))}}function r(e){27==e.keyCode&&y.dismiss()}function s(){n(x,function(e){e.mayAutoShow()&&"pageviews"===e.config.trigger.method&&z>=e.config.trigger.value&&e.trigger()})}function c(){n(x,function(e){e.mayAutoShow()&&("time_on_site"===e.config.trigger.method&&L.time>=e.config.trigger.value&&e.trigger(),"time_on_page"===e.config.trigger.method&&k.time>=e.config.trigger.value&&e.trigger())})}function l(){var e=window.scrollY,t=e+.667*_;n(x,function(e){!e.mayAutoShow()||e.triggerHeight<=0||(t>e.triggerHeight?e.trigger():e.mayRehide()&&e.hide())})}function a(){_=window.innerHeight,n(x,function(e){e.setCustomBoxStyling()})}function h(e){var t=e.offsetX,i=e.offsetY;n(x,function(e){var n=e.element.getBoundingClientRect(),o=100+.05*window.innerWidth;(t<n.left-o||t>n.right+o||i<n.top-o||i>n.bottom+o)&&e.dismiss()})}function u(){m||(n(x,function(e){e.mayAutoShow()&&"exit_intent"===e.config.trigger.method&&e.trigger()}),m=!0)}function f(e){var t=400;e.clientY<=0&&(g=window.setTimeout(u,t))}function d(){g&&(window.clearInterval(g),g=null)}var g,m,p=window.jQuery,v=e("wolfy87-eventemitter"),y=Object.create(v.prototype),w=e("./Box.js")(y),b=e("./Timer.js"),x={},_=window.innerHeight,E=document.createElement("div"),L=new b(sessionStorage.getItem("boxzilla_timer")||0),k=new b(0),z=sessionStorage.getItem("boxzilla_pageviews")||0,S={start:function(){var e=sessionStorage.getItem("boxzilla_timer");e&&(L.time=e),L.start(),k.start()},stop:function(){sessionStorage.setItem("boxzilla_timer",L.time),L.stop(),k.stop()}};y.init=function(){var e=document.documentElement;E.id="boxzilla-overlay",document.body.appendChild(E),p(window).on("scroll",o(l)),p(window).on("resize",o(a)),p(window).on("load",a),p(e).on("mouseleave",f),p(e).on("mouseenter",d),p(e).on("keyup",r),p(E).click(h),window.setInterval(c,1e3),window.setTimeout(s,1e3),S.start(),p(window).on("focus",S.start),p(window).on("beforeunload",function(){S.stop(),sessionStorage.setItem("boxzilla_pageviews",++z)}),p(window).on("blur",S.stop),y.trigger("ready")},y.create=function(e,t){return x[e]=new w(e,t),x[e]},y.dismiss=function(e){"undefined"==typeof e?n(x,function(e){e.dismiss()}):"object"==typeof x[e]&&x[e].dismiss()},y.hide=function(e){"undefined"==typeof e?n(x,function(e){e.hide()}):"object"==typeof x[e]&&x[e].hide()},y.show=function(e){"undefined"==typeof e?n(x,function(e){e.show()}):"object"==typeof x[e]&&x[e].show()},y.toggle=function(e){"undefined"==typeof e?n(x,function(e){e.toggle()}):"object"==typeof x[e]&&x[e].toggle()},window.Boxzilla=y,"undefined"!=typeof t&&t.exports&&(t.exports=y)},{"./Box.js":2,"./Timer.js":4,"wolfy87-eventemitter":5}],4:[function(e,t,i){"use strict";var n=function(e){this.time=e,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(){window.clearInterval(this.interval),this.interval=0},t.exports=n},{}],5:[function(e,i,n){(function(){"use strict";function e(){}function n(e,t){for(var i=e.length;i--;)if(e[i].listener===t)return i;return-1}function o(e){return function(){return this[e].apply(this,arguments)}}var r=e.prototype,s=this,c=s.EventEmitter;r.getListeners=function(e){var t,i,n=this._getEvents();if(e instanceof RegExp){t={};for(i in n)n.hasOwnProperty(i)&&e.test(i)&&(t[i]=n[i])}else t=n[e]||(n[e]=[]);return t},r.flattenListeners=function(e){var t,i=[];for(t=0;t<e.length;t+=1)i.push(e[t].listener);return i},r.getListenersAsObject=function(e){var t,i=this.getListeners(e);return i instanceof Array&&(t={},t[e]=i),t||i},r.addListener=function(e,t){var i,o=this.getListenersAsObject(e),r="object"==typeof t;for(i in o)o.hasOwnProperty(i)&&-1===n(o[i],t)&&o[i].push(r?t:{listener:t,once:!1});return this},r.on=o("addListener"),r.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},r.once=o("addOnceListener"),r.defineEvent=function(e){return this.getListeners(e),this},r.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},r.removeListener=function(e,t){var i,o,r=this.getListenersAsObject(e);for(o in r)r.hasOwnProperty(o)&&(i=n(r[o],t),-1!==i&&r[o].splice(i,1));return this},r.off=o("removeListener"),r.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},r.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},r.manipulateListeners=function(e,t,i){var n,o,r=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(n=i.length;n--;)r.call(this,t,i[n]);else for(n in t)t.hasOwnProperty(n)&&(o=t[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},r.removeEvent=function(e){var t,i=typeof e,n=this._getEvents();if("string"===i)delete n[e];else if(e instanceof RegExp)for(t in n)n.hasOwnProperty(t)&&e.test(t)&&delete n[t];else delete this._events;return this},r.removeAllListeners=o("removeEvent"),r.emitEvent=function(e,t){var i,n,o,r,s,c=this.getListenersAsObject(e);for(r in c)if(c.hasOwnProperty(r))for(i=c[r].slice(0),o=i.length;o--;)n=i[o],n.once===!0&&this.removeListener(e,n.listener),s=n.listener.apply(this,t||[]),s===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},r.trigger=o("emitEvent"),r.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},r.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},r._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},r._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return s.EventEmitter=c,e},"function"==typeof t&&t.amd?t(function(){return e}):"object"==typeof i&&i.exports?i.exports=e:s.EventEmitter=e}).call(this)},{}]},{},[1])}();
2
  //# sourceMappingURL=script.min.js.map
1
+ !function(){var e=void 0,t=void 0;!function i(t,n,o){function r(c,l){if(!n[c]){if(!t[c]){var a="function"==typeof e&&e;if(!l&&a)return a(c,!0);if(s)return s(c,!0);var f=new Error("Cannot find module '"+c+"'");throw f.code="MODULE_NOT_FOUND",f}var u=n[c]={exports:{}};t[c][0].call(u.exports,function(e){var i=t[c][1][e];return r(i?i:e)},u,u.exports,i,t,n,o)}return n[c].exports}for(var s="function"==typeof e&&e,c=0;c<o.length;c++)r(o[c]);return r}({1:[function(e,t,i){"use strict";function n(e,t){t.background_color&&(e.style.background=t.background_color),t.color&&(e.style.color=t.color),t.border_color&&(e.style.borderColor=t.border_color),t.border_width&&(e.style.borderWidth=parseInt(t.border_width)+"px"),t.border_style&&(e.style.borderStyle=t.border_style),t.width&&(e.style.maxWidth=parseInt(t.width)+"px")}var o=e("boxzilla"),r=window.boxzilla_options,s=document.body.className.indexOf("logged-in")>-1;s&&r.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),o.init();for(var c=0;c<r.boxes.length;c++){var l=r.boxes[c];l.testMode=s&&r.testMode,"https"===window.location.origin.substring(0,5)&&(l.content=l.content.replace(window.location.origin.replace("https","http"),window.location.origin));var a=o.create(l.id,l);n(a.element,l.css)}window.addEventListener("load",function(){if("object"==typeof window.mc4wp_forms_config&&window.mc4wp_forms_config.submitted_form){var e="#"+window.mc4wp_forms_config.submitted_form.element_id,t=o.boxes;for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];if(n.element.querySelector(e))return void n.show()}}}),window.Boxzilla=o},{boxzilla:3}],2:[function(e,t,i){"use strict";function n(e,t){var i={};for(var n in e)i[n]=e[n];for(var n in t)i[n]=t[n];return i}var o,r=window.jQuery,s={animation:"fade",rehide:!1,content:"",cookieTime:0,icon:"&times",minimumScreenWidth:0,position:"center",testMode:!1,trigger:!1,closable:!0},c=function(e,t){this.id=e,this.config=n(s,t),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.closed=!1,this.triggered=!1,this.triggerHeight=0,this.cookieSet=!1,this.config.trigger&&("percentage"!==this.config.trigger.method&&"element"!==this.config.trigger.method||(this.triggerHeight=this.calculateTriggerHeight()),this.cookieSet=this.isCookieSet()),this.element=this.dom(),this.$element=r(this.element),this.events()};c.prototype.events=function(){var e=this;this.$element.find(".boxzilla-close-icon").click(e.dismiss.bind(this)),this.$element.on("click","a",function(t){o.trigger("box.interactions.link",[e,t.target])}),this.$element.on("submit","form",function(t){e.setCookie(),o.trigger("box.interactions.form",[e,t.target])}),r(document.body).on("click",'a[href="#boxzilla-'+e.id+'"]',function(){return e.toggle(),!1}),this.fits()&&this.locationHashRefersBox()&&r(window).load(this.show.bind(this))},c.prototype.dom=function(){var e=document.createElement("div");e.className="boxzilla-container boxzilla-"+this.config.position+"-container";var t=document.createElement("div");t.setAttribute("id","boxzilla-"+this.id),t.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,t.style.display="none",e.appendChild(t);var i=document.createElement("div");i.className="boxzilla-content",i.innerHTML=this.config.content,t.appendChild(i);var n=i.querySelectorAll("script");if(n.length){for(var o=document.createElement("script"),s=0;s<n.length;s++)o.appendChild(document.createTextNode(n[s].text)),n[s].parentNode.removeChild(n[s]);document.body.appendChild(o)}if(window.jQuery=r,this.config.closable&&this.config.icon){var c=document.createElement("span");c.className="boxzilla-close-icon",c.innerHTML=this.config.icon,t.appendChild(c)}return document.body.appendChild(e),t},c.prototype.setCustomBoxStyling=function(){this.element.style.overflowY="auto",this.element.style.maxHeight="none";var e=window.innerHeight,t=this.$element.outerHeight();if(t>e&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var i=(e-t)/2;i=i>=0?i:0,this.element.style.marginTop=i+"px"}},c.prototype.toggle=function(e){return"undefined"==typeof e&&(e=!this.visible),!this.$element.is(":animated")&&(e!==this.visible&&(!(!e&&!this.config.closable)&&(this.visible=e,this.setCustomBoxStyling(),"center"===this.config.position&&r(this.overlay).fadeToggle("slow"),o.trigger("box."+(e?"show":"hide"),[this]),"fade"===this.config.animation?this.$element.fadeToggle("slow"):this.$element.slideToggle("slow"),!0)))},c.prototype.show=function(){return this.toggle(!0)},c.prototype.hide=function(){return this.toggle(!1)},c.prototype.calculateTriggerHeight=function(){var e=0;if("element"===this.config.trigger.method){var t=r(this.config.trigger.value).first();e=t.length>0?t.offset().top:0}else"percentage"===this.config.trigger.method&&(e=this.config.trigger.value/100*r(document).height());return e},c.prototype.setCookie=function(){if(this.config.cookieTime){var e=new Date;e.setDate(e.getDate()+this.config.cookieTime),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"}},c.prototype.locationHashRefersBox=function(){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.substring(1);return e===this.element.id||!!this.element.querySelector("#"+e)},c.prototype.fits=function(){return this.config.minimumScreenWidth<=0||window.innerWidth>this.config.minimumScreenWidth},c.prototype.mayAutoShow=function(){return!this.closed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},c.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},c.prototype.isCookieSet=function(){if(this.config.testMode)return!1;if(!this.config.cookieTime)return!1;var e="true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1");return e},c.prototype.trigger=function(){var e=this.show();e&&(this.triggered=!0)},c.prototype.dismiss=function(){this.hide(),this.setCookie(),this.closed=!0,o.trigger("box.dismiss",[this])},t.exports=function(e){return o=e,c}},{}],3:[function(e,t,i){"use strict";function n(e,t){for(var i in e)e.hasOwnProperty(i)&&t(e[i])}function o(e,t,i){t||(t=250);var n,o;return function(){var r=i||this,s=+new Date,c=arguments;n&&s<n+t?(clearTimeout(o),o=setTimeout(function(){n=s,e.apply(r,c)},t)):(n=s,e.apply(r,c))}}function r(e){27==e.keyCode&&w.dismiss()}function s(){n(x,function(e){e.mayAutoShow()&&"pageviews"===e.config.trigger.method&&z>=e.config.trigger.value&&e.trigger()})}function c(){n(x,function(e){e.mayAutoShow()&&("time_on_site"===e.config.trigger.method&&L.time>=e.config.trigger.value&&e.trigger(),"time_on_page"===e.config.trigger.method&&k.time>=e.config.trigger.value&&e.trigger())})}function l(){var e=window.scrollY,t=e+.667*_;n(x,function(e){!e.mayAutoShow()||e.triggerHeight<=0||(t>e.triggerHeight?e.trigger():e.mayRehide()&&e.hide())})}function a(){_=window.innerHeight,n(x,function(e){e.setCustomBoxStyling()})}function f(e){var t=e.offsetX,i=e.offsetY;n(x,function(e){var n=e.element.getBoundingClientRect(),o=100+.05*window.innerWidth;(t<n.left-o||t>n.right+o||i<n.top-o||i>n.bottom+o)&&e.dismiss()})}function u(){m||(n(x,function(e){e.mayAutoShow()&&"exit_intent"===e.config.trigger.method&&e.trigger()}),m=!0)}function h(e){var t=400;e.clientY<=0&&(g=window.setTimeout(u,t))}function d(){g&&(window.clearInterval(g),g=null)}var g,m,p=window.jQuery,v=e("wolfy87-eventemitter"),w=Object.create(v.prototype),y=e("./Box.js")(w),b=e("./Timer.js"),x={},_=window.innerHeight,E=document.createElement("div"),L=new b(sessionStorage.getItem("boxzilla_timer")||0),k=new b(0),z=sessionStorage.getItem("boxzilla_pageviews")||0,S={start:function(){var e=sessionStorage.getItem("boxzilla_timer");e&&(L.time=e),L.start(),k.start()},stop:function(){sessionStorage.setItem("boxzilla_timer",L.time),L.stop(),k.stop()}};w.init=function(){var e=document.documentElement;E.id="boxzilla-overlay",document.body.appendChild(E),p(window).on("scroll",o(l)),p(window).on("resize",o(a)),p(window).on("load",a),p(e).on("mouseleave",h),p(e).on("mouseenter",d),p(e).on("keyup",r),p(E).click(f),window.setInterval(c,1e3),window.setTimeout(s,1e3),S.start(),p(window).on("focus",S.start),p(window).on("beforeunload",function(){S.stop(),sessionStorage.setItem("boxzilla_pageviews",++z)}),p(window).on("blur",S.stop),w.trigger("ready")},w.create=function(e,t){return x[e]=new y(e,t),x[e]},w.dismiss=function(e){"undefined"==typeof e?n(x,function(e){e.dismiss()}):"object"==typeof x[e]&&x[e].dismiss()},w.hide=function(e){"undefined"==typeof e?n(x,function(e){e.hide()}):"object"==typeof x[e]&&x[e].hide()},w.show=function(e){"undefined"==typeof e?n(x,function(e){e.show()}):"object"==typeof x[e]&&x[e].show()},w.toggle=function(e){"undefined"==typeof e?n(x,function(e){e.toggle()}):"object"==typeof x[e]&&x[e].toggle()},window.Boxzilla=w,"undefined"!=typeof t&&t.exports&&(t.exports=w)},{"./Box.js":2,"./Timer.js":4,"wolfy87-eventemitter":5}],4:[function(e,t,i){"use strict";var n=function(e){this.time=e,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(){window.clearInterval(this.interval),this.interval=0},t.exports=n},{}],5:[function(e,i,n){(function(){"use strict";function e(){}function n(e,t){for(var i=e.length;i--;)if(e[i].listener===t)return i;return-1}function o(e){return function(){return this[e].apply(this,arguments)}}var r=e.prototype,s=this,c=s.EventEmitter;r.getListeners=function(e){var t,i,n=this._getEvents();if(e instanceof RegExp){t={};for(i in n)n.hasOwnProperty(i)&&e.test(i)&&(t[i]=n[i])}else t=n[e]||(n[e]=[]);return t},r.flattenListeners=function(e){var t,i=[];for(t=0;t<e.length;t+=1)i.push(e[t].listener);return i},r.getListenersAsObject=function(e){var t,i=this.getListeners(e);return i instanceof Array&&(t={},t[e]=i),t||i},r.addListener=function(e,t){var i,o=this.getListenersAsObject(e),r="object"==typeof t;for(i in o)o.hasOwnProperty(i)&&n(o[i],t)===-1&&o[i].push(r?t:{listener:t,once:!1});return this},r.on=o("addListener"),r.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},r.once=o("addOnceListener"),r.defineEvent=function(e){return this.getListeners(e),this},r.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},r.removeListener=function(e,t){var i,o,r=this.getListenersAsObject(e);for(o in r)r.hasOwnProperty(o)&&(i=n(r[o],t),i!==-1&&r[o].splice(i,1));return this},r.off=o("removeListener"),r.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},r.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},r.manipulateListeners=function(e,t,i){var n,o,r=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(n=i.length;n--;)r.call(this,t,i[n]);else for(n in t)t.hasOwnProperty(n)&&(o=t[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},r.removeEvent=function(e){var t,i=typeof e,n=this._getEvents();if("string"===i)delete n[e];else if(e instanceof RegExp)for(t in n)n.hasOwnProperty(t)&&e.test(t)&&delete n[t];else delete this._events;return this},r.removeAllListeners=o("removeEvent"),r.emitEvent=function(e,t){var i,n,o,r,s,c=this.getListenersAsObject(e);for(r in c)if(c.hasOwnProperty(r))for(i=c[r].slice(0),o=i.length;o--;)n=i[o],n.once===!0&&this.removeListener(e,n.listener),s=n.listener.apply(this,t||[]),s===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},r.trigger=o("emitEvent"),r.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},r.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},r._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},r._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return s.EventEmitter=c,e},"function"==typeof t&&t.amd?t(function(){return e}):"object"==typeof i&&i.exports?i.exports=e:s.EventEmitter=e}).call(this)},{}]},{},[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","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","boxes","boxOpts","box","create","id","boxzilla","2","merge","obj1","obj2","obj3","attrname","$","jQuery","defaults","animation","rehide","content","cookieTime","icon","minimumScreenWidth","position","trigger","closable","Box","config","this","overlay","getElementById","visible","closed","triggered","triggerHeight","cookieSet","method","calculateTriggerHeight","isCookieSet","dom","$element","events","prototype","find","click","dismiss","bind","on","target","setCookie","toggle","fits","locationHashRefersBox","load","show","wrapper","createElement","display","appendChild","innerHTML","scripts","querySelectorAll","script","createTextNode","text","parentNode","removeChild","head","setCustomBoxStyling","overflowY","maxHeight","windowHeight","innerHeight","boxHeight","outerHeight","newTopMargin","marginTop","is","fadeToggle","slideToggle","hide","$triggerElement","value","first","offset","top","height","expiryDate","Date","setDate","getDate","cookie","toUTCString","location","hash","elementId","substring","querySelector","innerWidth","mayAutoShow","mayRehide","replace","RegExp","shown","_Boxzilla","3","each","obj","callback","key","hasOwnProperty","throttle","fn","threshhold","scope","last","deferTimer","context","now","args","arguments","clearTimeout","setTimeout","apply","onKeyUp","keyCode","checkPageViewsCriteria","pageViews","checkTimeCriteria","siteTimer","time","pageTimer","checkHeightCriteria","scrollY","scrollHeight","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","getBoundingClientRect","margin","left","right","bottom","triggerExitIntent","exitIntentTriggered","onMouseLeave","delay","clientY","exitIntentDelayTimer","onMouseEnter","clearInterval","EventEmitter","Object","Timer","sessionStorage","getItem","timers","start","sessionTime","stop","setItem","html","documentElement","setInterval","opts","./Box.js","./Timer.js","wolfy87-eventemitter","4","interval","tick","5","indexOfListener","listeners","listener","alias","name","proto","originalGlobalValue","getListeners","evt","response","_getEvents","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,GAAIA,GAAUC,OAAeC,EAASD,QAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GA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AAa1G,GAAK2G,MAAM,GACpC7P,EAAIsN,EAAU/M,OAEPP,KAGHuN,EAAWD,EAAUtN,GAEjBuN,EAASiB,QAAS,GAClBvK,KAAK4K,eAAehB,EAAKN,EAASA,UAGtCO,EAAWP,EAASA,SAASvD,MAAM/F,KAAM2F,OAErCkE,IAAa7J,KAAK6L,uBAClB7L,KAAK4K,eAAehB,EAAKN,EAASA,SAMlD,OAAOtJ,OAMXyJ,EAAM7J,QAAU2J,EAAM,aAUtBE,EAAMqC,KAAO,SAAclC,GACvB,GAAIjE,GAAOyE,MAAMtJ,UAAU8K,MAAMvP,KAAKuJ,UAAW,EACjD,OAAO5F,MAAK0L,UAAU9B,EAAKjE,IAW/B8D,EAAMsC,mBAAqB,SAA4BzI,GAEnD,MADAtD,MAAKgM,iBAAmB1I,EACjBtD,MAWXyJ,EAAMoC,oBAAsB,WACxB,MAAI7L,MAAKkF,eAAe,oBACblF,KAAKgM,kBAGL,GAUfvC,EAAMK,WAAa,WACf,MAAO9J,MAAKwL,UAAYxL,KAAKwL,aAQjCzD,EAAakE,WAAa,WAEtB,MADA7P,GAAQ2L,aAAe2B,EAChB3B,GAIW,kBAAXzM,IAAyBA,EAAO4Q,IACvC5Q,EAAO,WACH,MAAOyM,KAGY,gBAAXvL,IAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAU2L,EAGjB3L,EAAQ2L,aAAeA,IAE7B1L,KAAK2D,gBAEI","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var define = undefined; (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})({1:[function(require,module,exports){\n'use strict';\n\nvar Boxzilla = require('boxzilla');\nvar options = window.boxzilla_options;\nvar isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n// print message when test mode is enabled\nif( 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\nBoxzilla.init();\n\n// create boxes from options\nfor( 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 // create box\n var box = Boxzilla.create( boxOpts.id, boxOpts);\n \n // add custom css to box\n css(box.element, boxOpts.css);\n}\n\nfunction 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\nwindow.Boxzilla = Boxzilla;\n},{\"boxzilla\":3}],2:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery,\n defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookieTime': 0,\n 'icon': '&times',\n 'minimumScreenWidth': 0,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n }, Boxzilla;\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) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n}\n\n// Box Object\nvar Box = function( id, config ) {\n this.id \t\t= 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 \t= false;\n this.closed \t= false;\n this.triggered \t= false;\n this.triggerHeight = 0;\n this.cookieSet = false;\n\n // if a trigger was given, calculate values once and store\n if( this.config.trigger ) {\n if( this.config.trigger.method === 'percentage' || this.config.trigger.method === 'element' ) {\n this.triggerHeight = this.calculateTriggerHeight();\n }\n\n this.cookieSet = this.isCookieSet();\n }\n\n // create dom element for this box\n this.element = this.dom();\n this.$element = $(this.element);\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 this.$element.find('.boxzilla-close-icon').click(box.dismiss.bind(this));\n\n this.$element.on('click', 'a', function(e) {\n Boxzilla.trigger('box.interactions.link', [ box, e.target ] );\n });\n\n this.$element.on('submit', 'form', function(e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [ box, e.target ]);\n });\n\n // attach event to all links referring #boxzilla-{box_id}\n $(document.body).on('click', 'a[href=\"#boxzilla-' + box.id + '\"]', function() {\n box.toggle();\n return false;\n });\n\n // maybe show box right away\n if( this.fits() && this.locationHashRefersBox() ) {\n $(window).load(this.show.bind(this));\n }\n\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.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n\n var content = document.createElement('div');\n content.className = 'boxzilla-content';\n content.innerHTML = this.config.content;\n box.appendChild(content);\n\n // remove <script> from box content and append them to head\n var scripts = content.querySelectorAll('script');\n if(scripts.length) {\n var script = document.createElement('script');\n for( var i=0; i<scripts.length; i++ ) {\n script.appendChild(document.createTextNode(scripts[i].text));\n scripts[i].parentNode.removeChild(scripts[i]);\n }\n document.head.appendChild(script);\n }\n\n if( this.config.closable && this.config.icon ) {\n var icon = document.createElement('span');\n icon.className = \"boxzilla-close-icon\";\n icon.innerHTML = this.config.icon;\n box.appendChild(icon);\n }\n\n document.body.appendChild(wrapper);\n\n return 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 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.outerHeight();\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};\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 // do nothing if element is being animated\n if( this.$element.is(':animated') ) {\n return false;\n }\n\n // is box already at desired visibility?\n if( show === this.visible ) {\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 custom styling for which CSS is \"too stupid\"\n this.setCustomBoxStyling();\n\n // fadein / fadeout the overlay if position is \"center\"\n if( this.config.position === 'center' ) {\n $(this.overlay).fadeToggle('slow');\n }\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.animation === 'fade' ) {\n this.$element.fadeToggle( 'slow' );\n } else {\n this.$element.slideToggle( 'slow' );\n }\n\n // // focus on first input field in box\n // this.$element.find('input').first().focus();\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.method === 'element' ) {\n var $triggerElement = $(this.config.trigger.value).first();\n triggerHeight = ( $triggerElement.length > 0 ) ? $triggerElement.offset().top : 0;\n } else if( this.config.trigger.method === 'percentage' ) {\n triggerHeight = ( this.config.trigger.value / 100 * $(document).height() );\n }\n\n return triggerHeight;\n};\n\n// set cookie that disables automatically showing the box\nBox.prototype.setCookie = function() {\n // do nothing if cookieTime evaluates to false\n if(! this.config.cookieTime) {\n return;\n }\n\n var expiryDate = new Date();\n expiryDate.setDate( expiryDate.getDate() + this.config.cookieTime );\n document.cookie = 'boxzilla_box_'+ this.id + '=true; expires='+ expiryDate.toUTCString() +'; path=/';\n};\n\n// checks whether window.location.hash equals the box element ID or that of any element inside the box\nBox.prototype.locationHashRefersBox = function() {\n\n if( ! window.location.hash || 0 === window.location.hash.length ) {\n return false;\n }\n\n var elementId = window.location.hash.substring(1);\n if( elementId === this.element.id ) {\n return true;\n } else if( this.element.querySelector('#' + elementId) ) {\n return true;\n }\n\n return false;\n};\n\nBox.prototype.fits = function() {\n if( this.config.minimumScreenWidth <= 0 ) {\n return true;\n }\n\n return window.innerWidth > this.config.minimumScreenWidth\n};\n\n// is this box enabled?\nBox.prototype.mayAutoShow = function() {\n\n // don't show if box was closed (dismissed) before\n if( this.closed ) {\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\n if( this.config.testMode ) {\n return false;\n }\n\n // check for cookie\n if( ! this.config.cookieTime ) {\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\nBox.prototype.trigger = function() {\n var shown = this.show();\n if( shown ) {\n this.triggered = true;\n }\n};\n\nBox.prototype.dismiss = function() {\n this.hide();\n this.setCookie();\n this.closed = true;\n Boxzilla.trigger('box.dismiss', [ this ]);\n};\n\nmodule.exports = function(_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n};\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery,\n EventEmitter = require('wolfy87-eventemitter'),\n Boxzilla = Object.create(EventEmitter.prototype),\n Box = require('./Box.js')(Boxzilla),\n Timer = require('./Timer.js'),\n boxes = {},\n windowHeight = window.innerHeight,\n overlay = document.createElement('div'),\n exitIntentDelayTimer,\n exitIntentTriggered,\n siteTimer = new Timer(sessionStorage.getItem('boxzilla_timer') || 0),\n pageTimer = new Timer(0),\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n\nfunction each( obj, callback ) {\n for( var key in obj ) {\n if(! obj.hasOwnProperty(key)) continue;\n callback(obj[key]);\n }\n}\n\nfunction throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last,\n 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 each(boxes, 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 each(boxes, 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 var scrollY = window.scrollY;\n var scrollHeight = scrollY + ( windowHeight * 0.667 );\n\n each(boxes, function(box) {\n if( ! box.mayAutoShow() || box.triggerHeight <= 0 ) {\n return;\n }\n\n if( scrollHeight > box.triggerHeight ) {\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 windowHeight = window.innerHeight;\n\n each(boxes, function(box) {\n box.setCustomBoxStyling();\n });\n}\n\nfunction onOverlayClick(e) {\n var x = e.offsetX;\n var y = e.offsetY;\n\n // calculate if click was near a box to avoid closing it (click error margin)\n each(boxes, function(box) {\n var rect = box.element.getBoundingClientRect();\n var margin = 100 + ( window.innerWidth * 0.05 );\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 if(exitIntentTriggered) return;\n\n each(boxes, 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 onMouseEnter() {\n if( exitIntentDelayTimer ) {\n window.clearInterval(exitIntentDelayTimer);\n exitIntentDelayTimer = null;\n }\n}\n\nvar timers = {\n start: function() {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if( sessionTime ) siteTimer.time = sessionTime;\n siteTimer.start();\n pageTimer.start();\n },\n stop: function() {\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 var html = document.documentElement;\n\n // add overlay element to dom\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay);\n\n // event binds\n $(window).on('scroll', throttle(checkHeightCriteria));\n $(window).on('resize', throttle(recalculateHeights));\n $(window).on('load', recalculateHeights );\n $(html).on('mouseleave', onMouseLeave);\n $(html).on('mouseenter', onMouseEnter);\n $(html).on('keyup', onKeyUp);\n $(overlay).click(onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000 );\n\n timers.start();\n $(window).on('focus', timers.start);\n $(window).on('beforeunload', function() {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n $(window).on('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 boxes[id] = new Box(id, opts);\n return boxes[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 each(boxes, function(box) { box.dismiss(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].dismiss();\n }\n};\n\nBoxzilla.hide = function(id) {\n if( typeof(id) === \"undefined\" ) {\n each(boxes, function(box) { box.hide(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].hide();\n }\n};\n\nBoxzilla.show = function(id) {\n if( typeof(id) === \"undefined\" ) {\n each(boxes, function(box) { box.show(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].show();\n }\n};\n\nBoxzilla.toggle = function(id) {\n if( typeof(id) === \"undefined\" ) {\n each(boxes, function(box) { box.toggle(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].toggle();\n }\n};\n\nwindow.Boxzilla = Boxzilla;\n\nif ( typeof module !== 'undefined' && module.exports ) {\n module.exports = Boxzilla;\n}\n},{\"./Box.js\":2,\"./Timer.js\":4,\"wolfy87-eventemitter\":5}],4:[function(require,module,exports){\n'use strict';\n\nvar Timer = function(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 window.clearInterval(this.interval);\n this.interval = 0;\n};\n\nmodule.exports = Timer;\n},{}],5:[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},{}]},{},[1]);\n })();"],"sourceRoot":"/source/"}
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","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","boxes","boxOpts","location","origin","substring","content","replace","box","create","id","addEventListener","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","querySelector","show","boxzilla","2","merge","obj1","obj2","obj3","attrname","$","jQuery","defaults","animation","rehide","cookieTime","icon","minimumScreenWidth","position","trigger","closable","Box","config","this","overlay","getElementById","visible","closed","triggered","triggerHeight","cookieSet","method","calculateTriggerHeight","isCookieSet","dom","$element","events","prototype","find","click","dismiss","bind","on","target","setCookie","toggle","fits","locationHashRefersBox","load","wrapper","createElement","setAttribute","display","appendChild","innerHTML","scripts","querySelectorAll","script","createTextNode","text","parentNode","removeChild","setCustomBoxStyling","overflowY","maxHeight","windowHeight","innerHeight","boxHeight","outerHeight","newTopMargin","marginTop","is","fadeToggle","slideToggle","hide","$triggerElement","value","first","offset","top","height","expiryDate","Date","setDate","getDate","cookie","toUTCString","hash","elementId","innerWidth","mayAutoShow","mayRehide","RegExp","shown","_Boxzilla","3","each","obj","callback","key","throttle","fn","threshhold","scope","last","deferTimer","context","now","args","arguments","clearTimeout","setTimeout","apply","onKeyUp","keyCode","checkPageViewsCriteria","pageViews","checkTimeCriteria","siteTimer","time","pageTimer","checkHeightCriteria","scrollY","scrollHeight","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","getBoundingClientRect","margin","left","right","bottom","triggerExitIntent","exitIntentTriggered","onMouseLeave","delay","clientY","exitIntentDelayTimer","onMouseEnter","clearInterval","EventEmitter","Object","Timer","sessionStorage","getItem","timers","start","sessionTime","stop","setItem","html","documentElement","setInterval","opts","./Box.js","./Timer.js","wolfy87-eventemitter","4","interval","tick","5","indexOfListener","listeners","listener","alias","name","proto","originalGlobalValue","getListeners","evt","response","_getEvents","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,GAAIA,GAAUC,OAAgEC,EAASD,QAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG,IAAIQ,WAAYZ,GAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAG,GAAIE,GAAED,EAAEI,GAAG,GAAGL,EAAG,OAAOI,GAAEF,EAAEA,EAAEF,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,MAAOD,GAAEG,GAAGQ,QAAkD,IAAI,GAA1CL,GAAkB,kBAATX,IAA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O7C,KAAK1E,IAAOyG,GACR,GAAIA,EAAa5M,eAAemG,GAI5B,IAHAmE,EAAYsC,EAAazG,GAAK0G,MAAM,GACpCpQ,EAAI6N,EAAUtN,OAEPP,KAGH8N,EAAWD,EAAU7N,GAEjB8N,EAASiB,QAAS,GAClBjK,KAAKsK,eAAehB,EAAKN,EAASA,UAGtCO,EAAWP,EAASA,SAASvD,MAAMzF,KAAMqF,OAErCkE,IAAavJ,KAAKuL,uBAClBvL,KAAKsK,eAAehB,EAAKN,EAASA,SAMlD,OAAOhJ,OAMXmJ,EAAMvJ,QAAUqJ,EAAM,aAUtBE,EAAMqC,KAAO,SAAclC,GACvB,GAAIjE,GAAOyE,MAAMhJ,UAAUwK,MAAM9P,KAAK8J,UAAW,EACjD,OAAOtF,MAAKoL,UAAU9B,EAAKjE,IAW/B8D,EAAMsC,mBAAqB,SAA4BpI,GAEnD,MADArD,MAAK0L,iBAAmBrI,EACjBrD,MAWXmJ,EAAMoC,oBAAsB,WACxB,OAAIvL,KAAKvB,eAAe,qBACbuB,KAAK0L,kBAapBvC,EAAMK,WAAa,WACf,MAAOxJ,MAAKkL,UAAYlL,KAAKkL,aAQjCzD,EAAakE,WAAa,WAEtB,MADApQ,GAAQkM,aAAe2B,EAChB3B,GAIW,kBAAXhN,IAAyBA,EAAOmR,IACvCnR,EAAO,WACH,MAAOgN,KAGY,gBAAX9L,IAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAUkM,EAGjBlM,EAAQkM,aAAeA,IAE7BjM,KAAKwE,gBAEI","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (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})({1:[function(require,module,exports){\n'use strict';\n\nvar Boxzilla = require('boxzilla');\nvar options = window.boxzilla_options;\nvar isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n// print message when test mode is enabled\nif( 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\nBoxzilla.init();\n\n// create boxes from options\nfor( 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 // fix http:// links in box content....\n if( window.location.origin.substring(0, 5) === \"https\" ) {\n boxOpts.content = boxOpts.content.replace(window.location.origin.replace(\"https\", \"http\"), window.location.origin);\n }\n\n // create box\n var box = Boxzilla.create( boxOpts.id, boxOpts);\n \n // add custom css to box\n css(box.element, boxOpts.css);\n}\n\n// helper function for setting CSS styles\nfunction 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/**\n * If a MailChimp for WordPress form was submitted, open the box containing that form (if any)\n *\n * TODO: Just set location hash from MailChimp for WP?\n */\nwindow.addEventListener('load', function() {\n if( typeof(window.mc4wp_forms_config) === \"object\" && window.mc4wp_forms_config.submitted_form ) {\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)) { continue; }\n var box = boxes[boxId];\n if( box.element.querySelector(selector)) {\n box.show();\n return;\n }\n }\n }\n});\n\nwindow.Boxzilla = Boxzilla;\n},{\"boxzilla\":3}],2:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery,\n defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookieTime': 0,\n 'icon': '&times',\n 'minimumScreenWidth': 0,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n },\n Boxzilla;\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) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n}\n\n// Box Object\nvar Box = function( id, config ) {\n this.id \t\t= 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 \t= false;\n this.closed \t= false;\n this.triggered \t= false;\n this.triggerHeight = 0;\n this.cookieSet = false;\n\n // if a trigger was given, calculate values once and store\n if( this.config.trigger ) {\n if( this.config.trigger.method === 'percentage' || this.config.trigger.method === 'element' ) {\n this.triggerHeight = this.calculateTriggerHeight();\n }\n\n this.cookieSet = this.isCookieSet();\n }\n\n // create dom element for this box\n this.element = this.dom();\n this.$element = $(this.element);\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 this.$element.find('.boxzilla-close-icon').click(box.dismiss.bind(this));\n\n this.$element.on('click', 'a', function(e) {\n Boxzilla.trigger('box.interactions.link', [ box, e.target ] );\n });\n\n this.$element.on('submit', 'form', function(e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [ box, e.target ]);\n });\n\n // attach event to all links referring #boxzilla-{box_id}\n $(document.body).on('click', 'a[href=\"#boxzilla-' + box.id + '\"]', function() {\n box.toggle();\n return false;\n });\n\n // maybe show box right away\n if( this.fits() && this.locationHashRefersBox() ) {\n $(window).load(this.show.bind(this));\n }\n\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 = document.createElement('div');\n content.className = 'boxzilla-content';\n content.innerHTML = this.config.content;\n box.appendChild(content);\n\n // remove <script> from box content and append them to the document body\n var scripts = content.querySelectorAll('script');\n if(scripts.length) {\n var script = document.createElement('script');\n for( var i=0; i<scripts.length; i++ ) {\n script.appendChild(document.createTextNode(scripts[i].text));\n scripts[i].parentNode.removeChild(scripts[i]);\n }\n document.body.appendChild(script);\n }\n\n // for safety measure, restore jQuery\n window.jQuery = $;\n\n if( this.config.closable && this.config.icon ) {\n var icon = document.createElement('span');\n icon.className = \"boxzilla-close-icon\";\n icon.innerHTML = this.config.icon;\n box.appendChild(icon);\n }\n\n document.body.appendChild(wrapper);\n\n return 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 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.outerHeight();\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};\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 // do nothing if element is being animated\n if( this.$element.is(':animated') ) {\n return false;\n }\n\n // is box already at desired visibility?\n if( show === this.visible ) {\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 custom styling for which CSS is \"too stupid\"\n this.setCustomBoxStyling();\n\n // fadein / fadeout the overlay if position is \"center\"\n if( this.config.position === 'center' ) {\n $(this.overlay).fadeToggle('slow');\n }\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.animation === 'fade' ) {\n this.$element.fadeToggle( 'slow' );\n } else {\n this.$element.slideToggle( 'slow' );\n }\n\n // // focus on first input field in box\n // this.$element.find('input').first().focus();\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.method === 'element' ) {\n var $triggerElement = $(this.config.trigger.value).first();\n triggerHeight = ( $triggerElement.length > 0 ) ? $triggerElement.offset().top : 0;\n } else if( this.config.trigger.method === 'percentage' ) {\n triggerHeight = ( this.config.trigger.value / 100 * $(document).height() );\n }\n\n return triggerHeight;\n};\n\n// set cookie that disables automatically showing the box\nBox.prototype.setCookie = function() {\n // do nothing if cookieTime evaluates to false\n if(! this.config.cookieTime) {\n return;\n }\n\n var expiryDate = new Date();\n expiryDate.setDate( expiryDate.getDate() + this.config.cookieTime );\n document.cookie = 'boxzilla_box_'+ this.id + '=true; expires='+ expiryDate.toUTCString() +'; path=/';\n};\n\n// checks whether window.location.hash equals the box element ID or that of any element inside the box\nBox.prototype.locationHashRefersBox = function() {\n\n if( ! window.location.hash || 0 === window.location.hash.length ) {\n return false;\n }\n\n var elementId = window.location.hash.substring(1);\n if( elementId === this.element.id ) {\n return true;\n } else if( this.element.querySelector('#' + elementId) ) {\n return true;\n }\n\n return false;\n};\n\nBox.prototype.fits = function() {\n if( this.config.minimumScreenWidth <= 0 ) {\n return true;\n }\n\n return window.innerWidth > this.config.minimumScreenWidth\n};\n\n// is this box enabled?\nBox.prototype.mayAutoShow = function() {\n\n // don't show if box was closed (dismissed) before\n if( this.closed ) {\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\n if( this.config.testMode ) {\n return false;\n }\n\n // check for cookie\n if( ! this.config.cookieTime ) {\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\nBox.prototype.trigger = function() {\n var shown = this.show();\n if( shown ) {\n this.triggered = true;\n }\n};\n\nBox.prototype.dismiss = function() {\n this.hide();\n this.setCookie();\n this.closed = true;\n Boxzilla.trigger('box.dismiss', [ this ]);\n};\n\nmodule.exports = function(_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n};\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery,\n EventEmitter = require('wolfy87-eventemitter'),\n Boxzilla = Object.create(EventEmitter.prototype),\n Box = require('./Box.js')(Boxzilla),\n Timer = require('./Timer.js'),\n boxes = {},\n windowHeight = window.innerHeight,\n overlay = document.createElement('div'),\n exitIntentDelayTimer,\n exitIntentTriggered,\n siteTimer = new Timer(sessionStorage.getItem('boxzilla_timer') || 0),\n pageTimer = new Timer(0),\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n\nfunction each( obj, callback ) {\n for( var key in obj ) {\n if(! obj.hasOwnProperty(key)) continue;\n callback(obj[key]);\n }\n}\n\nfunction throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last,\n 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 each(boxes, 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 each(boxes, 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 var scrollY = window.scrollY;\n var scrollHeight = scrollY + ( windowHeight * 0.667 );\n\n each(boxes, function(box) {\n if( ! box.mayAutoShow() || box.triggerHeight <= 0 ) {\n return;\n }\n\n if( scrollHeight > box.triggerHeight ) {\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 windowHeight = window.innerHeight;\n\n each(boxes, function(box) {\n box.setCustomBoxStyling();\n });\n}\n\nfunction onOverlayClick(e) {\n var x = e.offsetX;\n var y = e.offsetY;\n\n // calculate if click was near a box to avoid closing it (click error margin)\n each(boxes, function(box) {\n var rect = box.element.getBoundingClientRect();\n var margin = 100 + ( window.innerWidth * 0.05 );\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 if(exitIntentTriggered) return;\n\n each(boxes, 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 onMouseEnter() {\n if( exitIntentDelayTimer ) {\n window.clearInterval(exitIntentDelayTimer);\n exitIntentDelayTimer = null;\n }\n}\n\nvar timers = {\n start: function() {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if( sessionTime ) siteTimer.time = sessionTime;\n siteTimer.start();\n pageTimer.start();\n },\n stop: function() {\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 var html = document.documentElement;\n\n // add overlay element to dom\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay);\n\n // event binds\n $(window).on('scroll', throttle(checkHeightCriteria));\n $(window).on('resize', throttle(recalculateHeights));\n $(window).on('load', recalculateHeights );\n $(html).on('mouseleave', onMouseLeave);\n $(html).on('mouseenter', onMouseEnter);\n $(html).on('keyup', onKeyUp);\n $(overlay).click(onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000 );\n\n timers.start();\n $(window).on('focus', timers.start);\n $(window).on('beforeunload', function() {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n $(window).on('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 boxes[id] = new Box(id, opts);\n return boxes[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 each(boxes, function(box) { box.dismiss(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].dismiss();\n }\n};\n\nBoxzilla.hide = function(id) {\n if( typeof(id) === \"undefined\" ) {\n each(boxes, function(box) { box.hide(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].hide();\n }\n};\n\nBoxzilla.show = function(id) {\n if( typeof(id) === \"undefined\" ) {\n each(boxes, function(box) { box.show(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].show();\n }\n};\n\nBoxzilla.toggle = function(id) {\n if( typeof(id) === \"undefined\" ) {\n each(boxes, function(box) { box.toggle(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].toggle();\n }\n};\n\nwindow.Boxzilla = Boxzilla;\n\nif ( typeof module !== 'undefined' && module.exports ) {\n module.exports = Boxzilla;\n}\n},{\"./Box.js\":2,\"./Timer.js\":4,\"wolfy87-eventemitter\":5}],4:[function(require,module,exports){\n'use strict';\n\nvar Timer = function(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 window.clearInterval(this.interval);\n this.interval = 0;\n};\n\nmodule.exports = Timer;\n},{}],5:[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},{}]},{},[1]);\n; })();"],"sourceRoot":"/source/"}
boxzilla.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
- Version: 3.0.2
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
@@ -48,7 +48,7 @@ function __load_boxzilla() {
48
  }
49
 
50
  define( 'BOXZILLA_FILE', __FILE__ );
51
- define( 'BOXZILLA_VERSION', '3.0.2' );
52
 
53
  require __DIR__ . '/bootstrap.php';
54
  }
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
+ Version: 3.0.3
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
48
  }
49
 
50
  define( 'BOXZILLA_FILE', __FILE__ );
51
+ define( 'BOXZILLA_VERSION', '3.0.3' );
52
 
53
  require __DIR__ . '/bootstrap.php';
54
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Ibericode, DvanKooten, hchouhan, lapzor
3
  Donate link: https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=boxzilla&utm_campaign=donate-link
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: 3.8
6
- Tested up to: 4.5.2
7
- Stable tag: 3.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -149,6 +149,19 @@ Have a look at the [frequently asked questions](https://wordpress.org/plugins/bo
149
  == Changelog ==
150
 
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  #### 3.0.2 - June 21, 2016
153
 
154
  **Fixes**
3
  Donate link: https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=boxzilla&utm_campaign=donate-link
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: 3.8
6
+ Tested up to: 4.5.3
7
+ Stable tag: 3.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
149
  == Changelog ==
150
 
151
 
152
+ #### 3.0.3 - July 5, 2016
153
+
154
+ **Improvements**
155
+
156
+ - Add `id` attribute to box element.
157
+ - Automatically fix links in box content that use HTTP when HTTPS is needed.
158
+ - Restore global jQuery object after running user scripts, to failsafe errors.
159
+
160
+ **Additions**
161
+
162
+ - When using [MailChimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/) without AJAX, the box will now automatically re-open after reloading the page.
163
+
164
+
165
  #### 3.0.2 - June 21, 2016
166
 
167
  **Fixes**
src/admin/class-migrations.php CHANGED
@@ -51,6 +51,11 @@ class Migrations {
51
  $files = glob( rtrim( $this->migrations_dir, '/' ) . '/*.php' );
52
  $migrations = array();
53
 
 
 
 
 
 
54
  foreach( $files as $file ) {
55
  $migration = basename( $file );
56
  $parts = explode( '-', $migration );
51
  $files = glob( rtrim( $this->migrations_dir, '/' ) . '/*.php' );
52
  $migrations = array();
53
 
54
+ // return empty array when glob returns non-array value.
55
+ if( ! is_array( $files ) ) {
56
+ return $migrations;
57
+ }
58
+
59
  foreach( $files as $file ) {
60
  $migration = basename( $file );
61
  $parts = explode( '-', $migration );
src/class-loader.php CHANGED
@@ -237,15 +237,8 @@ class BoxLoader {
237
  public function load_assets() {
238
  $pre_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
239
 
240
- // stylesheets
241
- wp_register_style( 'boxzilla', $this->plugin->url( '/assets/css/styles' . $pre_suffix . '.css' ), array(), $this->plugin->version() );
242
-
243
- // scripts
244
- wp_register_script( 'boxzilla',$this->plugin->url( '/assets/js/script' . $pre_suffix . '.js' ), array( 'jquery' ), $this->plugin->version(), true );
245
-
246
- // Finally, enqueue style.
247
- wp_enqueue_style( 'boxzilla' );
248
- wp_enqueue_script( 'boxzilla' );
249
 
250
  $this->pass_box_options();
251
 
237
  public function load_assets() {
238
  $pre_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
239
 
240
+ wp_enqueue_style( 'boxzilla', $this->plugin->url( '/assets/css/styles' . $pre_suffix . '.css' ), array(), $this->plugin->version() );
241
+ wp_enqueue_script( 'boxzilla', $this->plugin->url( '/assets/js/script' . $pre_suffix . '.js' ), array( 'jquery' ), $this->plugin->version(), true );
 
 
 
 
 
 
 
242
 
243
  $this->pass_box_options();
244