Boxzilla - Version 3.1.7

Version Description

Download this release

Release Info

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

Code changes from version 3.1.6 to 3.1.7

Files changed (97) hide show
  1. assets/browserify/script.js +4 -2
  2. assets/css/admin-styles.css +4 -0
  3. assets/css/admin-styles.min.css +1 -1
  4. assets/js/admin-script.min.js +1 -1
  5. assets/js/admin-script.min.js.map +1 -1
  6. assets/js/script.js +7 -3
  7. assets/js/script.min.js +1 -1
  8. assets/js/script.min.js.map +1 -1
  9. assets/scss/admin-styles.scss +4 -0
  10. bootstrap.php +2 -0
  11. boxzilla.php +2 -2
  12. languages/boxzilla.pot +27 -14
  13. readme.txt +13 -5
  14. src/admin/class-admin.php +32 -0
  15. src/admin/class-migrations.php +11 -2
  16. src/admin/class-review-notice.php +96 -0
  17. src/admin/migrations/{4.0.0-cookie-option.php → 3.1-cookie-option.php} +0 -0
  18. trunk/LICENSE +339 -0
  19. trunk/assets/browserify/admin-script.js +1 -0
  20. trunk/assets/browserify/admin/_admin.js +123 -0
  21. trunk/assets/browserify/admin/_designer.js +109 -0
  22. trunk/assets/browserify/admin/_option.js +56 -0
  23. trunk/assets/browserify/script.js +93 -0
  24. trunk/assets/css/admin-styles.css +127 -0
  25. trunk/assets/css/admin-styles.min.css +1 -0
  26. trunk/assets/css/index.php +7 -0
  27. trunk/assets/img/index.php +6 -0
  28. trunk/assets/img/menu-icon.jpg +0 -0
  29. trunk/assets/img/menu-icon.png +0 -0
  30. trunk/assets/index.php +6 -0
  31. trunk/assets/js/admin-script.js +785 -0
  32. trunk/assets/js/admin-script.min.js +2 -0
  33. trunk/assets/js/admin-script.min.js.map +1 -0
  34. trunk/assets/js/index.php +6 -0
  35. trunk/assets/js/script.js +1458 -0
  36. trunk/assets/js/script.min.js +2 -0
  37. trunk/assets/js/script.min.js.map +1 -0
  38. trunk/assets/scss/admin-styles.scss +173 -0
  39. trunk/bootstrap.php +51 -0
  40. trunk/boxzilla.php +68 -0
  41. trunk/languages/boxzilla-es_ES.mo +0 -0
  42. trunk/languages/boxzilla-es_ES.po +212 -0
  43. trunk/languages/boxzilla-fr_FR.mo +0 -0
  44. trunk/languages/boxzilla-fr_FR.po +211 -0
  45. trunk/languages/boxzilla-nl_NL.mo +0 -0
  46. trunk/languages/boxzilla-nl_NL.po +209 -0
  47. trunk/languages/boxzilla.pot +407 -0
  48. trunk/readme.txt +286 -0
  49. trunk/src/admin/class-admin.php +764 -0
  50. trunk/src/admin/class-autocomplete.php +95 -0
  51. trunk/src/admin/class-installer.php +93 -0
  52. trunk/src/admin/class-migrations.php +96 -0
  53. trunk/src/admin/class-notices.php +42 -0
  54. trunk/src/admin/class-review-notice.php +96 -0
  55. trunk/src/admin/migrations/3.1-cookie-option.php +24 -0
  56. trunk/src/admin/views/extensions.php +60 -0
  57. trunk/src/admin/views/metaboxes/box-appearance-controls.php +46 -0
  58. trunk/src/admin/views/metaboxes/box-option-controls.php +218 -0
  59. trunk/src/admin/views/metaboxes/email-optin.php +23 -0
  60. trunk/src/admin/views/metaboxes/need-help.php +8 -0
  61. trunk/src/admin/views/settings.php +56 -0
  62. trunk/src/class-bootstrapper.php +103 -0
  63. trunk/src/class-box.php +231 -0
  64. trunk/src/class-boxzilla-service-provider.php +69 -0
  65. trunk/src/class-boxzilla.php +20 -0
  66. trunk/src/class-collection.php +154 -0
  67. trunk/src/class-loader.php +299 -0
  68. trunk/src/class-php-fallback.php +62 -0
  69. trunk/src/class-plugin.php +109 -0
  70. trunk/src/default-actions.php +33 -0
  71. trunk/src/default-filters.php +10 -0
  72. trunk/src/di/class-container-with-property-access.php +54 -0
  73. trunk/src/di/class-container.php +281 -0
  74. trunk/src/di/interface-service-provider.php +46 -0
  75. trunk/src/functions.php +17 -0
  76. trunk/src/licensing/class-api-exception.php +33 -0
  77. trunk/src/licensing/class-api.php +174 -0
  78. trunk/src/licensing/class-license-manager.php +166 -0
  79. trunk/src/licensing/class-license-service-provider.php +39 -0
  80. trunk/src/licensing/class-license.php +114 -0
  81. trunk/src/licensing/class-poller.php +67 -0
  82. trunk/src/licensing/class-update-manager.php +226 -0
  83. trunk/src/licensing/views/license-form.php +57 -0
  84. trunk/vendor/autoload.php +7 -0
  85. trunk/vendor/composer/ClassLoader.php +415 -0
  86. trunk/vendor/composer/LICENSE +21 -0
  87. trunk/vendor/composer/autoload_classmap.php +33 -0
  88. trunk/vendor/composer/autoload_files.php +10 -0
  89. trunk/vendor/composer/autoload_namespaces.php +9 -0
  90. trunk/vendor/composer/autoload_psr4.php +9 -0
  91. trunk/vendor/composer/autoload_real.php +70 -0
  92. trunk/vendor/composer/autoload_static.php +47 -0
  93. trunk/vendor/composer/installed.json +1 -0
  94. vendor/composer/ClassLoader.php +7 -5
  95. vendor/composer/autoload_classmap.php +1 -0
  96. vendor/composer/autoload_real.php +23 -12
  97. vendor/composer/autoload_static.php +47 -0
assets/browserify/script.js CHANGED
@@ -19,8 +19,10 @@ for( var i=0; i < options.boxes.length; 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
19
  boxOpts.testMode = isLoggedIn && options.testMode;
20
 
21
  // fix http:// links in box content....
22
+ if( window.location.protocol === "https:" && window.location.host ) {
23
+ var o = "http://" + window.location.host;
24
+ var n = old.replace('http://', 'https://');
25
+ boxOpts.content = boxOpts.content.replace(o, n);
26
  }
27
 
28
  // create box
assets/css/admin-styles.css CHANGED
@@ -68,6 +68,10 @@
68
  #boxzilla-admin .status.negative {
69
  background: #c3c3c3; }
70
 
 
 
 
 
71
  /* Radio Switches */
72
  .radio-label {
73
  font-weight: normal; }
68
  #boxzilla-admin .status.negative {
69
  background: #c3c3c3; }
70
 
71
+ .boxzilla-is-dismissible {
72
+ padding-right: 38px;
73
+ position: relative; }
74
+
75
  /* Radio Switches */
76
  .radio-label {
77
  font-weight: normal; }
assets/css/admin-styles.min.css CHANGED
@@ -1 +1 @@
1
- .boxzilla-rule-row-0 .boxzilla-close{visibility:hidden}.column-box_id{width:80px}.boxzilla-sm{width:150px}.boxzilla-xsm{width:15px}.boxzilla-title{margin-top:2em!important}.boxzilla-label{display:block;font-weight:700;margin-bottom:6px}.boxzilla-close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;font-size:21px;font-weight:700;line-height:26px;text-shadow:0 1px 0 #fff;opacity:.3;filter:alpha(opacity=30)}.boxzilla-close:focus,.boxzilla-close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.6;filter:alpha(opacity=60)}.post-type-boxzilla-box .form-table{table-layout:fixed}.post-type-boxzilla-box .window-positions{border:1px solid #EEE}.post-type-boxzilla-box .window-positions td{padding:3px;margin-bottom:0}.post-type-boxzilla-box .wp-picker-container{white-space:nowrap}.post-type-boxzilla-box .wp-picker-clear,.post-type-boxzilla-box .wp-picker-holder,.post-type-boxzilla-box .wp-picker-input-wrap{background:#fff;z-index:999!important;position:absolute!important}#boxzilla-admin .status{display:inline-block;padding:3px 6px;color:#fff;text-transform:uppercase;font-weight:700}#boxzilla-admin .status.positive{background-color:#32cd32}#boxzilla-admin .status.negative{background:#c3c3c3}.radio-label{font-weight:400}.radio-label>input{margin-top:0!important}.boxzilla-row{margin:0 -20px}.boxzilla-col-one-third,.boxzilla-col-two-third{float:left;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px}.boxzilla-col-two-third{width:66.66%}.boxzilla-col-one-third{width:33.33%}.boxzilla-sidebar{margin-top:10px}.boxzilla-box{background:#fff;padding:20px;margin-bottom:20px;border:1px solid #ccc}.boxzilla-box :first-child,.boxzilla-box h3{margin-top:0}.boxzilla-box :last-child{margin-bottom:0}.boxzilla-sidebar form label{display:block;font-weight:700;margin-bottom:6px}@media (max-width:920px){.boxzilla-row{margin:0}.boxzilla-col-one-third,.boxzilla-col-two-third{float:none;padding:0;width:auto}.boxzilla-sidebar{margin-top:40px}}
1
+ .boxzilla-rule-row-0 .boxzilla-close{visibility:hidden}.column-box_id{width:80px}.boxzilla-sm{width:150px}.boxzilla-xsm{width:15px}.boxzilla-title{margin-top:2em!important}.boxzilla-label{display:block;font-weight:700;margin-bottom:6px}.boxzilla-close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;font-size:21px;font-weight:700;line-height:26px;text-shadow:0 1px 0 #fff;opacity:.3;filter:alpha(opacity=30)}.boxzilla-close:focus,.boxzilla-close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.6;filter:alpha(opacity=60)}.post-type-boxzilla-box .form-table{table-layout:fixed}.post-type-boxzilla-box .window-positions{border:1px solid #EEE}.post-type-boxzilla-box .window-positions td{padding:3px;margin-bottom:0}.post-type-boxzilla-box .wp-picker-container{white-space:nowrap}.post-type-boxzilla-box .wp-picker-clear,.post-type-boxzilla-box .wp-picker-holder,.post-type-boxzilla-box .wp-picker-input-wrap{background:#fff;z-index:999!important;position:absolute!important}#boxzilla-admin .status{display:inline-block;padding:3px 6px;color:#fff;text-transform:uppercase;font-weight:700}#boxzilla-admin .status.positive{background-color:#32cd32}#boxzilla-admin .status.negative{background:#c3c3c3}.boxzilla-is-dismissible{padding-right:38px;position:relative}.radio-label{font-weight:400}.radio-label>input{margin-top:0!important}.boxzilla-row{margin:0 -20px}.boxzilla-col-one-third,.boxzilla-col-two-third{float:left;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px}.boxzilla-col-two-third{width:66.66%}.boxzilla-col-one-third{width:33.33%}.boxzilla-sidebar{margin-top:10px}.boxzilla-box{background:#fff;padding:20px;margin-bottom:20px;border:1px solid #ccc}.boxzilla-box :first-child,.boxzilla-box h3{margin-top:0}.boxzilla-box :last-child{margin-bottom:0}.boxzilla-sidebar form label{display:block;font-weight:700;margin-bottom:6px}@media (max-width:920px){.boxzilla-row{margin:0}.boxzilla-col-one-third,.boxzilla-col-two-third{float:none;padding:0;width:auto}.boxzilla-sidebar{margin-top:40px}}
assets/js/admin-script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};!function(){var e=void 0,t=void 0;!function n(t,o,r){function i(s,a){if(!o[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=o[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,o,r)}return o[s].exports}for(var l="function"==typeof e&&e,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(e,t,n){function o(){c.find(".boxzilla-trigger-options").toggle(""!==this.value)}function r(){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"),o=e.querySelector(".boxzilla-rule-qualifier"),r=n.cloneNode(!0),i=s(r);switch(s(e.querySelectorAll(".boxzilla-helper")).remove(),r.removeAttribute("name"),r.className=r.className+" boxzilla-helper",n.parentNode.insertBefore(r,n.nextSibling),i.change(function(){n.value=this.value}),r.style.display="",n.style.display="none",o.style.display="",t){default:r.placeholder=m.enterCommaSeparatedValues;break;case"":case"everywhere":o.value="1",n.value="",r.style.display="none",o.style.display="none";break;case"is_single":case"is_post":r.placeholder=m.enterCommaSeparatedPosts,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":r.placeholder=m.enterCommaSeparatedPages,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":r.placeholder=m.enterCommaSeparatedPostTypes,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":r.placeholder=m.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"),m=boxzilla_i18n;c.on("click",".boxzilla-add-rule",l),c.on("click",".boxzilla-remove-rule",r),c.on("change",".boxzilla-rule-condition",i),c.find(".boxzilla-auto-show-trigger").on("change",o),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 o=function(e,t,n){function o(){"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 r(){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();r(),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:r,clear:r}),d.find(":input").not(".boxzilla-color-field").change(r),n.on("editor.init",r),{init:o,resetStyles:i,options:c}};t.exports=o},{}],4:[function(e,t,n){var o=window.jQuery,r=function(e){"string"==typeof e&&(e=document.getElementById("boxzilla-"+e)),e||console.error("Unable to find option element."),this.element=e};r.prototype.getColorValue=function(){return this.element.value.length>0?o(this.element).hasClass("wp-color-field")?o(this.element).wpColorPicker("color"):this.element.value:""},r.prototype.getPxValue=function(e){return this.element.value.length>0?parseInt(this.element.value)+"px":e||""},r.prototype.getValue=function(e){return this.element.value.length>0?this.element.value:e||""},r.prototype.clear=function(){this.element.value=""},r.prototype.setValue=function(e){this.element.value=e},t.exports=r},{}],5:[function(e,n,o){(function(){function e(){}function o(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function r(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,o=this._getEvents();if(e instanceof RegExp){t={};for(n in o)o.hasOwnProperty(n)&&e.test(n)&&(t[n]=o[n])}else t=o[e]||(o[e]=[]);return t},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,r=this.getListenersAsObject(e),i="object"===("undefined"==typeof t?"undefined":_typeof(t));for(n in r)r.hasOwnProperty(n)&&o(r[n],t)===-1&&r[n].push(i?t:{listener:t,once:!1});return this},i.on=r("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=r("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,r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&(n=o(i[r],t),n!==-1&&i[r].splice(n,1));return this},i.off=r("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 o,r,i=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!==("undefined"==typeof t?"undefined":_typeof(t))||t instanceof RegExp)for(o=n.length;o--;)i.call(this,t,n[o]);else for(o in t)t.hasOwnProperty(o)&&(r=t[o])&&("function"==typeof r?i.call(this,o,r):l.call(this,o,r));return this},i.removeEvent=function(e){var t,n="undefined"==typeof e?"undefined":_typeof(e),o=this._getEvents();if("string"===n)delete o[e];else if(e instanceof RegExp)for(t in o)o.hasOwnProperty(t)&&e.test(t)&&delete o[t];else delete this._events;return this},i.removeAllListeners=r("removeEvent"),i.emitEvent=function(e,t){var n,o,r,i,l,s=this.getListenersAsObject(e);for(i in s)if(s.hasOwnProperty(i))for(n=s[i].slice(0),r=n.length;r--;)o=n[r],o.once===!0&&this.removeListener(e,o.listener),l=o.listener.apply(this,t||[]),l===this._getOnceReturnValue()&&this.removeListener(e,o.listener);return this},i.trigger=r("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"===("undefined"==typeof n?"undefined":_typeof(n))&&n.exports?n.exports=e:l.EventEmitter=e}).call(this)},{}]},{},[1])}();
2
  //# sourceMappingURL=admin-script.min.js.map
1
+ "use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){var e=void 0,t=void 0;!function n(t,o,r){function i(s,a){if(!o[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=o[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,o,r)}return o[s].exports}for(var l="function"==typeof e&&e,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(e,t,n){function o(){c.find(".boxzilla-trigger-options").toggle(""!==this.value)}function r(){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"),o=e.querySelector(".boxzilla-rule-qualifier"),r=n.cloneNode(!0),i=s(r);switch(s(e.querySelectorAll(".boxzilla-helper")).remove(),r.removeAttribute("name"),r.className=r.className+" boxzilla-helper",n.parentNode.insertBefore(r,n.nextSibling),i.change(function(){n.value=this.value}),r.style.display="",n.style.display="none",o.style.display="",t){default:r.placeholder=m.enterCommaSeparatedValues;break;case"":case"everywhere":o.value="1",n.value="",r.style.display="none",o.style.display="none";break;case"is_single":case"is_post":r.placeholder=m.enterCommaSeparatedPosts,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":r.placeholder=m.enterCommaSeparatedPages,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":r.placeholder=m.enterCommaSeparatedPostTypes,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":r.placeholder=m.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"),m=boxzilla_i18n;c.on("click",".boxzilla-add-rule",l),c.on("click",".boxzilla-remove-rule",r),c.on("change",".boxzilla-rule-condition",i),c.find(".boxzilla-auto-show-trigger").on("change",o),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 o=function(e,t,n){function o(){"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 r(){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();r(),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:r,clear:r}),d.find(":input").not(".boxzilla-color-field").change(r),n.on("editor.init",r),{init:o,resetStyles:i,options:c}};t.exports=o},{}],4:[function(e,t,n){var o=window.jQuery,r=function(e){"string"==typeof e&&(e=document.getElementById("boxzilla-"+e)),e||console.error("Unable to find option element."),this.element=e};r.prototype.getColorValue=function(){return this.element.value.length>0?o(this.element).hasClass("wp-color-field")?o(this.element).wpColorPicker("color"):this.element.value:""},r.prototype.getPxValue=function(e){return this.element.value.length>0?parseInt(this.element.value)+"px":e||""},r.prototype.getValue=function(e){return this.element.value.length>0?this.element.value:e||""},r.prototype.clear=function(){this.element.value=""},r.prototype.setValue=function(e){this.element.value=e},t.exports=r},{}],5:[function(e,n,o){(function(){function e(){}function o(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function r(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,o=this._getEvents();if(e instanceof RegExp){t={};for(n in o)o.hasOwnProperty(n)&&e.test(n)&&(t[n]=o[n])}else t=o[e]||(o[e]=[]);return t},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,r=this.getListenersAsObject(e),i="object"===("undefined"==typeof t?"undefined":_typeof(t));for(n in r)r.hasOwnProperty(n)&&o(r[n],t)===-1&&r[n].push(i?t:{listener:t,once:!1});return this},i.on=r("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=r("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,r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&(n=o(i[r],t),n!==-1&&i[r].splice(n,1));return this},i.off=r("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 o,r,i=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!==("undefined"==typeof t?"undefined":_typeof(t))||t instanceof RegExp)for(o=n.length;o--;)i.call(this,t,n[o]);else for(o in t)t.hasOwnProperty(o)&&(r=t[o])&&("function"==typeof r?i.call(this,o,r):l.call(this,o,r));return this},i.removeEvent=function(e){var t,n="undefined"==typeof e?"undefined":_typeof(e),o=this._getEvents();if("string"===n)delete o[e];else if(e instanceof RegExp)for(t in o)o.hasOwnProperty(t)&&e.test(t)&&delete o[t];else delete this._events;return this},i.removeAllListeners=r("removeEvent"),i.emitEvent=function(e,t){var n,o,r,i,l,s=this.getListenersAsObject(e);for(i in s)if(s.hasOwnProperty(i))for(n=s[i].slice(0),r=n.length;r--;)o=n[r],o.once===!0&&this.removeListener(e,o.listener),l=o.listener.apply(this,t||[]),l===this._getOnceReturnValue()&&this.removeListener(e,o.listener);return this},i.trigger=r("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"===("undefined"==typeof n?"undefined":_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":["_typeof","Symbol","iterator","obj","constructor","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","tinyMCE","each","./_designer.js","./_option.js","wolfy87-eventemitter","3","init","$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":"AAAA,YAEA,IAAIA,SAA4B,kBAAXC,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAX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WT,EAASA,SAASG,MAAMlH,KAAMsJ,OAErC9B,IAAaxH,KAAKyJ,uBACpBzJ,KAAKyI,eAAelB,EAAKR,EAASA,SAM1C,OAAO/G,OAMToH,EAAMtC,QAAUkC,EAAM,aAUtBI,EAAMsC,KAAO,SAAcnC,GACzB,GAAI+B,GAAOrB,MAAM1B,UAAUiD,MAAMpK,KAAK+H,UAAW,EACjD,OAAOnH,MAAKqJ,UAAU9B,EAAK+B,IAW7BlC,EAAMuC,mBAAqB,SAA4B1J,GAErD,MADAD,MAAK4J,iBAAmB3J,EACjBD,MAWToH,EAAMqC,oBAAsB,WAC1B,OAAIzJ,KAAK2H,eAAe,qBACf3H,KAAK4J,kBAYhBxC,EAAMK,WAAa,WACjB,MAAOzH,MAAKmJ,UAAYnJ,KAAKmJ,aAQ/BlG,EAAa4G,WAAa,WAExB,MADA1K,GAAQ8D,aAAeoE,EAChBpE,GAIa,kBAAX5E,IAAyBA,EAAOyL,IACzCzL,EAAO,WACL,MAAO4E,KAEoE,YAAjD,mBAAX1D,GAAyB,YAAczB,QAAQyB,KAAyBA,EAAOJ,QAChGI,EAAOJ,QAAU8D,EAEjB9D,EAAQ8D,aAAeA,IAExB7D,KAAKY,gBACK","file":"admin-script.min.js","sourcesContent":["\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n(function () {\n var require = undefined;var module = undefined;var exports = undefined;var define = undefined;(function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n 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;\n }var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {\n var n = t[o][1][e];return s(n ? n : e);\n }, l, l.exports, e, t, n, r);\n }return n[o].exports;\n }var i = typeof require == \"function\" && require;for (var o = 0; o < r.length; o++) {\n s(r[o]);\n }return s;\n })({ 1: [function (require, module, exports) {\n window.Boxzilla_Admin = require('./admin/_admin.js');\n }, { \"./admin/_admin.js\": 2 }], 2: [function (require, module, exports) {\n 'use strict';\n\n var $ = window.jQuery;\n var Option = require('./_option.js');\n var optionControls = document.getElementById('boxzilla-box-options-controls');\n var $optionControls = $(optionControls);\n\n // sanity check, are we on the correct page?\n if ($optionControls.length === 0) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter');\n var events = new EventEmitter();\n var Designer = require('./_designer.js')($, Option, events);\n var rowTemplate = wp.template('rule-row-template');\n var i18n = boxzilla_i18n;\n\n // events\n $optionControls.on('click', \".boxzilla-add-rule\", addRuleFields);\n $optionControls.on('click', \".boxzilla-remove-rule\", removeRule);\n $optionControls.on('change', \".boxzilla-rule-condition\", setContextualHelpers);\n $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);\n\n $(window).load(function () {\n if (typeof window.tinyMCE === \"undefined\") {\n document.getElementById('notice-notinymce').style.display = '';\n }\n });\n\n // call contextual helper method for each row\n $('.boxzilla-rule-row').each(setContextualHelpers);\n\n function toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n }\n\n function removeRule() {\n $(this).parents('tr').remove();\n }\n\n function setContextualHelpers() {\n\n var context = this.tagName.toLowerCase() === \"tr\" ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput);\n\n // remove previously added helpers\n $(context.querySelectorAll('.boxzilla-helper')).remove();\n\n // prepare better input\n betterInput.removeAttribute('name');\n betterInput.className = betterInput.className + ' boxzilla-helper';\n valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n $betterInput.change(function () {\n valueInput.value = this.value;\n });\n\n betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n\n // change placeholder for textual help\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_url':\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", { multiple: true, multipleSep: \",\" });\n break;\n }\n }\n\n function addRuleFields() {\n var data = {\n 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length\n };\n var html = rowTemplate(data);\n $(document.getElementById('boxzilla-box-rules')).after(html);\n return false;\n }\n\n module.exports = {\n 'Designer': Designer,\n 'Option': Option,\n 'events': events\n };\n }, { \"./_designer.js\": 3, \"./_option.js\": 4, \"wolfy87-eventemitter\": 5 }], 3: [function (require, module, exports) {\n var Designer = function Designer($, Option, events) {\n\n // vars\n var boxId = document.getElementById('post_ID').value || 0,\n $editor,\n $editorFrame,\n $innerEditor,\n options = {},\n visualEditorInitialised = false;\n\n var $appearanceControls = $(\"#boxzilla-box-appearance-controls\");\n\n // create Option objects\n options.borderColor = new Option('border-color');\n options.borderWidth = new Option('border-width');\n options.borderStyle = new Option('border-style');\n options.backgroundColor = new Option('background-color');\n options.width = new Option('width');\n options.color = new Option('color');\n\n // functions\n function init() {\n\n // Only run if TinyMCE has actually inited\n if (_typeof(window.tinyMCE) !== \"object\" || tinyMCE.get('content') === null) {\n return;\n }\n\n // add classes to TinyMCE <html>\n $editorFrame = $(\"#content_ifr\");\n $editor = $editorFrame.contents().find('html');\n $editor.css({\n 'background': 'white'\n });\n\n // add content class and padding to TinyMCE <body>\n $innerEditor = $editor.find('#tinymce');\n $innerEditor.addClass('boxzilla boxzilla-' + boxId);\n $innerEditor.css({\n 'margin': 0,\n 'background': 'white',\n 'display': 'inline-block',\n 'width': 'auto',\n 'min-width': '240px',\n 'position': 'relative'\n });\n $innerEditor.get(0).style.cssText += ';padding: 25px !important;';\n\n visualEditorInitialised = true;\n\n /* @since 2.0.3 */\n events.trigger('editor.init');\n }\n\n /**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n function applyStyles() {\n\n if (!visualEditorInitialised) {\n return false;\n }\n\n // apply styles from CSS editor\n $innerEditor.css({\n 'border-color': options.borderColor.getColorValue(), //getColorValue( 'borderColor', '' ),\n 'border-width': options.borderWidth.getPxValue(), //getPxValue( 'borderWidth', '' ),\n 'border-style': options.borderStyle.getValue(), //getValue('borderStyle', '' ),\n 'background-color': options.backgroundColor.getColorValue(), //getColorValue( 'backgroundColor', ''),\n 'width': options.width.getPxValue(), //getPxValue( 'width', 'auto' ),\n 'color': options.color.getColorValue() // getColorValue( 'color', '' )\n });\n\n /* @since 2.0.3 */\n events.trigger('editor.styles.apply');\n\n return true;\n }\n\n function resetStyles() {\n for (var key in options) {\n if (key.substring(0, 5) === 'theme') {\n continue;\n }\n\n options[key].clear();\n }\n applyStyles();\n\n /* @since 2.0.3 */\n events.trigger('editor.styles.reset');\n }\n\n // event binders\n $appearanceControls.find('input.boxzilla-color-field').wpColorPicker({ change: applyStyles, clear: applyStyles });\n $appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n events.on('editor.init', applyStyles);\n\n // public methods\n return {\n 'init': init,\n 'resetStyles': resetStyles,\n 'options': options\n };\n };\n\n module.exports = Designer;\n }, {}], 4: [function (require, module, exports) {\n 'use strict';\n\n var $ = window.jQuery;\n\n var Option = function Option(element) {\n\n // find corresponding element\n if (typeof element == \"string\") {\n element = document.getElementById('boxzilla-' + element);\n }\n\n if (!element) {\n console.error(\"Unable to find option element.\");\n }\n\n this.element = element;\n };\n\n Option.prototype.getColorValue = function () {\n if (this.element.value.length > 0) {\n if ($(this.element).hasClass('wp-color-field')) {\n return $(this.element).wpColorPicker('color');\n } else {\n return this.element.value;\n }\n }\n\n return '';\n };\n\n Option.prototype.getPxValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return parseInt(this.element.value) + \"px\";\n }\n\n return fallbackValue || '';\n };\n\n Option.prototype.getValue = function (fallbackValue) {\n\n if (this.element.value.length > 0) {\n return this.element.value;\n }\n\n return fallbackValue || '';\n };\n\n Option.prototype.clear = function () {\n this.element.value = '';\n };\n\n Option.prototype.setValue = function (value) {\n this.element.value = value;\n };\n\n module.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\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 } 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 === \"undefined\" ? \"undefined\" : _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 === \"undefined\" ? \"undefined\" : _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 } else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\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 === \"undefined\" ? \"undefined\" : _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 } 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 } 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 } 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 } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n module.exports = EventEmitter;\n } else {\n exports.EventEmitter = EventEmitter;\n }\n }).call(this);\n }, {}] }, {}, [1]);\n ;\n})();"],"sourceRoot":"/source/"}
1
+ {"version":3,"sources":["admin-script.js"],"names":["_typeof","Symbol","iterator","obj","constructor","prototype","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","tinyMCE","each","./_designer.js","./_option.js","wolfy87-eventemitter","3","init","$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","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":"AAAA,YAEA,IAAIA,SAA4B,kBAAXC,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,QAAUE,IAAQF,OAAOI,UAAY,eAAkBF,KAEtQ,WACE,GAAIG,GAAUC,OAA6DC,EAASD,QAAU,QAAUE,GAAEC,EAAGC,EAAGC,GAC9G,QAASC,GAAEC,EAAGC,GACZ,IAAKJ,EAAEG,GAAI,CACT,IAAKJ,EAAEI,GAAI,CACT,GAAIE,GAAsB,kBAAXV,IAAyBA,CAAQ,KAAKS,GAAKC,EAAG,MAAOA,GAAEF,GAAG,EAAI,IAAIG,EAAG,MAAOA,GAAEH,GAAG,EAAI,IAAII,GAAI,GAAIC,OAAM,uBAAyBL,EAAI,IAAK,MAAMI,GAAEE,KAAO,mBAAoBF,EAC5L,GAAIG,GA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qBACf1H,KAAK2J,kBAYhBxC,EAAMK,WAAa,WACjB,MAAOxH,MAAKkJ,UAAYlJ,KAAKkJ,aAQ/BjG,EAAa2G,WAAa,WAExB,MADAzK,GAAQ8D,aAAemE,EAChBnE,GAIa,kBAAX5E,IAAyBA,EAAOwL,IACzCxL,EAAO,WACL,MAAO4E,KAEoE,YAAjD,mBAAX1D,GAAyB,YAAc1B,QAAQ0B,KAAyBA,EAAOJ,QAChGI,EAAOJ,QAAU8D,EAEjB9D,EAAQ8D,aAAeA,IAExB7D,KAAKY,gBACK","file":"admin-script.min.js","sourcesContent":["\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n(function () {\n var require = undefined;var module = undefined;var exports = undefined;var define = undefined;(function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n 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;\n }var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {\n var n = t[o][1][e];return s(n ? n : e);\n }, l, l.exports, e, t, n, r);\n }return n[o].exports;\n }var i = typeof require == \"function\" && require;for (var o = 0; o < r.length; o++) {\n s(r[o]);\n }return s;\n })({ 1: [function (require, module, exports) {\n window.Boxzilla_Admin = require('./admin/_admin.js');\n }, { \"./admin/_admin.js\": 2 }], 2: [function (require, module, exports) {\n 'use strict';\n\n var $ = window.jQuery;\n var Option = require('./_option.js');\n var optionControls = document.getElementById('boxzilla-box-options-controls');\n var $optionControls = $(optionControls);\n\n // sanity check, are we on the correct page?\n if ($optionControls.length === 0) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter');\n var events = new EventEmitter();\n var Designer = require('./_designer.js')($, Option, events);\n var rowTemplate = wp.template('rule-row-template');\n var i18n = boxzilla_i18n;\n\n // events\n $optionControls.on('click', \".boxzilla-add-rule\", addRuleFields);\n $optionControls.on('click', \".boxzilla-remove-rule\", removeRule);\n $optionControls.on('change', \".boxzilla-rule-condition\", setContextualHelpers);\n $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);\n\n $(window).load(function () {\n if (typeof window.tinyMCE === \"undefined\") {\n document.getElementById('notice-notinymce').style.display = '';\n }\n });\n\n // call contextual helper method for each row\n $('.boxzilla-rule-row').each(setContextualHelpers);\n\n function toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n }\n\n function removeRule() {\n $(this).parents('tr').remove();\n }\n\n function setContextualHelpers() {\n\n var context = this.tagName.toLowerCase() === \"tr\" ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput);\n\n // remove previously added helpers\n $(context.querySelectorAll('.boxzilla-helper')).remove();\n\n // prepare better input\n betterInput.removeAttribute('name');\n betterInput.className = betterInput.className + ' boxzilla-helper';\n valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n $betterInput.change(function () {\n valueInput.value = this.value;\n });\n\n betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n\n // change placeholder for textual help\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_url':\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", { multiple: true, multipleSep: \",\" });\n break;\n }\n }\n\n function addRuleFields() {\n var data = {\n 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length\n };\n var html = rowTemplate(data);\n $(document.getElementById('boxzilla-box-rules')).after(html);\n return false;\n }\n\n module.exports = {\n 'Designer': Designer,\n 'Option': Option,\n 'events': events\n };\n }, { \"./_designer.js\": 3, \"./_option.js\": 4, \"wolfy87-eventemitter\": 5 }], 3: [function (require, module, exports) {\n var Designer = function Designer($, Option, events) {\n\n // vars\n var boxId = document.getElementById('post_ID').value || 0,\n $editor,\n $editorFrame,\n $innerEditor,\n options = {},\n visualEditorInitialised = false;\n\n var $appearanceControls = $(\"#boxzilla-box-appearance-controls\");\n\n // create Option objects\n options.borderColor = new Option('border-color');\n options.borderWidth = new Option('border-width');\n options.borderStyle = new Option('border-style');\n options.backgroundColor = new Option('background-color');\n options.width = new Option('width');\n options.color = new Option('color');\n\n // functions\n function init() {\n\n // Only run if TinyMCE has actually inited\n if (_typeof(window.tinyMCE) !== \"object\" || tinyMCE.get('content') === null) {\n return;\n }\n\n // add classes to TinyMCE <html>\n $editorFrame = $(\"#content_ifr\");\n $editor = $editorFrame.contents().find('html');\n $editor.css({\n 'background': 'white'\n });\n\n // add content class and padding to TinyMCE <body>\n $innerEditor = $editor.find('#tinymce');\n $innerEditor.addClass('boxzilla boxzilla-' + boxId);\n $innerEditor.css({\n 'margin': 0,\n 'background': 'white',\n 'display': 'inline-block',\n 'width': 'auto',\n 'min-width': '240px',\n 'position': 'relative'\n });\n $innerEditor.get(0).style.cssText += ';padding: 25px !important;';\n\n visualEditorInitialised = true;\n\n /* @since 2.0.3 */\n events.trigger('editor.init');\n }\n\n /**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n function applyStyles() {\n\n if (!visualEditorInitialised) {\n return false;\n }\n\n // apply styles from CSS editor\n $innerEditor.css({\n 'border-color': options.borderColor.getColorValue(), //getColorValue( 'borderColor', '' ),\n 'border-width': options.borderWidth.getPxValue(), //getPxValue( 'borderWidth', '' ),\n 'border-style': options.borderStyle.getValue(), //getValue('borderStyle', '' ),\n 'background-color': options.backgroundColor.getColorValue(), //getColorValue( 'backgroundColor', ''),\n 'width': options.width.getPxValue(), //getPxValue( 'width', 'auto' ),\n 'color': options.color.getColorValue() // getColorValue( 'color', '' )\n });\n\n /* @since 2.0.3 */\n events.trigger('editor.styles.apply');\n\n return true;\n }\n\n function resetStyles() {\n for (var key in options) {\n if (key.substring(0, 5) === 'theme') {\n continue;\n }\n\n options[key].clear();\n }\n applyStyles();\n\n /* @since 2.0.3 */\n events.trigger('editor.styles.reset');\n }\n\n // event binders\n $appearanceControls.find('input.boxzilla-color-field').wpColorPicker({ change: applyStyles, clear: applyStyles });\n $appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n events.on('editor.init', applyStyles);\n\n // public methods\n return {\n 'init': init,\n 'resetStyles': resetStyles,\n 'options': options\n };\n };\n\n module.exports = Designer;\n }, {}], 4: [function (require, module, exports) {\n 'use strict';\n\n var $ = window.jQuery;\n\n var Option = function Option(element) {\n\n // find corresponding element\n if (typeof element == \"string\") {\n element = document.getElementById('boxzilla-' + element);\n }\n\n if (!element) {\n console.error(\"Unable to find option element.\");\n }\n\n this.element = element;\n };\n\n Option.prototype.getColorValue = function () {\n if (this.element.value.length > 0) {\n if ($(this.element).hasClass('wp-color-field')) {\n return $(this.element).wpColorPicker('color');\n } else {\n return this.element.value;\n }\n }\n\n return '';\n };\n\n Option.prototype.getPxValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return parseInt(this.element.value) + \"px\";\n }\n\n return fallbackValue || '';\n };\n\n Option.prototype.getValue = function (fallbackValue) {\n\n if (this.element.value.length > 0) {\n return this.element.value;\n }\n\n return fallbackValue || '';\n };\n\n Option.prototype.clear = function () {\n this.element.value = '';\n };\n\n Option.prototype.setValue = function (value) {\n this.element.value = value;\n };\n\n module.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\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 } 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 === \"undefined\" ? \"undefined\" : _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 === \"undefined\" ? \"undefined\" : _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 } else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\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 === \"undefined\" ? \"undefined\" : _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 } 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 } 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 } 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 } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n module.exports = EventEmitter;\n } else {\n exports.EventEmitter = EventEmitter;\n }\n }).call(this);\n }, {}] }, {}, [1]);\n ;\n})();"]}
assets/js/script.js CHANGED
@@ -20,8 +20,10 @@ for( var i=0; i < options.boxes.length; 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
@@ -453,6 +455,7 @@ Box.prototype.toggle = function(show) {
453
 
454
  // show or hide box using selected animation
455
  if( this.config.position === 'center' ) {
 
456
  Animator.toggle(this.overlay, "fade");
457
  }
458
 
@@ -825,6 +828,7 @@ Boxzilla.init = function() {
825
  document.body.appendChild(overlay);
826
 
827
  // event binds
 
828
  window.addEventListener('scroll', throttle(checkHeightCriteria));
829
  window.addEventListener('resize', throttle(recalculateHeights));
830
  window.addEventListener('load', recalculateHeights );
@@ -914,7 +918,7 @@ if ( typeof module !== 'undefined' && module.exports ) {
914
  module.exports = Boxzilla;
915
  }
916
  },{"./box.js":3,"./styles.js":5,"./timer.js":6,"wolfy87-eventemitter":7}],5:[function(require,module,exports){
917
- const styles = `body{-webkit-overflow-scrolling:touch!important}#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}`;
918
  module.exports = styles;
919
  },{}],6:[function(require,module,exports){
920
  'use strict';
20
  boxOpts.testMode = isLoggedIn && options.testMode;
21
 
22
  // fix http:// links in box content....
23
+ if( window.location.protocol === "https:" && window.location.host ) {
24
+ var o = "http://" + window.location.host;
25
+ var n = old.replace('http://', 'https://');
26
+ boxOpts.content = boxOpts.content.replace(o, n);
27
  }
28
 
29
  // create box
455
 
456
  // show or hide box using selected animation
457
  if( this.config.position === 'center' ) {
458
+ this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');
459
  Animator.toggle(this.overlay, "fade");
460
  }
461
 
828
  document.body.appendChild(overlay);
829
 
830
  // event binds
831
+ window.addEventListener('touchmove', throttle(checkHeightCriteria));
832
  window.addEventListener('scroll', throttle(checkHeightCriteria));
833
  window.addEventListener('resize', throttle(recalculateHeights));
834
  window.addEventListener('load', recalculateHeights );
918
  module.exports = Boxzilla;
919
  }
920
  },{"./box.js":3,"./styles.js":5,"./timer.js":6,"wolfy87-eventemitter":7}],5:[function(require,module,exports){
921
+ const styles = `#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}`;
922
  module.exports = styles;
923
  },{}],6:[function(require,module,exports){
924
  'use strict';
assets/js/script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};!function(){var e=void 0,t=void 0;!function i(t,n,o){function r(a,l){if(!n[a]){if(!t[a]){var c="function"==typeof e&&e;if(!l&&c)return c(a,!0);if(s)return s(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var f=n[a]={exports:{}};t[a][0].call(f.exports,function(e){var i=t[a][1][e];return r(i?i:e)},f,f.exports,i,t,n,o)}return n[a].exports}for(var s="function"==typeof e&&e,a=0;a<o.length;a++)r(o[a]);return r}({1:[function(e,t,i){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 a=0;a<r.boxes.length;a++){var l=r.boxes[a];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 c=o.create(l.id,l);n(c.element,l.css),c.element.firstChild.firstChild.className+=" first-child",c.element.firstChild.lastChild.className+=" last-child"}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:4}],2:[function(e,t,i){function n(e,t){for(var i in t)e.style[i]=t[i]}function o(e,t){for(var i={},n=0;n<e.length;n++)i[e[n]]=t;return i}function r(e,t){for(var i={},n=0;n<e.length;n++)i[e[n]]=t[e[n]];return i}function s(e){return!!e.getAttribute("data-animated")}function a(e,t){var i="none"!=e.style.display||e.offsetLeft>0,s=e.cloneNode(!0),a=function(){e.removeAttribute("data-animated"),e.setAttribute("style",s.getAttribute("style")),e.style.display=i?"none":""};e.setAttribute("data-animated","true"),i||(e.style.display="");var c,d;if("slide"===t){if(c=o(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),d={},!i){var f=window.getComputedStyle(e);d=r(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f),n(e,c)}e.style.overflowY="hidden",l(e,i?c:d,a)}else c={opacity:0},d={opacity:1},i||n(e,c),l(e,i?c:d,a)}function l(e,t,i){var n=+new Date,o=window.getComputedStyle(e),r={},s={};for(var a in t){t[a]=parseFloat(t[a]);var l=t[a],d=parseFloat(o[a]);d!=l?(s[a]=(l-d)/c,r[a]=d):delete t[a]}var f=function h(){var o,a,l,c,d=+new Date,f=d-n,u=!0;for(var g in t){o=s[g],a=t[g],l=o*f,c=r[g]+l,o>0&&c>=a||o<0&&c<=a?c=a:u=!1,r[g]=c;var p="opacity"!==g?"px":"";e.style[g]=c+p}n=+new Date,u?i&&i():window.requestAnimationFrame&&requestAnimationFrame(h)||setTimeout(h,32)};f()}var c=320;t.exports={toggle:a,animate:l,animated:s}},{}],3:[function(e,t,i){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}function o(){var e=document.body,t=document.documentElement,i=Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight);return i}var r,s={animation:"fade",rehide:!1,content:"",cookie:null,icon:"&times",minimumScreenWidth:0,position:"center",testMode:!1,trigger:!1,closable:!0},a=e("./animator.js"),l=function(e,t){this.id=e,this.config=n(s,t),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=0,this.cookieSet=!1,this.element=null,this.closeIcon=null,this.config.trigger&&("percentage"!==this.config.trigger.method&&"element"!==this.config.trigger.method||(this.triggerHeight=this.calculateTriggerHeight()),this.cookieSet=this.isCookieSet()),this.dom(),this.events()};l.prototype.events=function(){var e=this;this.closeIcon&&this.closeIcon.addEventListener("click",e.dismiss.bind(this)),this.element.addEventListener("click",function(t){"A"===t.target.tagName&&r.trigger("box.interactions.link",[e,t.target])},!1),this.element.addEventListener("submit",function(t){e.setCookie(),r.trigger("box.interactions.form",[e,t.target])},!1),window.addEventListener("hashchange",function(){var t="#boxzilla-"+e.id;location.hash===t&&e.toggle()}),this.fits()&&this.locationHashRefersBox()&&window.addEventListener("load",this.show.bind(this))},l.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"),r=0;r<n.length;r++)o.appendChild(document.createTextNode(n[r].text)),n[r].parentNode.removeChild(n[r]);document.body.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),this.closeIcon=s}document.body.appendChild(e),this.element=t},l.prototype.setCustomBoxStyling=function(){var e=this.element.style.display;this.element.style.display="",this.element.style.overflowY="auto",this.element.style.maxHeight="none";var t=window.innerHeight,i=this.element.clientHeight;if(i>t&&(this.element.style.maxHeight=t+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(t-i)/2;n=n>=0?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=e},l.prototype.toggle=function(e){if("undefined"==typeof e&&(e=!this.visible),e===this.visible)return!1;if(a.animated(this.element))return!1;if(!e&&!this.config.closable)return!1;this.visible=e,this.setCustomBoxStyling(),r.trigger("box."+(e?"show":"hide"),[this]),"center"===this.config.position&&a.toggle(this.overlay,"fade"),a.toggle(this.element,this.config.animation);var t=this.element.querySelector("input, textarea");return t&&t.focus(),!0},l.prototype.show=function(){return this.toggle(!0)},l.prototype.hide=function(){return this.toggle(!1)},l.prototype.calculateTriggerHeight=function(){var e=0;if("element"===this.config.trigger.method){var t=document.body.querySelector(this.config.trigger.value);if(t){var i=t.getBoundingClientRect();e=i.top}}else"percentage"===this.config.trigger.method&&(e=this.config.trigger.value/100*o());return e},l.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)},l.prototype.fits=function(){return this.config.minimumScreenWidth<=0||window.innerWidth>this.config.minimumScreenWidth},l.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},l.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},l.prototype.isCookieSet=function(){if(this.config.testMode)return!1;if(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)return!1;var e="true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1");return e},l.prototype.setCookie=function(e){var t=new Date;t.setHours(t.getHours()+e),document.cookie="boxzilla_box_"+this.id+"=true; expires="+t.toUTCString()+"; path=/"},l.prototype.trigger=function(){var e=this.show();e&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},l.prototype.dismiss=function(e){return e&&e.preventDefault(),!!this.visible&&(this.hide(),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,r.trigger("box.dismiss",[this]),!0)},t.exports=function(e){return r=e,l}},{"./animator.js":2}],4:[function(e,t,i){function n(e,t,i){t||(t=250);var n,o;return function(){var r=i||this,s=+new Date,a=arguments;n&&s<n+t?(clearTimeout(o),o=setTimeout(function(){n=s,e.apply(r,a)},t)):(n=s,e.apply(r,a))}}function o(e){27==e.keyCode&&x.dismiss()}function r(){h()||_.forEach(function(e){e.mayAutoShow()&&"pageviews"===e.config.trigger.method&&b>=e.config.trigger.value&&e.trigger()})}function s(){h()||_.forEach(function(e){e.mayAutoShow()&&("time_on_site"===e.config.trigger.method&&v.time>=e.config.trigger.value&&e.trigger(),"time_on_page"===e.config.trigger.method&&y.time>=e.config.trigger.value&&e.trigger())})}function a(){var e=(window.scrollY||window.pageYOffset)+.75*window.innerHeight;_.forEach(function(t){if(t.mayAutoShow()&&!(t.triggerHeight<=0))if(e>t.triggerHeight){if(h())return;t.trigger()}else t.mayRehide()&&t.hide()})}function l(){_.forEach(function(e){e.setCustomBoxStyling()})}function c(e){var t=e.offsetX,i=e.offsetY;_.forEach(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 d(){m||h()||(_.forEach(function(e){e.mayAutoShow()&&"exit_intent"===e.config.trigger.method&&e.trigger()}),m=!0)}function f(e){var t=400;e.clientY<=0&&(p=window.setTimeout(d,t))}function h(){for(var e=0;e<_.length;e++){var t=_[e];if(t.visible)return!0}return!1}function u(){p&&(window.clearInterval(p),p=null)}if(!window.Boxzilla){var g,p,m,v,y,b,w=e("wolfy87-eventemitter"),x=Object.create(w.prototype),E=e("./box.js")(x),z=e("./timer.js"),_=[],L={start:function(){var e=sessionStorage.getItem("boxzilla_timer");e&&(v.time=e),v.start(),y.start()},stop:function(){sessionStorage.setItem("boxzilla_timer",v.time),v.stop(),y.stop()}};x.init=function(){v=new z(sessionStorage.getItem("boxzilla_timer")||0),y=new z(0),b=sessionStorage.getItem("boxzilla_pageviews")||0;var t=e("./styles.js"),i=document.createElement("style");i.setAttribute("type","text/css"),i.innerHTML=t,document.head.appendChild(i),g=document.createElement("div"),g.style.display="none",g.id="boxzilla-overlay",document.body.appendChild(g),window.addEventListener("scroll",n(a)),window.addEventListener("resize",n(l)),window.addEventListener("load",l),g.addEventListener("click",c),window.setInterval(s,1e3),window.setTimeout(r,1e3),document.documentElement.addEventListener("mouseleave",f),document.documentElement.addEventListener("mouseenter",u),document.addEventListener("keyup",o),L.start(),window.addEventListener("focus",L.start),window.addEventListener("beforeunload",function(){L.stop(),sessionStorage.setItem("boxzilla_pageviews",++b)}),window.addEventListener("blur",L.stop),x.trigger("ready")},x.create=function(e,t){var i=new E(e,t);return _.push(i),i},x.get=function(e){for(var t=0;t<_.length;t++){var i=_[t];if(i.id==e)return i}throw new Error("No box exists with ID "+e)},x.dismiss=function(e){"undefined"==typeof e?_.forEach(function(e){e.dismiss()}):"object"===_typeof(_[e])&&x.get(e).dismiss()},x.hide=function(e){"undefined"==typeof e?_.forEach(function(e){e.hide()}):x.get(e).hide()},x.show=function(e){"undefined"==typeof e?_.forEach(function(e){e.show()}):x.get(e).show()},x.toggle=function(e){"undefined"==typeof e?_.forEach(function(e){e.toggle()}):x.get(e).toggle()},x.boxes=_,window.Boxzilla=x,"undefined"!=typeof t&&t.exports&&(t.exports=x)}},{"./box.js":3,"./styles.js":5,"./timer.js":6,"wolfy87-eventemitter":7}],5:[function(e,t,i){var n="body{-webkit-overflow-scrolling:touch!important}#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}";t.exports=n},{}],6:[function(e,t,i){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(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},t.exports=n},{}],7:[function(e,i,n){(function(){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,a=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"===("undefined"==typeof t?"undefined":_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"!==("undefined"==typeof t?"undefined":_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="undefined"==typeof e?"undefined":_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,a=this.getListenersAsObject(e);for(r in a)if(a.hasOwnProperty(r))for(i=a[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=a,e},"function"==typeof t&&t.amd?t(function(){return e}):"object"===("undefined"==typeof i?"undefined":_typeof(i))&&i.exports?i.exports=e:s.EventEmitter=e}).call(this)},{}]},{},[1])}();
2
  //# sourceMappingURL=script.min.js.map
1
+ "use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){var t=void 0,e=void 0;!function i(e,n,o){function r(a,l){if(!n[a]){if(!e[a]){var c="function"==typeof t&&t;if(!l&&c)return c(a,!0);if(s)return s(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var i=e[a][1][t];return r(i?i:t)},f,f.exports,i,e,n,o)}return n[a].exports}for(var s="function"==typeof t&&t,a=0;a<o.length;a++)r(o[a]);return r}({1:[function(t,e,i){function n(t,e){e.background_color&&(t.style.background=e.background_color),e.color&&(t.style.color=e.color),e.border_color&&(t.style.borderColor=e.border_color),e.border_width&&(t.style.borderWidth=parseInt(e.border_width)+"px"),e.border_style&&(t.style.borderStyle=e.border_style),e.width&&(t.style.maxWidth=parseInt(e.width)+"px")}var o=t("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 a=0;a<r.boxes.length;a++){var l=r.boxes[a];if(l.testMode=s&&r.testMode,"https:"===window.location.protocol&&window.location.host){var c="http://"+window.location.host,d=old.replace("http://","https://");l.content=l.content.replace(c,d)}var f=o.create(l.id,l);n(f.element,l.css),f.element.firstChild.firstChild.className+=" first-child",f.element.firstChild.lastChild.className+=" last-child"}window.addEventListener("load",function(){if("object"===_typeof(window.mc4wp_forms_config)&&window.mc4wp_forms_config.submitted_form){var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=o.boxes;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n.element.querySelector(t))return void n.show()}}}),window.Boxzilla=o},{boxzilla:4}],2:[function(t,e,i){function n(t,e){for(var i in e)t.style[i]=e[i]}function o(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}function r(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}function s(t){return!!t.getAttribute("data-animated")}function a(t,e){var i="none"!=t.style.display||t.offsetLeft>0,s=t.cloneNode(!0),a=function(){t.removeAttribute("data-animated"),t.setAttribute("style",s.getAttribute("style")),t.style.display=i?"none":""};t.setAttribute("data-animated","true"),i||(t.style.display="");var c,d;if("slide"===e){if(c=o(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),d={},!i){var f=window.getComputedStyle(t);d=r(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f),n(t,c)}t.style.overflowY="hidden",l(t,i?c:d,a)}else c={opacity:0},d={opacity:1},i||n(t,c),l(t,i?c:d,a)}function l(t,e,i){var n=+new Date,o=window.getComputedStyle(t),r={},s={};for(var a in e){e[a]=parseFloat(e[a]);var l=e[a],d=parseFloat(o[a]);d!=l?(s[a]=(l-d)/c,r[a]=d):delete e[a]}var f=function h(){var o,a,l,c,d=+new Date,f=d-n,u=!0;for(var g in e){o=s[g],a=e[g],l=o*f,c=r[g]+l,o>0&&c>=a||o<0&&c<=a?c=a:u=!1,r[g]=c;var p="opacity"!==g?"px":"";t.style[g]=c+p}n=+new Date,u?i&&i():window.requestAnimationFrame&&requestAnimationFrame(h)||setTimeout(h,32)};f()}var c=320;e.exports={toggle:a,animate:l,animated:s}},{}],3:[function(t,e,i){function n(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i}function o(){var t=document.body,e=document.documentElement,i=Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight);return i}var r,s={animation:"fade",rehide:!1,content:"",cookie:null,icon:"&times",minimumScreenWidth:0,position:"center",testMode:!1,trigger:!1,closable:!0},a=t("./animator.js"),l=function(t,e){this.id=t,this.config=n(s,e),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=0,this.cookieSet=!1,this.element=null,this.closeIcon=null,this.config.trigger&&("percentage"!==this.config.trigger.method&&"element"!==this.config.trigger.method||(this.triggerHeight=this.calculateTriggerHeight()),this.cookieSet=this.isCookieSet()),this.dom(),this.events()};l.prototype.events=function(){var t=this;this.closeIcon&&this.closeIcon.addEventListener("click",t.dismiss.bind(this)),this.element.addEventListener("click",function(e){"A"===e.target.tagName&&r.trigger("box.interactions.link",[t,e.target])},!1),this.element.addEventListener("submit",function(e){t.setCookie(),r.trigger("box.interactions.form",[t,e.target])},!1),window.addEventListener("hashchange",function(){var e="#boxzilla-"+t.id;location.hash===e&&t.toggle()}),this.fits()&&this.locationHashRefersBox()&&window.addEventListener("load",this.show.bind(this))},l.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e=document.createElement("div");e.setAttribute("id","boxzilla-"+this.id),e.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,e.style.display="none",t.appendChild(e);var i=document.createElement("div");i.className="boxzilla-content",i.innerHTML=this.config.content,e.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.body.appendChild(o)}if(this.config.closable&&this.config.icon){var s=document.createElement("span");s.className="boxzilla-close-icon",s.innerHTML=this.config.icon,e.appendChild(s),this.closeIcon=s}document.body.appendChild(t),this.element=e},l.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="auto",this.element.style.maxHeight="none";var e=window.innerHeight,i=this.element.clientHeight;if(i>e&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(e-i)/2;n=n>=0?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=t},l.prototype.toggle=function(t){if("undefined"==typeof t&&(t=!this.visible),t===this.visible)return!1;if(a.animated(this.element))return!1;if(!t&&!this.config.closable)return!1;this.visible=t,this.setCustomBoxStyling(),r.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),a.toggle(this.overlay,"fade")),a.toggle(this.element,this.config.animation);var e=this.element.querySelector("input, textarea");return e&&e.focus(),!0},l.prototype.show=function(){return this.toggle(!0)},l.prototype.hide=function(){return this.toggle(!1)},l.prototype.calculateTriggerHeight=function(){var t=0;if("element"===this.config.trigger.method){var e=document.body.querySelector(this.config.trigger.value);if(e){var i=e.getBoundingClientRect();t=i.top}}else"percentage"===this.config.trigger.method&&(t=this.config.trigger.value/100*o());return t},l.prototype.locationHashRefersBox=function(){if(!window.location.hash||0===window.location.hash.length)return!1;var t=window.location.hash.substring(1);return t===this.element.id||!!this.element.querySelector("#"+t)},l.prototype.fits=function(){return this.config.minimumScreenWidth<=0||window.innerWidth>this.config.minimumScreenWidth},l.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},l.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},l.prototype.isCookieSet=function(){if(this.config.testMode)return!1;if(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)return!1;var t="true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1");return t},l.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},l.prototype.trigger=function(){var t=this.show();t&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},l.prototype.dismiss=function(t){return t&&t.preventDefault(),!!this.visible&&(this.hide(),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,r.trigger("box.dismiss",[this]),!0)},e.exports=function(t){return r=t,l}},{"./animator.js":2}],4:[function(t,e,i){function n(t,e,i){e||(e=250);var n,o;return function(){var r=i||this,s=+new Date,a=arguments;n&&s<n+e?(clearTimeout(o),o=setTimeout(function(){n=s,t.apply(r,a)},e)):(n=s,t.apply(r,a))}}function o(t){27==t.keyCode&&x.dismiss()}function r(){h()||_.forEach(function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&b>=t.config.trigger.value&&t.trigger()})}function s(){h()||_.forEach(function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&v.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&y.time>=t.config.trigger.value&&t.trigger())})}function a(){var t=(window.scrollY||window.pageYOffset)+.75*window.innerHeight;_.forEach(function(e){if(e.mayAutoShow()&&!(e.triggerHeight<=0))if(t>e.triggerHeight){if(h())return;e.trigger()}else e.mayRehide()&&e.hide()})}function l(){_.forEach(function(t){t.setCustomBoxStyling()})}function c(t){var e=t.offsetX,i=t.offsetY;_.forEach(function(t){var n=t.element.getBoundingClientRect(),o=100+.05*window.innerWidth;(e<n.left-o||e>n.right+o||i<n.top-o||i>n.bottom+o)&&t.dismiss()})}function d(){m||h()||(_.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()}),m=!0)}function f(t){var e=400;t.clientY<=0&&(p=window.setTimeout(d,e))}function h(){for(var t=0;t<_.length;t++){var e=_[t];if(e.visible)return!0}return!1}function u(){p&&(window.clearInterval(p),p=null)}if(!window.Boxzilla){var g,p,m,v,y,b,w=t("wolfy87-eventemitter"),x=Object.create(w.prototype),E=t("./box.js")(x),z=t("./timer.js"),_=[],L={start:function(){var t=sessionStorage.getItem("boxzilla_timer");t&&(v.time=t),v.start(),y.start()},stop:function(){sessionStorage.setItem("boxzilla_timer",v.time),v.stop(),y.stop()}};x.init=function(){v=new z(sessionStorage.getItem("boxzilla_timer")||0),y=new z(0),b=sessionStorage.getItem("boxzilla_pageviews")||0;var e=t("./styles.js"),i=document.createElement("style");i.setAttribute("type","text/css"),i.innerHTML=e,document.head.appendChild(i),g=document.createElement("div"),g.style.display="none",g.id="boxzilla-overlay",document.body.appendChild(g),window.addEventListener("touchmove",n(a)),window.addEventListener("scroll",n(a)),window.addEventListener("resize",n(l)),window.addEventListener("load",l),g.addEventListener("click",c),window.setInterval(s,1e3),window.setTimeout(r,1e3),document.documentElement.addEventListener("mouseleave",f),document.documentElement.addEventListener("mouseenter",u),document.addEventListener("keyup",o),L.start(),window.addEventListener("focus",L.start),window.addEventListener("beforeunload",function(){L.stop(),sessionStorage.setItem("boxzilla_pageviews",++b)}),window.addEventListener("blur",L.stop),x.trigger("ready")},x.create=function(t,e){var i=new E(t,e);return _.push(i),i},x.get=function(t){for(var e=0;e<_.length;e++){var i=_[e];if(i.id==t)return i}throw new Error("No box exists with ID "+t)},x.dismiss=function(t){"undefined"==typeof t?_.forEach(function(t){t.dismiss()}):"object"===_typeof(_[t])&&x.get(t).dismiss()},x.hide=function(t){"undefined"==typeof t?_.forEach(function(t){t.hide()}):x.get(t).hide()},x.show=function(t){"undefined"==typeof t?_.forEach(function(t){t.show()}):x.get(t).show()},x.toggle=function(t){"undefined"==typeof t?_.forEach(function(t){t.toggle()}):x.get(t).toggle()},x.boxes=_,window.Boxzilla=x,"undefined"!=typeof e&&e.exports&&(e.exports=x)}},{"./box.js":3,"./styles.js":5,"./timer.js":6,"wolfy87-eventemitter":7}],5:[function(t,e,i){var n="#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}";e.exports=n},{}],6:[function(t,e,i){var n=function(t){this.time=t,this.interval=0};n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}],7:[function(t,i,n){(function(){function t(){}function n(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}var r=t.prototype,s=this,a=s.EventEmitter;r.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp){e={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},r.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},r.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},r.addListener=function(t,e){var i,o=this.getListenersAsObject(t),r="object"===("undefined"==typeof e?"undefined":_typeof(e));for(i in o)o.hasOwnProperty(i)&&n(o[i],e)===-1&&o[i].push(r?e:{listener:e,once:!1});return this},r.on=o("addListener"),r.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},r.once=o("addOnceListener"),r.defineEvent=function(t){return this.getListeners(t),this},r.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},r.removeListener=function(t,e){var i,o,r=this.getListenersAsObject(t);for(o in r)r.hasOwnProperty(o)&&(i=n(r[o],e),i!==-1&&r[o].splice(i,1));return this},r.off=o("removeListener"),r.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},r.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},r.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!==("undefined"==typeof e?"undefined":_typeof(e))||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},r.removeEvent=function(t){var e,i="undefined"==typeof t?"undefined":_typeof(t),n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},r.removeAllListeners=o("removeEvent"),r.emitEvent=function(t,e){var i,n,o,r,s,a=this.getListenersAsObject(t);for(r in a)if(a.hasOwnProperty(r))for(i=a[r].slice(0),o=i.length;o--;)n=i[o],n.once===!0&&this.removeListener(t,n.listener),s=n.listener.apply(this,e||[]),s===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},r.trigger=o("emitEvent"),r.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},r.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},r._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},r._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return s.EventEmitter=a,t},"function"==typeof e&&e.amd?e(function(){return t}):"object"===("undefined"==typeof i?"undefined":_typeof(i))&&i.exports?i.exports=t:s.EventEmitter=t}).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":["_typeof","Symbol","iterator","obj","constructor","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","firstChild","lastChild","addEventListener","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","querySelector","show","boxzilla","2","property","initObjectProperties","properties","value","newObject","copyObjectProperties","object","animated","getAttribute","toggle","animation","nowVisible","display","offsetLeft","clone","cloneNode","cleanup","removeAttribute","setAttribute","hiddenStyles","visibleStyles","computedStyles","getComputedStyle","overflowY","animate","opacity","targetStyles","fn","last","Date","initialStyles","currentStyles","propSteps","parseFloat","to","current","duration","tick","step","increment","newValue","now","timeSinceLastTick","done","suffix","requestAnimationFrame","setTimeout","3","merge","obj1","obj2","obj3","attrname","getDocumentHeight","html","documentElement","height","Math","max","scrollHeight","offsetHeight","clientHeight","defaults","rehide","cookie","icon","minimumScreenWidth","position","trigger","closable","Animator","Box","config","this","overlay","getElementById","visible","dismissed","triggered","triggerHeight","cookieSet","closeIcon","method","calculateTriggerHeight","isCookieSet","dom","events","prototype","dismiss","bind","target","tagName","setCookie","needle","hash","fits","locationHashRefersBox","wrapper","createElement","appendChild","innerHTML","scripts","querySelectorAll","script","createTextNode","text","parentNode","removeChild","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","newTopMargin","marginTop","firstInput","focus","hide","triggerElement","offset","getBoundingClientRect","top","elementId","innerWidth","mayAutoShow","mayRehide","RegExp","hours","expiryDate","setHours","getHours","toUTCString","shown","preventDefault","_Boxzilla","./animator.js","4","throttle","threshhold","scope","deferTimer","context","args","arguments","clearTimeout","apply","onKeyUp","keyCode","checkPageViewsCriteria","isAnyBoxVisible","forEach","pageViews","checkTimeCriteria","siteTimer","time","pageTimer","checkHeightCriteria","scrollY","pageYOffset","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","margin","left","right","bottom","triggerExitIntent","exitIntentTriggered","onMouseLeave","delay","clientY","exitIntentDelayTimer","onMouseEnter","clearInterval","EventEmitter","Object","Timer","timers","start","sessionTime","sessionStorage","getItem","stop","setItem","styleElement","head","setInterval","opts","push","get","./box.js","./styles.js","./timer.js","wolfy87-eventemitter","5","6","interval","7","indexOfListener","listeners","listener","alias","name","proto","originalGlobalValue","getListeners","evt","response","key","_getEvents","test","flattenListeners","flatListeners","getListenersAsObject","Array","addListener","listenerIsWrapped","once","on","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":"AAAA,YAEA,IAAIA,SAA4B,kBAAXC,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,OAAS,eAAkBE,KAE1O,WACI,GAAIE,GAAUC,OAA6DC,EAASD,QAAU,QAAUE,GAAEC,EAAGC,EAAGC,GAC5G,QAASC,GAAEC,EAAGC,GACV,IAAKJ,EAAEG,GAAI,CACP,IAAKJ,EAAEI,GAAI,CACP,GAAIE,GAAsB,kBAAXV,IAAyBA,CAAQ,KAAKS,GAAKC,EAAG,MAAOA,GAAEF,GAAG,EAAI,IAAIG,EAAG,MAAOA,GAAEH,GAAG,EAAI,IAAII,GAAI,GAAIC,OAAM,uBAAyBL,EAAI,IAAK,M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AQ4O,aAAe8B,EAChB9B,GAIW,kBAAX1P,IAAyBA,EAAOiU,IACvCjU,EAAO,WACH,MAAO0P,KAEgE,YAAjD,mBAAXxO,GAAyB,YAAczB,QAAQyB,KAAyBA,EAAOJ,QAC9FI,EAAOJ,QAAU4O,EAEjB5O,EAAQ4O,aAAeA,IAE5B3O,KAAKiI,gBACG","file":"script.min.js","sourcesContent":["\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n(function () {\n var require = undefined;var module = undefined;var exports = undefined;var define = undefined;(function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n 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;\n }var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {\n var n = t[o][1][e];return s(n ? n : e);\n }, l, l.exports, e, t, n, r);\n }return n[o].exports;\n }var i = typeof require == \"function\" && require;for (var o = 0; o < r.length; o++) {\n s(r[o]);\n }return s;\n })({ 1: [function (require, module, exports) {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n var options = window.boxzilla_options;\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n // print message when test mode is enabled\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n }\n\n // init boxzilla\n Boxzilla.init();\n\n // create boxes from options\n for (var i = 0; i < options.boxes.length; i++) {\n // get opts\n var boxOpts = options.boxes[i];\n boxOpts.testMode = isLoggedIn && options.testMode;\n\n // 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 box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n }\n\n // helper function for setting CSS styles\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n /**\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 */\n window.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)) {\n continue;\n }\n var box = boxes[boxId];\n if (box.element.querySelector(selector)) {\n box.show();\n return;\n }\n }\n }\n });\n\n window.Boxzilla = Boxzilla;\n }, { \"boxzilla\": 4 }], 2: [function (require, module, exports) {\n var duration = 320;\n\n function css(element, styles) {\n for (var property in styles) {\n element.style[property] = styles[property];\n }\n }\n\n function initObjectProperties(properties, value) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n return newObject;\n }\n\n function copyObjectProperties(properties, object) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n return newObject;\n }\n\n /**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\n function animated(element) {\n return !!element.getAttribute('data-animated');\n }\n\n /**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n */\n function toggle(element, animation) {\n var nowVisible = element.style.display != 'none' || element.offsetLeft > 0;\n\n // create clone for reference\n var clone = element.cloneNode(true);\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n };\n\n // store attribute so everyone knows we're animating this element\n element.setAttribute('data-animated', \"true\");\n\n // toggle element visiblity right away if we're making something visible\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles, visibleStyles;\n\n // animate properties\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles);\n css(element, hiddenStyles);\n }\n\n // don't show a scrollbar during animation\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = { opacity: 0 };\n visibleStyles = { opacity: 1 };\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n }\n\n function animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n // make sure we have an object filled with floats\n targetStyles[property] = parseFloat(targetStyles[property]);\n\n // calculate step size & current value\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]);\n\n // is there something to do?\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n\n var step, to, increment, newValue;\n for (var property in targetStyles) {\n step = propSteps[property];\n to = targetStyles[property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n }\n\n // store new value\n currentStyles[property] = newValue;\n\n var suffix = property !== \"opacity\" ? \"px\" : \"\";\n element.style[property] = newValue + suffix;\n }\n\n last = +new Date();\n\n // keep going until we're done for all props\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n }\n\n module.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n };\n }, {}], 3: [function (require, module, exports) {\n 'use strict';\n\n var defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'minimumScreenWidth': 0,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n },\n Boxzilla,\n Animator = require('./animator.js');\n\n /**\n * Merge 2 objects, values of the latter overwriting the former.\n *\n * @param obj1\n * @param obj2\n * @returns {*}\n */\n function merge(obj1, obj2) {\n var obj3 = {};\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n return obj3;\n }\n\n /**\n * Get the real height of entire document.\n * @returns {number}\n */\n function getDocumentHeight() {\n var body = document.body,\n html = document.documentElement;\n\n var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n\n return height;\n }\n\n // Box Object\n var Box = function Box(id, config) {\n this.id = id;\n\n // store config values\n this.config = merge(defaults, config);\n\n // store ref to overlay\n this.overlay = document.getElementById('boxzilla-overlay');\n\n // state\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = 0;\n this.cookieSet = false;\n this.element = null;\n this.closeIcon = null;\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 elements for this box\n this.dom();\n\n // further initialise the box\n this.events();\n };\n\n // initialise the box\n Box.prototype.events = function () {\n var box = this;\n\n // attach event to \"close\" icon inside box\n this.closeIcon && this.closeIcon.addEventListener('click', box.dismiss.bind(this));\n\n this.element.addEventListener('click', function (e) {\n if (e.target.tagName === 'A') {\n Boxzilla.trigger('box.interactions.link', [box, e.target]);\n }\n }, false);\n\n this.element.addEventListener('submit', function (e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [box, e.target]);\n }, false);\n\n window.addEventListener(\"hashchange\", function () {\n var needle = \"#boxzilla-\" + box.id;\n if (location.hash === needle) {\n box.toggle();\n }\n });\n\n // maybe show box right away\n if (this.fits() && this.locationHashRefersBox()) {\n window.addEventListener('load', this.show.bind(this));\n }\n };\n\n // generate dom elements for this box\n Box.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 if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = \"boxzilla-close-icon\";\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.element = box;\n };\n\n // set (calculate) custom box styling depending on box options\n Box.prototype.setCustomBoxStyling = function () {\n\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = 'auto';\n this.element.style.maxHeight = 'none';\n\n // get new dimensions\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight;\n\n // add scrollbar to box and limit height\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n }\n\n // set new top margin for boxes which are centered\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n };\n\n // toggle visibility of the box\n Box.prototype.toggle = function (show) {\n\n // revert visibility if no explicit argument is given\n if (typeof show === \"undefined\") {\n show = !this.visible;\n }\n\n // is box already at desired visibility?\n if (show === this.visible) {\n return false;\n }\n\n // is box being animated?\n if (Animator.animated(this.element)) {\n return false;\n }\n\n // if box should be hidden but is not closable, bail.\n if (!show && !this.config.closable) {\n return false;\n }\n\n // set new visibility status\n this.visible = show;\n\n // calculate new styling rules\n this.setCustomBoxStyling();\n\n // trigger event\n Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]);\n\n // show or hide box using selected animation\n if (this.config.position === 'center') {\n Animator.toggle(this.overlay, \"fade\");\n }\n\n Animator.toggle(this.element, this.config.animation);\n\n // focus on first input field in box\n var firstInput = this.element.querySelector('input, textarea');\n if (firstInput) {\n firstInput.focus();\n }\n\n return true;\n };\n\n // show the box\n Box.prototype.show = function () {\n return this.toggle(true);\n };\n\n // hide the box\n Box.prototype.hide = function () {\n return this.toggle(false);\n };\n\n // calculate trigger height\n Box.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n\n return triggerHeight;\n };\n\n // checks whether window.location.hash equals the box element ID or that of any element inside the box\n Box.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\n Box.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?\n Box.prototype.mayAutoShow = function () {\n\n if (this.dismissed) {\n return false;\n }\n\n // check if box fits on given minimum screen width\n if (!this.fits()) {\n return false;\n }\n\n // if trigger empty or error in calculating triggerHeight, return false\n if (!this.config.trigger) {\n return false;\n }\n\n // rely on cookie value (show if not set, don't show if set)\n return !this.cookieSet;\n };\n\n Box.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n };\n\n Box.prototype.isCookieSet = function () {\n // always show on test mode\n if (this.config.testMode) {\n return false;\n }\n\n // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n };\n\n // set cookie that disables automatically showing the box\n Box.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n };\n\n Box.prototype.trigger = function () {\n var shown = this.show();\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n };\n\n /**\n * Dismisses the box and optionally sets a cookie.\n *\n * @param e The event that triggered this dismissal.\n * @returns {boolean}\n */\n Box.prototype.dismiss = function (e) {\n // prevent default action\n e && e.preventDefault();\n\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n }\n\n // hide box element\n this.hide();\n\n // set cookie\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n Boxzilla.trigger('box.dismiss', [this]);\n return true;\n };\n\n module.exports = function (_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n };\n }, { \"./animator.js\": 2 }], 4: [function (require, module, exports) {\n 'use strict';\n\n // failsafe against loading script twice...\n\n if (window.Boxzilla) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter'),\n Boxzilla = Object.create(EventEmitter.prototype),\n Box = require('./box.js')(Boxzilla),\n Timer = require('./timer.js'),\n boxes = [],\n overlay,\n exitIntentDelayTimer,\n exitIntentTriggered,\n siteTimer,\n pageTimer,\n pageViews;\n\n function throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n\n var now = +new Date(),\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n }\n\n // \"keyup\" listener\n function onKeyUp(e) {\n if (e.keyCode == 27) {\n Boxzilla.dismiss();\n }\n }\n\n // check \"pageviews\" criteria for each box\n function checkPageViewsCriteria() {\n\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {\n box.trigger();\n }\n });\n }\n\n // check time trigger criteria for each box\n function checkTimeCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n // check \"time on site\" trigger\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n\n // check \"time on page\" trigger\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n }\n\n // check triggerHeight criteria for all boxes\n function checkHeightCriteria() {\n var scrollY = (window.scrollY || window.pageYOffset) + window.innerHeight * 0.75;\n\n boxes.forEach(function (box) {\n\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n // trigger box\n box.trigger();\n } else if (box.mayRehide()) {\n box.hide();\n }\n });\n }\n\n // recalculate heights and variables based on height\n function recalculateHeights() {\n boxes.forEach(function (box) {\n box.setCustomBoxStyling();\n });\n }\n\n function 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 boxes.forEach(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\n function triggerExitIntent() {\n // do nothing if already triggered OR another box is visible.\n if (exitIntentTriggered || isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n\n exitIntentTriggered = true;\n }\n\n function 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\n function isAnyBoxVisible() {\n\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n\n if (box.visible) {\n return true;\n }\n }\n\n return false;\n }\n\n function onMouseEnter() {\n if (exitIntentDelayTimer) {\n window.clearInterval(exitIntentDelayTimer);\n exitIntentDelayTimer = null;\n }\n }\n\n var timers = {\n start: function start() {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if (sessionTime) siteTimer.time = sessionTime;\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n };\n\n // initialise & add event listeners\n Boxzilla.init = function () {\n siteTimer = new Timer(sessionStorage.getItem('boxzilla_timer') || 0);\n pageTimer = new Timer(0);\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n\n // insert styles into DOM\n var styles = require('./styles.js');\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement);\n\n // add overlay element to dom\n overlay = document.createElement('div');\n overlay.style.display = 'none';\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay);\n\n // event binds\n window.addEventListener('scroll', throttle(checkHeightCriteria));\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n overlay.addEventListener('click', onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.addEventListener('keyup', onKeyUp);\n\n timers.start();\n window.addEventListener('focus', timers.start);\n window.addEventListener('beforeunload', function () {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n window.addEventListener('blur', timers.stop);\n\n Boxzilla.trigger('ready');\n };\n\n /**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\n Boxzilla.create = function (id, opts) {\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n };\n\n Boxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n if (box.id == id) {\n return box;\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n };\n\n // dismiss a single box (or all by omitting id param)\n Boxzilla.dismiss = function (id) {\n // if no id given, dismiss all current open boxes\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.dismiss();\n });\n } else if (_typeof(boxes[id]) === \"object\") {\n Boxzilla.get(id).dismiss();\n }\n };\n\n Boxzilla.hide = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.hide();\n });\n } else {\n Boxzilla.get(id).hide();\n }\n };\n\n Boxzilla.show = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.show();\n });\n } else {\n Boxzilla.get(id).show();\n }\n };\n\n Boxzilla.toggle = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.toggle();\n });\n } else {\n Boxzilla.get(id).toggle();\n }\n };\n\n // expose each individual box.\n Boxzilla.boxes = boxes;\n\n window.Boxzilla = Boxzilla;\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n }\n }, { \"./box.js\": 3, \"./styles.js\": 5, \"./timer.js\": 6, \"wolfy87-eventemitter\": 7 }], 5: [function (require, module, exports) {\n var styles = \"body{-webkit-overflow-scrolling:touch!important}#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\n module.exports = styles;\n }, {}], 6: [function (require, module, exports) {\n 'use strict';\n\n var Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n };\n\n Timer.prototype.tick = function () {\n this.time++;\n };\n\n Timer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n };\n\n Timer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n };\n\n module.exports = Timer;\n }, {}], 7: [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\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 } 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 === \"undefined\" ? \"undefined\" : _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 === \"undefined\" ? \"undefined\" : _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 } else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\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 === \"undefined\" ? \"undefined\" : _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 } 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 } 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 } 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 } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n module.exports = EventEmitter;\n } else {\n exports.EventEmitter = EventEmitter;\n }\n }).call(this);\n }, {}] }, {}, [1]);\n ;\n})();"],"sourceRoot":"/source/"}
1
+ {"version":3,"sources":["script.js"],"names":["_typeof","Symbol","iterator","obj","constructor","prototype","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","protocol","host","old","replace","content","box","create","id","firstChild","lastChild","addEventListener","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","querySelector","show","boxzilla","2","property","initObjectProperties","properties","value","newObject","copyObjectProperties","object","animated","getAttribute","toggle","animation","nowVisible","display","offsetLeft","clone","cloneNode","cleanup","removeAttribute","setAttribute","hiddenStyles","visibleStyles","computedStyles","getComputedStyle","overflowY","animate","opacity","targetStyles","fn","last","Date","initialStyles","currentStyles","propSteps","parseFloat","to","current","duration","tick","step","increment","newValue","now","timeSinceLastTick","done","suffix","requestAnimationFrame","setTimeout","3","merge","obj1","obj2","obj3","attrname","getDocumentHeight","html","documentElement","height","Math","max","scrollHeight","offsetHeight","clientHeight","defaults","rehide","cookie","icon","minimumScreenWidth","position","trigger","closable","Animator","Box","config","this","overlay","getElementById","visible","dismissed","triggered","triggerHeight","cookieSet","closeIcon","method","calculateTriggerHeight","isCookieSet","dom","events","dismiss","bind","target","tagName","setCookie","needle","hash","fits","locationHashRefersBox","wrapper","createElement","appendChild","innerHTML","scripts","querySelectorAll","script","createTextNode","text","parentNode","removeChild","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","newTopMargin","marginTop","classList","firstInput","focus","hide","triggerElement","offset","getBoundingClientRect","top","elementId","substring","innerWidth","mayAutoShow","mayRehide","RegExp","hours","expiryDate","setHours","getHours","toUTCString","shown","preventDefault","_Boxzilla","./animator.js","4","throttle","threshhold","scope","deferTimer","context","args","arguments","clearTimeout","apply","onKeyUp","keyCode","checkPageViewsCriteria","isAnyBoxVisible","forEach","pageViews","checkTimeCriteria","siteTimer","time","pageTimer","checkHeightCriteria","scrollY","pageYOffset","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","margin","left","right","bottom","triggerExitIntent","exitIntentTriggered","onMouseLeave","delay","clientY","exitIntentDelayTimer","onMouseEnter","clearInterval","EventEmitter","Object","Timer","timers","start","sessionTime","sessionStorage","getItem","stop","setItem","styleElement","head","setInterval","opts","push","get","./box.js","./styles.js","./timer.js","wolfy87-eventemitter","5","6","interval","7","indexOfListener","listeners","listener","alias","name","proto","originalGlobalValue","getListeners","evt","response","key","_getEvents","test","flattenListeners","flatListeners","getListenersAsObject","Array","addListener","listenerIsWrapped","once","on","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":"AAAA,YAEA,IAAIA,SAA4B,kBAAXC,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAA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tJ,KAAK4J,eAAejB,EAAKN,EAASA,UAGtCO,EAAWP,EAASA,SAAS3D,MAAM1E,KAAMuE,OAErCqE,IAAa5I,KAAK6K,uBAClB7K,KAAK4J,eAAejB,EAAKN,EAASA,SAMlD,OAAOrI,OAMXwI,EAAM7I,QAAU2I,EAAM,aAUtBE,EAAMsC,KAAO,SAAcnC,GACvB,GAAIpE,GAAO4E,MAAMvS,UAAUgU,MAAM9S,KAAK0M,UAAW,EACjD,OAAOxE,MAAK0K,UAAU/B,EAAKpE,IAW/BiE,EAAMuC,mBAAqB,SAA4BrP,GAEnD,MADAsE,MAAKgL,iBAAmBtP,EACjBsE,MAWXwI,EAAMqC,oBAAsB,WACxB,OAAI7K,KAAK9E,eAAe,qBACb8E,KAAKgL,kBAYpBxC,EAAMM,WAAa,WACf,MAAO9I,MAAKwK,UAAYxK,KAAKwK,aAQjC7D,EAAasE,WAAa,WAEtB,MADApT,GAAQ8O,aAAe8B,EAChB9B,GAIW,kBAAX5P,IAAyBA,EAAOmU,IACvCnU,EAAO,WACH,MAAO4P,KAEgE,YAAjD,mBAAX1O,GAAyB,YAAc1B,QAAQ0B,KAAyBA,EAAOJ,QAC9FI,EAAOJ,QAAU8O,EAEjB9O,EAAQ8O,aAAeA,IAE5B7O,KAAKkI,gBACG","file":"script.min.js","sourcesContent":["\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n(function () {\n var require = undefined;var module = undefined;var exports = undefined;var define = undefined;(function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n 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;\n }var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {\n var n = t[o][1][e];return s(n ? n : e);\n }, l, l.exports, e, t, n, r);\n }return n[o].exports;\n }var i = typeof require == \"function\" && require;for (var o = 0; o < r.length; o++) {\n s(r[o]);\n }return s;\n })({ 1: [function (require, module, exports) {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n var options = window.boxzilla_options;\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n // print message when test mode is enabled\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n }\n\n // init boxzilla\n Boxzilla.init();\n\n // create boxes from options\n for (var i = 0; i < options.boxes.length; i++) {\n // get opts\n var boxOpts = options.boxes[i];\n boxOpts.testMode = isLoggedIn && options.testMode;\n\n // fix http:// links in box content....\n if (window.location.protocol === \"https:\" && window.location.host) {\n var o = \"http://\" + window.location.host;\n var n = old.replace('http://', 'https://');\n boxOpts.content = boxOpts.content.replace(o, n);\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 box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n }\n\n // helper function for setting CSS styles\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n /**\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 */\n window.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)) {\n continue;\n }\n var box = boxes[boxId];\n if (box.element.querySelector(selector)) {\n box.show();\n return;\n }\n }\n }\n });\n\n window.Boxzilla = Boxzilla;\n }, { \"boxzilla\": 4 }], 2: [function (require, module, exports) {\n var duration = 320;\n\n function css(element, styles) {\n for (var property in styles) {\n element.style[property] = styles[property];\n }\n }\n\n function initObjectProperties(properties, value) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n return newObject;\n }\n\n function copyObjectProperties(properties, object) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n return newObject;\n }\n\n /**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\n function animated(element) {\n return !!element.getAttribute('data-animated');\n }\n\n /**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n */\n function toggle(element, animation) {\n var nowVisible = element.style.display != 'none' || element.offsetLeft > 0;\n\n // create clone for reference\n var clone = element.cloneNode(true);\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n };\n\n // store attribute so everyone knows we're animating this element\n element.setAttribute('data-animated', \"true\");\n\n // toggle element visiblity right away if we're making something visible\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles, visibleStyles;\n\n // animate properties\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles);\n css(element, hiddenStyles);\n }\n\n // don't show a scrollbar during animation\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = { opacity: 0 };\n visibleStyles = { opacity: 1 };\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n }\n\n function animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n // make sure we have an object filled with floats\n targetStyles[property] = parseFloat(targetStyles[property]);\n\n // calculate step size & current value\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]);\n\n // is there something to do?\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n\n var step, to, increment, newValue;\n for (var property in targetStyles) {\n step = propSteps[property];\n to = targetStyles[property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n }\n\n // store new value\n currentStyles[property] = newValue;\n\n var suffix = property !== \"opacity\" ? \"px\" : \"\";\n element.style[property] = newValue + suffix;\n }\n\n last = +new Date();\n\n // keep going until we're done for all props\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n }\n\n module.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n };\n }, {}], 3: [function (require, module, exports) {\n 'use strict';\n\n var defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'minimumScreenWidth': 0,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n },\n Boxzilla,\n Animator = require('./animator.js');\n\n /**\n * Merge 2 objects, values of the latter overwriting the former.\n *\n * @param obj1\n * @param obj2\n * @returns {*}\n */\n function merge(obj1, obj2) {\n var obj3 = {};\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n return obj3;\n }\n\n /**\n * Get the real height of entire document.\n * @returns {number}\n */\n function getDocumentHeight() {\n var body = document.body,\n html = document.documentElement;\n\n var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n\n return height;\n }\n\n // Box Object\n var Box = function Box(id, config) {\n this.id = id;\n\n // store config values\n this.config = merge(defaults, config);\n\n // store ref to overlay\n this.overlay = document.getElementById('boxzilla-overlay');\n\n // state\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = 0;\n this.cookieSet = false;\n this.element = null;\n this.closeIcon = null;\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 elements for this box\n this.dom();\n\n // further initialise the box\n this.events();\n };\n\n // initialise the box\n Box.prototype.events = function () {\n var box = this;\n\n // attach event to \"close\" icon inside box\n this.closeIcon && this.closeIcon.addEventListener('click', box.dismiss.bind(this));\n\n this.element.addEventListener('click', function (e) {\n if (e.target.tagName === 'A') {\n Boxzilla.trigger('box.interactions.link', [box, e.target]);\n }\n }, false);\n\n this.element.addEventListener('submit', function (e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [box, e.target]);\n }, false);\n\n window.addEventListener(\"hashchange\", function () {\n var needle = \"#boxzilla-\" + box.id;\n if (location.hash === needle) {\n box.toggle();\n }\n });\n\n // maybe show box right away\n if (this.fits() && this.locationHashRefersBox()) {\n window.addEventListener('load', this.show.bind(this));\n }\n };\n\n // generate dom elements for this box\n Box.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 if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = \"boxzilla-close-icon\";\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.element = box;\n };\n\n // set (calculate) custom box styling depending on box options\n Box.prototype.setCustomBoxStyling = function () {\n\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = 'auto';\n this.element.style.maxHeight = 'none';\n\n // get new dimensions\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight;\n\n // add scrollbar to box and limit height\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n }\n\n // set new top margin for boxes which are centered\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n };\n\n // toggle visibility of the box\n Box.prototype.toggle = function (show) {\n\n // revert visibility if no explicit argument is given\n if (typeof show === \"undefined\") {\n show = !this.visible;\n }\n\n // is box already at desired visibility?\n if (show === this.visible) {\n return false;\n }\n\n // is box being animated?\n if (Animator.animated(this.element)) {\n return false;\n }\n\n // if box should be hidden but is not closable, bail.\n if (!show && !this.config.closable) {\n return false;\n }\n\n // set new visibility status\n this.visible = show;\n\n // calculate new styling rules\n this.setCustomBoxStyling();\n\n // trigger event\n Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]);\n\n // show or hide box using selected animation\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n Animator.toggle(this.overlay, \"fade\");\n }\n\n Animator.toggle(this.element, this.config.animation);\n\n // focus on first input field in box\n var firstInput = this.element.querySelector('input, textarea');\n if (firstInput) {\n firstInput.focus();\n }\n\n return true;\n };\n\n // show the box\n Box.prototype.show = function () {\n return this.toggle(true);\n };\n\n // hide the box\n Box.prototype.hide = function () {\n return this.toggle(false);\n };\n\n // calculate trigger height\n Box.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n\n return triggerHeight;\n };\n\n // checks whether window.location.hash equals the box element ID or that of any element inside the box\n Box.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\n Box.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?\n Box.prototype.mayAutoShow = function () {\n\n if (this.dismissed) {\n return false;\n }\n\n // check if box fits on given minimum screen width\n if (!this.fits()) {\n return false;\n }\n\n // if trigger empty or error in calculating triggerHeight, return false\n if (!this.config.trigger) {\n return false;\n }\n\n // rely on cookie value (show if not set, don't show if set)\n return !this.cookieSet;\n };\n\n Box.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n };\n\n Box.prototype.isCookieSet = function () {\n // always show on test mode\n if (this.config.testMode) {\n return false;\n }\n\n // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n };\n\n // set cookie that disables automatically showing the box\n Box.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n };\n\n Box.prototype.trigger = function () {\n var shown = this.show();\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n };\n\n /**\n * Dismisses the box and optionally sets a cookie.\n *\n * @param e The event that triggered this dismissal.\n * @returns {boolean}\n */\n Box.prototype.dismiss = function (e) {\n // prevent default action\n e && e.preventDefault();\n\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n }\n\n // hide box element\n this.hide();\n\n // set cookie\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n Boxzilla.trigger('box.dismiss', [this]);\n return true;\n };\n\n module.exports = function (_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n };\n }, { \"./animator.js\": 2 }], 4: [function (require, module, exports) {\n 'use strict';\n\n // failsafe against loading script twice...\n\n if (window.Boxzilla) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter'),\n Boxzilla = Object.create(EventEmitter.prototype),\n Box = require('./box.js')(Boxzilla),\n Timer = require('./timer.js'),\n boxes = [],\n overlay,\n exitIntentDelayTimer,\n exitIntentTriggered,\n siteTimer,\n pageTimer,\n pageViews;\n\n function throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n\n var now = +new Date(),\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n }\n\n // \"keyup\" listener\n function onKeyUp(e) {\n if (e.keyCode == 27) {\n Boxzilla.dismiss();\n }\n }\n\n // check \"pageviews\" criteria for each box\n function checkPageViewsCriteria() {\n\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {\n box.trigger();\n }\n });\n }\n\n // check time trigger criteria for each box\n function checkTimeCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n // check \"time on site\" trigger\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n\n // check \"time on page\" trigger\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n }\n\n // check triggerHeight criteria for all boxes\n function checkHeightCriteria() {\n var scrollY = (window.scrollY || window.pageYOffset) + window.innerHeight * 0.75;\n\n boxes.forEach(function (box) {\n\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n // trigger box\n box.trigger();\n } else if (box.mayRehide()) {\n box.hide();\n }\n });\n }\n\n // recalculate heights and variables based on height\n function recalculateHeights() {\n boxes.forEach(function (box) {\n box.setCustomBoxStyling();\n });\n }\n\n function 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 boxes.forEach(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\n function triggerExitIntent() {\n // do nothing if already triggered OR another box is visible.\n if (exitIntentTriggered || isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n\n exitIntentTriggered = true;\n }\n\n function 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\n function isAnyBoxVisible() {\n\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n\n if (box.visible) {\n return true;\n }\n }\n\n return false;\n }\n\n function onMouseEnter() {\n if (exitIntentDelayTimer) {\n window.clearInterval(exitIntentDelayTimer);\n exitIntentDelayTimer = null;\n }\n }\n\n var timers = {\n start: function start() {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if (sessionTime) siteTimer.time = sessionTime;\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n };\n\n // initialise & add event listeners\n Boxzilla.init = function () {\n siteTimer = new Timer(sessionStorage.getItem('boxzilla_timer') || 0);\n pageTimer = new Timer(0);\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n\n // insert styles into DOM\n var styles = require('./styles.js');\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement);\n\n // add overlay element to dom\n overlay = document.createElement('div');\n overlay.style.display = 'none';\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay);\n\n // event binds\n window.addEventListener('touchmove', throttle(checkHeightCriteria));\n window.addEventListener('scroll', throttle(checkHeightCriteria));\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n overlay.addEventListener('click', onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.addEventListener('keyup', onKeyUp);\n\n timers.start();\n window.addEventListener('focus', timers.start);\n window.addEventListener('beforeunload', function () {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n window.addEventListener('blur', timers.stop);\n\n Boxzilla.trigger('ready');\n };\n\n /**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\n Boxzilla.create = function (id, opts) {\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n };\n\n Boxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n if (box.id == id) {\n return box;\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n };\n\n // dismiss a single box (or all by omitting id param)\n Boxzilla.dismiss = function (id) {\n // if no id given, dismiss all current open boxes\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.dismiss();\n });\n } else if (_typeof(boxes[id]) === \"object\") {\n Boxzilla.get(id).dismiss();\n }\n };\n\n Boxzilla.hide = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.hide();\n });\n } else {\n Boxzilla.get(id).hide();\n }\n };\n\n Boxzilla.show = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.show();\n });\n } else {\n Boxzilla.get(id).show();\n }\n };\n\n Boxzilla.toggle = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.toggle();\n });\n } else {\n Boxzilla.get(id).toggle();\n }\n };\n\n // expose each individual box.\n Boxzilla.boxes = boxes;\n\n window.Boxzilla = Boxzilla;\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n }\n }, { \"./box.js\": 3, \"./styles.js\": 5, \"./timer.js\": 6, \"wolfy87-eventemitter\": 7 }], 5: [function (require, module, exports) {\n var styles = \"#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\n module.exports = styles;\n }, {}], 6: [function (require, module, exports) {\n 'use strict';\n\n var Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n };\n\n Timer.prototype.tick = function () {\n this.time++;\n };\n\n Timer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n };\n\n Timer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n };\n\n module.exports = Timer;\n }, {}], 7: [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\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 } 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 === \"undefined\" ? \"undefined\" : _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 === \"undefined\" ? \"undefined\" : _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 } else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\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 === \"undefined\" ? \"undefined\" : _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 } 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 } 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 } 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 } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n module.exports = EventEmitter;\n } else {\n exports.EventEmitter = EventEmitter;\n }\n }).call(this);\n }, {}] }, {}, [1]);\n ;\n})();"]}
assets/scss/admin-styles.scss CHANGED
@@ -93,6 +93,10 @@
93
  }
94
  }
95
 
 
 
 
 
96
 
97
  /* Radio Switches */
98
  .radio-label {
93
  }
94
  }
95
 
96
+ .boxzilla-is-dismissible {
97
+ padding-right: 38px;
98
+ position: relative;
99
+ }
100
 
101
  /* Radio Switches */
102
  .radio-label {
bootstrap.php CHANGED
@@ -13,6 +13,8 @@ $provider->register( $boxzilla );
13
  $provider = new Licensing\LicenseServiceProvider();
14
  $provider->register( $boxzilla );
15
 
 
 
16
  // Rest of bootstrapping runs at plugins_loaded:90
17
  add_action( 'plugins_loaded', function() use( $boxzilla ) {
18
 
13
  $provider = new Licensing\LicenseServiceProvider();
14
  $provider->register( $boxzilla );
15
 
16
+
17
+
18
  // Rest of bootstrapping runs at plugins_loaded:90
19
  add_action( 'plugins_loaded', function() use( $boxzilla ) {
20
 
boxzilla.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
- Version: 3.1.6
5
  Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
  Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
  Author: ibericode
@@ -41,7 +41,7 @@ if ( ! defined( 'ABSPATH' ) ) {
41
  function __load_boxzilla() {
42
 
43
  define( 'BOXZILLA_FILE', __FILE__ );
44
- define( 'BOXZILLA_VERSION', '3.1.6' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
+ Version: 3.1.7
5
  Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
6
  Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
7
  Author: ibericode
41
  function __load_boxzilla() {
42
 
43
  define( 'BOXZILLA_FILE', __FILE__ );
44
+ define( 'BOXZILLA_VERSION', '3.1.7' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
languages/boxzilla.pot CHANGED
@@ -13,62 +13,75 @@ msgstr ""
13
  "X-Poedit-SearchPath-0: .\n"
14
  "X-Poedit-SearchPathExcluded-0: *.js\n"
15
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
- #: src/admin/class-admin.php:143
 
17
  msgid "Awesome, you are using Boxzilla! You can now safely <a href=\"%s\">deactivate the Scroll Triggered Boxes plugin</a>."
18
  msgstr ""
19
 
20
- #: src/admin/class-admin.php:277
21
  msgid "Box ID"
22
  msgstr ""
23
 
24
- #: src/admin/class-admin.php:283
25
  msgid "Box Title"
26
  msgstr ""
27
 
28
- #: src/admin/class-admin.php:351, src/admin/class-admin.php:353, src/admin/views/settings.php:7
29
  msgid "Settings"
30
  msgstr ""
31
 
32
- #: src/admin/class-admin.php:363, src/admin/class-admin.php:365
33
  msgid "Extensions"
34
  msgstr ""
35
 
36
- #: src/admin/class-admin.php:551
37
  msgid "Enter a comma-separated list of values."
38
  msgstr ""
39
 
40
- #: src/admin/class-admin.php:553
41
  msgid "Enter a comma-separated list of post slugs or post ID's.."
42
  msgstr ""
43
 
44
- #: src/admin/class-admin.php:555
45
  msgid "Enter a comma-separated list of page slugs or page ID's.."
46
  msgstr ""
47
 
48
- #: src/admin/class-admin.php:557
49
  msgid "Enter a comma-separated list of post types.."
50
  msgstr ""
51
 
52
- #: src/admin/class-admin.php:559
53
  msgid "Enter a comma-separated list of relative URL's, eg /contact/"
54
  msgstr ""
55
 
56
- #: src/admin/class-admin.php:625
57
  msgid "Box Appearance"
58
  msgstr ""
59
 
60
- #: src/admin/class-admin.php:643
61
  msgid "Box Options"
62
  msgstr ""
63
 
64
- #: src/admin/class-admin.php:661
65
  msgid "Looking for help?"
66
  msgstr ""
67
 
68
- #: src/admin/class-admin.php:677
69
  msgid "Subscribe to our newsletter"
70
  msgstr ""
71
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  #: src/admin/views/extensions.php:4
73
  msgid "Available Add-On Plugins"
74
  msgstr ""
13
  "X-Poedit-SearchPath-0: .\n"
14
  "X-Poedit-SearchPathExcluded-0: *.js\n"
15
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
16
+
17
+ #: src/admin/class-admin.php:207
18
  msgid "Awesome, you are using Boxzilla! You can now safely <a href=\"%s\">deactivate the Scroll Triggered Boxes plugin</a>."
19
  msgstr ""
20
 
21
+ #: src/admin/class-admin.php:341
22
  msgid "Box ID"
23
  msgstr ""
24
 
25
+ #: src/admin/class-admin.php:347
26
  msgid "Box Title"
27
  msgstr ""
28
 
29
+ #: src/admin/class-admin.php:415, src/admin/class-admin.php:417, src/admin/views/settings.php:7
30
  msgid "Settings"
31
  msgstr ""
32
 
33
+ #: src/admin/class-admin.php:427, src/admin/class-admin.php:429
34
  msgid "Extensions"
35
  msgstr ""
36
 
37
+ #: src/admin/class-admin.php:615
38
  msgid "Enter a comma-separated list of values."
39
  msgstr ""
40
 
41
+ #: src/admin/class-admin.php:617
42
  msgid "Enter a comma-separated list of post slugs or post ID's.."
43
  msgstr ""
44
 
45
+ #: src/admin/class-admin.php:619
46
  msgid "Enter a comma-separated list of page slugs or page ID's.."
47
  msgstr ""
48
 
49
+ #: src/admin/class-admin.php:621
50
  msgid "Enter a comma-separated list of post types.."
51
  msgstr ""
52
 
53
+ #: src/admin/class-admin.php:623
54
  msgid "Enter a comma-separated list of relative URL's, eg /contact/"
55
  msgstr ""
56
 
57
+ #: src/admin/class-admin.php:689
58
  msgid "Box Appearance"
59
  msgstr ""
60
 
61
+ #: src/admin/class-admin.php:707
62
  msgid "Box Options"
63
  msgstr ""
64
 
65
+ #: src/admin/class-admin.php:725
66
  msgid "Looking for help?"
67
  msgstr ""
68
 
69
+ #: src/admin/class-admin.php:741
70
  msgid "Subscribe to our newsletter"
71
  msgstr ""
72
 
73
+ #: src/admin/class-review-notice.php:74
74
+ msgid "You've been using Boxzilla for some time now; we hope you love it!"
75
+ msgstr ""
76
+
77
+ #: src/admin/class-review-notice.php:75
78
+ msgid "If you do, please <a href=\"%s\">leave us a 5★ rating on WordPress.org</a>. It would be of great help to us."
79
+ msgstr ""
80
+
81
+ #: src/admin/class-review-notice.php:77
82
+ msgid "Dismiss this notice."
83
+ msgstr ""
84
+
85
  #: src/admin/views/extensions.php:4
86
  msgid "Available Add-On Plugins"
87
  msgstr ""
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=bo
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 3.8
6
  Tested up to: 4.6.1
7
- Stable tag: 3.1.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -16,8 +16,6 @@ Flexible call to action boxes, popping up or sliding in at just the right time.
16
 
17
  Boxzilla is a *lightweight* plugin for adding flexible call-to-actions to your WordPress site. Boxes can slide or fade in at any point and can contain whatever content you like.
18
 
19
- > This is the successor of the old [Scroll Triggered Boxes](https://wordpress.org/plugins/scroll-triggered-boxes/) plugin.
20
-
21
  #### Some of Boxzilla's features
22
 
23
  - Boxes can contain _any_ content you like.
@@ -37,6 +35,8 @@ Boxzilla is a *lightweight* plugin for adding flexible call-to-actions to your W
37
 
38
  [Read more about Boxzilla](https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=boxzilla&utm_campaign=description).
39
 
 
 
40
  #### Documentation
41
 
42
  Please have a look at the [Boxzilla KB](https://kb.boxzillaplugin.com/).
@@ -149,15 +149,23 @@ Have a look at the [frequently asked questions](https://wordpress.org/plugins/bo
149
  == Changelog ==
150
 
151
 
152
-
153
- #### 3.1.6 - October 18, 2016
154
 
155
  **Fixes**
156
 
 
157
  - Scroll to bottom when closing box in MobileSafari browsers.
158
 
159
  **Improvements**
160
 
 
 
 
 
 
 
 
 
161
  - Failsafe against including the Boxzilla script twice, to prevent duplicate elements.
162
 
163
 
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.6.1
7
+ Stable tag: 3.1.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
16
 
17
  Boxzilla is a *lightweight* plugin for adding flexible call-to-actions to your WordPress site. Boxes can slide or fade in at any point and can contain whatever content you like.
18
 
 
 
19
  #### Some of Boxzilla's features
20
 
21
  - Boxes can contain _any_ content you like.
35
 
36
  [Read more about Boxzilla](https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=boxzilla&utm_campaign=description).
37
 
38
+ > This is the successor of the old [Scroll Triggered Boxes](https://wordpress.org/plugins/scroll-triggered-boxes/) plugin.
39
+
40
  #### Documentation
41
 
42
  Please have a look at the [Boxzilla KB](https://kb.boxzillaplugin.com/).
149
  == Changelog ==
150
 
151
 
152
+ #### 3.1.7 - November 8, 2016
 
153
 
154
  **Fixes**
155
 
156
+ - Cookie length value was reset on every plugin update.
157
  - Scroll to bottom when closing box in MobileSafari browsers.
158
 
159
  **Improvements**
160
 
161
+ - Add CSS class to overlay when box is toggled.
162
+ - Ask for [plugin review](https://wordpress.org/support/plugin/boxzilla/reviews/#new-post) after 2 weeks of usage.
163
+
164
+
165
+ #### 3.1.6 - October 18, 2016
166
+
167
+ **Improvements**
168
+
169
  - Failsafe against including the Boxzilla script twice, to prevent duplicate elements.
170
 
171
 
src/admin/class-admin.php CHANGED
@@ -20,6 +20,11 @@ class Admin {
20
  */
21
  protected $boxzilla;
22
 
 
 
 
 
 
23
  /**
24
  * @param Plugin $plugin
25
  * @param Boxzilla $boxzilla
@@ -27,6 +32,7 @@ class Admin {
27
  public function __construct( Plugin $plugin, Boxzilla $boxzilla ) {
28
  $this->plugin = $plugin;
29
  $this->boxzilla = $boxzilla;
 
30
  }
31
 
32
  /**
@@ -48,11 +54,37 @@ class Admin {
48
  protected function add_hooks() {
49
  add_action( 'admin_init', array( $this, 'lazy_add_hooks' ) );
50
  add_action( 'admin_init', array( $this, 'register' ) );
 
51
  add_action( 'admin_menu', array( $this, 'menu' ) );
52
  add_action( 'admin_notices', array( $this, 'notices' ) );
53
  add_action( 'save_post_boxzilla-box', array( $this, 'save_box_options' ), 20, 2 );
54
  add_action( 'trashed_post', array( $this, 'flush_rules' ) );
55
  add_action( 'untrashed_post', array( $this, 'flush_rules' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
 
58
  /**
20
  */
21
  protected $boxzilla;
22
 
23
+ /**
24
+ * @var ReviewNotice
25
+ */
26
+ protected $review_notice;
27
+
28
  /**
29
  * @param Plugin $plugin
30
  * @param Boxzilla $boxzilla
32
  public function __construct( Plugin $plugin, Boxzilla $boxzilla ) {
33
  $this->plugin = $plugin;
34
  $this->boxzilla = $boxzilla;
35
+ $this->review_notice = new ReviewNotice();
36
  }
37
 
38
  /**
54
  protected function add_hooks() {
55
  add_action( 'admin_init', array( $this, 'lazy_add_hooks' ) );
56
  add_action( 'admin_init', array( $this, 'register' ) );
57
+ add_action( 'init', array( $this, 'listen_for_actions' ) );
58
  add_action( 'admin_menu', array( $this, 'menu' ) );
59
  add_action( 'admin_notices', array( $this, 'notices' ) );
60
  add_action( 'save_post_boxzilla-box', array( $this, 'save_box_options' ), 20, 2 );
61
  add_action( 'trashed_post', array( $this, 'flush_rules' ) );
62
  add_action( 'untrashed_post', array( $this, 'flush_rules' ) );
63
+
64
+ $this->review_notice->add_hooks();
65
+ }
66
+
67
+ /**
68
+ * Listen for admin actions.
69
+ */
70
+ public function listen_for_actions() {
71
+
72
+ // triggered?
73
+ $vars = array_merge( $_POST, $_GET );
74
+ if( empty( $vars['_boxzilla_admin_action'] ) ) {
75
+ return false;
76
+ }
77
+
78
+ // authorized?
79
+ if( ! current_user_can( 'edit_posts' ) ) {
80
+ return false;
81
+ }
82
+
83
+ // fire action
84
+ $action = $vars['_boxzilla_admin_action'];
85
+ do_action( 'boxzilla_admin_' . $action );
86
+
87
+ return true;
88
  }
89
 
90
  /**
src/admin/class-migrations.php CHANGED
@@ -61,9 +61,18 @@ class Migrations {
61
  $parts = explode( '-', $migration );
62
  $version = $parts[0];
63
 
64
- if( version_compare( $this->version_from, $version, '<' ) ) {
65
- $migrations[] = $file;
 
66
  }
 
 
 
 
 
 
 
 
67
  }
68
 
69
  return $migrations;
61
  $parts = explode( '-', $migration );
62
  $version = $parts[0];
63
 
64
+ // check if migration file is not for an even higher version
65
+ if( version_compare( $version, $this->version_to, '>' ) ) {
66
+ continue;
67
  }
68
+
69
+ // check if we ran migration file before.
70
+ if( version_compare( $this->version_from, $version, '>=' ) ) {
71
+ continue;
72
+ }
73
+
74
+ // schedule migration file for running
75
+ $migrations[] = $file;
76
  }
77
 
78
  return $migrations;
src/admin/class-review-notice.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Boxzilla\Admin;
4
+ use WP_Screen;
5
+
6
+ /**
7
+ * Class ReviewNotice
8
+ *
9
+ * @ignore
10
+ */
11
+ class ReviewNotice {
12
+
13
+ /**
14
+ * @var string
15
+ */
16
+ protected $meta_key_dismissed = '_boxzilla_review_notice_dismissed';
17
+
18
+ /**
19
+ * Constructor.
20
+ */
21
+ public function __construct() {
22
+
23
+ }
24
+
25
+ /**
26
+ * Add action & filter hooks.
27
+ */
28
+ public function add_hooks() {
29
+ add_action( 'admin_notices', array( $this, 'show' ) );
30
+ add_action( 'boxzilla_admin_dismiss_review_notice', array( $this, 'dismiss' ) );
31
+ }
32
+
33
+ /**
34
+ * Set flag in user meta so notice won't be shown.
35
+ */
36
+ public function dismiss() {
37
+ $user = wp_get_current_user();
38
+ update_user_meta( $user->ID, $this->meta_key_dismissed, 1 );
39
+ }
40
+
41
+ /**
42
+ * @return bool
43
+ */
44
+ public function show() {
45
+ $screen = get_current_screen();
46
+ if( ! $screen instanceof WP_Screen ) {
47
+ return false;
48
+ }
49
+
50
+ // on some boxzilla screen?
51
+ if( $screen->post_type !== 'boxzilla-box' ) {
52
+ return false;
53
+ }
54
+
55
+ // authorized?
56
+ if( ! current_user_can( 'edit_posts' ) ) {
57
+ return false;
58
+ }
59
+
60
+ // only show if 2 weeks have passed since first use.
61
+ $two_weeks_in_seconds = ( 60 * 60 * 24 * 14 );
62
+ if( $this->time_since_first_use() <= $two_weeks_in_seconds ) {
63
+ return false;
64
+ }
65
+
66
+ // only show if user did not dismiss before
67
+ $user = wp_get_current_user();
68
+ if( get_user_meta( $user->ID, $this->meta_key_dismissed, true ) ) {
69
+ return false;
70
+ }
71
+
72
+ echo '<div class="notice notice-info boxzilla-is-dismissible">';
73
+ echo '<p>';
74
+ echo __( 'You\'ve been using Boxzilla for some time now; we hope you love it!', 'boxzilla' ) . ' <br />';
75
+ echo sprintf( __( 'If you do, please <a href="%s">leave us a 5★ rating on WordPress.org</a>. It would be of great help to us.', 'boxzilla' ), 'https://wordpress.org/support/view/plugin-reviews/boxzilla?rate=5#new-post' );
76
+ echo '</p>';
77
+ echo '<form method="POST"><button type="submit" class="notice-dismiss"><span class="screen-reader-text">'. __( 'Dismiss this notice.', 'boxzilla' ) .'</span></button><input type="hidden" name="_boxzilla_admin_action" value="dismiss_review_notice"/></form>';
78
+ echo '</div>';
79
+ return true;
80
+ }
81
+
82
+ /**
83
+ * @return int
84
+ */
85
+ private function time_since_first_use() {
86
+ $options = get_option( 'boxzilla_settings' );
87
+
88
+ // option was never added before, do it now.
89
+ if( empty( $options['first_activated_on'] ) ) {
90
+ $options['first_activated_on'] = time();
91
+ update_option( 'boxzilla_settings', $options );
92
+ }
93
+
94
+ return time() - $options['first_activated_on'];
95
+ }
96
+ }
src/admin/migrations/{4.0.0-cookie-option.php → 3.1-cookie-option.php} RENAMED
File without changes
trunk/LICENSE ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ {description}
294
+ Copyright (C) {year} {fullname}
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ {signature of Ty Coon}, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
trunk/assets/browserify/admin-script.js ADDED
@@ -0,0 +1 @@
 
1
+ window.Boxzilla_Admin = require('./admin/_admin.js');
trunk/assets/browserify/admin/_admin.js ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function() {
2
+ 'use strict';
3
+
4
+ var $ = window.jQuery;
5
+ var Option = require('./_option.js');
6
+ var optionControls = document.getElementById('boxzilla-box-options-controls');
7
+ var $optionControls = $(optionControls);
8
+
9
+ // sanity check, are we on the correct page?
10
+ if( $optionControls.length === 0 ) {
11
+ return;
12
+ }
13
+
14
+ var EventEmitter = require('wolfy87-eventemitter');
15
+ var events = new EventEmitter();
16
+ var Designer = require('./_designer.js')($, Option, events);
17
+ var rowTemplate = wp.template('rule-row-template');
18
+ var i18n = boxzilla_i18n;
19
+
20
+ // events
21
+ $optionControls.on('click', ".boxzilla-add-rule", addRuleFields);
22
+ $optionControls.on('click', ".boxzilla-remove-rule", removeRule);
23
+ $optionControls.on('change', ".boxzilla-rule-condition", setContextualHelpers);
24
+ $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions );
25
+
26
+ $(window).load(function() {
27
+ if( typeof(window.tinyMCE) === "undefined" ) {
28
+ document.getElementById('notice-notinymce').style.display = '';
29
+ }
30
+ });
31
+
32
+ // call contextual helper method for each row
33
+ $('.boxzilla-rule-row').each(setContextualHelpers);
34
+
35
+ function toggleTriggerOptions() {
36
+ $optionControls.find('.boxzilla-trigger-options').toggle( this.value !== '' );
37
+ }
38
+
39
+ function removeRule() {
40
+ $(this).parents('tr').remove();
41
+ }
42
+
43
+ function setContextualHelpers() {
44
+
45
+ var context = ( this.tagName.toLowerCase() === "tr" ) ? this : $(this).parents('tr').get(0);
46
+ var condition = context.querySelector('.boxzilla-rule-condition').value;
47
+ var valueInput = context.querySelector('.boxzilla-rule-value');
48
+ var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');
49
+ var betterInput = valueInput.cloneNode(true);
50
+ var $betterInput = $(betterInput);
51
+
52
+ // remove previously added helpers
53
+ $(context.querySelectorAll('.boxzilla-helper')).remove();
54
+
55
+ // prepare better input
56
+ betterInput.removeAttribute('name');
57
+ betterInput.className = betterInput.className + ' boxzilla-helper';
58
+ valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);
59
+ $betterInput.change(function() { valueInput.value = this.value; });
60
+
61
+ betterInput.style.display = '';
62
+ valueInput.style.display = 'none';
63
+ qualifierInput.style.display = '';
64
+
65
+ // change placeholder for textual help
66
+ switch(condition) {
67
+ default:
68
+ betterInput.placeholder = i18n.enterCommaSeparatedValues;
69
+ break;
70
+
71
+ case '':
72
+ case 'everywhere':
73
+ qualifierInput.value = '1';
74
+ valueInput.value = '';
75
+ betterInput.style.display = 'none';
76
+ qualifierInput.style.display = 'none';
77
+ break;
78
+
79
+ case 'is_single':
80
+ case 'is_post':
81
+ betterInput.placeholder = i18n.enterCommaSeparatedPosts;
82
+ $betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=post", {multiple:true, multipleSep: ","});
83
+ break;
84
+
85
+ case 'is_page':
86
+ betterInput.placeholder = i18n.enterCommaSeparatedPages;
87
+ $betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=page", {multiple:true, multipleSep: ","});
88
+ break;
89
+
90
+ case 'is_post_type':
91
+ betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;
92
+ $betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=post_type", {multiple:true, multipleSep: ","});
93
+ break;
94
+
95
+ case 'is_url':
96
+ betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;
97
+ break;
98
+
99
+ case 'is_post_in_category':
100
+ $betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=category", {multiple:true, multipleSep: ","});
101
+ break;
102
+
103
+ case 'is_post_with_tag':
104
+ $betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=post_tag", {multiple:true, multipleSep: ","});
105
+ break;
106
+ }
107
+ }
108
+
109
+ function addRuleFields() {
110
+ var data = {
111
+ 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length
112
+ };
113
+ var html = rowTemplate(data);
114
+ $(document.getElementById('boxzilla-box-rules')).after(html);
115
+ return false;
116
+ }
117
+
118
+ module.exports = {
119
+ 'Designer': Designer,
120
+ 'Option': Option,
121
+ 'events': events
122
+ };
123
+ })();
trunk/assets/browserify/admin/_designer.js ADDED
@@ -0,0 +1,109 @@