Boxzilla - Version 3.1.19

Version Description

Download this release

Release Info

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

Code changes from version 3.1.18 to 3.1.19

assets/js/script.js CHANGED
@@ -280,390 +280,388 @@ module.exports = {
280
  'use strict';
281
 
282
  var defaults = {
283
- 'animation': 'fade',
284
- 'rehide': false,
285
- 'content': '',
286
- 'cookie': null,
287
- 'icon': '&times',
288
- 'screenWidthCondition': null,
289
- 'position': 'center',
290
- 'testMode': false,
291
- 'trigger': false,
292
- 'closable': true
293
  },
294
  Boxzilla,
295
  Animator = require('./animator.js');
296
 
297
  /**
298
- * Merge 2 objects, values of the latter overwriting the former.
299
- *
300
- * @param obj1
301
- * @param obj2
302
- * @returns {*}
303
- */
304
  function merge(obj1, obj2) {
305
- var obj3 = {};
306
- for (var attrname in obj1) {
307
- obj3[attrname] = obj1[attrname];
308
- }
309
- for (var attrname in obj2) {
310
- obj3[attrname] = obj2[attrname];
311
- }
312
- return obj3;
313
  }
314
 
315
  /**
316
- * Get the real height of entire document.
317
- * @returns {number}
318
- */
319
  function getDocumentHeight() {
320
- var body = document.body,
321
- html = document.documentElement;
322
 
323
- var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
324
 
325
- return height;
326
  }
327
 
328
  // Box Object
329
  var Box = function Box(id, config) {
330
- this.id = id;
331
-
332
- // store config values
333
- this.config = merge(defaults, config);
334
-
335
- // store ref to overlay
336
- this.overlay = document.getElementById('boxzilla-overlay');
337
-
338
- // state
339
- this.visible = false;
340
- this.dismissed = false;
341
- this.triggered = false;
342
- this.triggerHeight = 0;
343
- this.cookieSet = false;
344
- this.element = null;
345
- this.contentElement = null;
346
- this.closeIcon = null;
347
-
348
- // if a trigger was given, calculate values once and store
349
- if (this.config.trigger) {
350
- if (this.config.trigger.method === 'percentage' || this.config.trigger.method === 'element') {
351
- this.triggerHeight = this.calculateTriggerHeight();
352
- }
353
 
354
- this.cookieSet = this.isCookieSet();
355
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
356
 
357
- // create dom elements for this box
358
- this.dom();
359
 
360
- // further initialise the box
361
- this.events();
362
  };
363
 
364
  // initialise the box
365
  Box.prototype.events = function () {
366
- var box = this;
367
 
368
- // attach event to "close" icon inside box
369
- if (this.closeIcon) {
370
- this.closeIcon.addEventListener('click', this.dismiss.bind(this));
371
- }
372
 
373
- this.element.addEventListener('click', function (e) {
374
- if (e.target.tagName === 'A') {
375
- Boxzilla.trigger('box.interactions.link', [box, e.target]);
376
- }
377
- }, false);
378
 
379
- this.element.addEventListener('submit', function (e) {
380
- box.setCookie();
381
- Boxzilla.trigger('box.interactions.form', [box, e.target]);
382
- }, false);
383
 
384
- // maybe show box right away
385
- if (this.fits() && this.locationHashRefersBox()) {
386
- window.addEventListener('load', this.show.bind(this));
387
- }
388
  };
389
 
390
  // generate dom elements for this box
391
  Box.prototype.dom = function () {
392
- var wrapper = document.createElement('div');
393
- wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';
394
-
395
- var box = document.createElement('div');
396
- box.setAttribute('id', 'boxzilla-' + this.id);
397
- box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;
398
- box.style.display = 'none';
399
- wrapper.appendChild(box);
400
-
401
- var content = document.createElement('div');
402
- content.className = 'boxzilla-content';
403
- content.innerHTML = this.config.content;
404
- box.appendChild(content);
405
-
406
- // remove <script> from box content and append them to the document body
407
- var scripts = content.querySelectorAll('script');
408
- if (scripts.length) {
409
- for (var i = 0; i < scripts.length; i++) {
410
- var script = document.createElement('script');
411
- if (scripts[i].src) {
412
- script.src = scripts[i].src;
413
- }
414
- script.appendChild(document.createTextNode(scripts[i].text));
415
- scripts[i].parentNode.removeChild(scripts[i]);
416
- document.body.appendChild(script);
417
- }
418
- }
419
-
420
- if (this.config.closable && this.config.icon) {
421
- var closeIcon = document.createElement('span');
422
- closeIcon.className = "boxzilla-close-icon";
423
- closeIcon.innerHTML = this.config.icon;
424
- box.appendChild(closeIcon);
425
- this.closeIcon = closeIcon;
426
  }
427
-
428
- document.body.appendChild(wrapper);
429
- this.contentElement = content;
430
- this.element = box;
 
 
 
 
 
 
 
 
 
431
  };
432
 
433
  // set (calculate) custom box styling depending on box options
434
  Box.prototype.setCustomBoxStyling = function () {
435
 
436
- // reset element to its initial state
437
- var origDisplay = this.element.style.display;
438
- this.element.style.display = '';
439
- this.element.style.overflowY = 'auto';
440
- this.element.style.maxHeight = 'none';
441
-
442
- // get new dimensions
443
- var windowHeight = window.innerHeight;
444
- var boxHeight = this.element.clientHeight;
445
-
446
- // add scrollbar to box and limit height
447
- if (boxHeight > windowHeight) {
448
- this.element.style.maxHeight = windowHeight + "px";
449
- this.element.style.overflowY = 'scroll';
450
- }
451
-
452
- // set new top margin for boxes which are centered
453
- if (this.config.position === 'center') {
454
- var newTopMargin = (windowHeight - boxHeight) / 2;
455
- newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;
456
- this.element.style.marginTop = newTopMargin + "px";
457
- }
458
-
459
- this.element.style.display = origDisplay;
460
  };
461
 
462
  // toggle visibility of the box
463
  Box.prototype.toggle = function (show) {
464
 
465
- // revert visibility if no explicit argument is given
466
- if (typeof show === "undefined") {
467
- show = !this.visible;
468
- }
469
 
470
- // is box already at desired visibility?
471
- if (show === this.visible) {
472
- return false;
473
- }
474
 
475
- // is box being animated?
476
- if (Animator.animated(this.element)) {
477
- return false;
478
- }
479
 
480
- // if box should be hidden but is not closable, bail.
481
- if (!show && !this.config.closable) {
482
- return false;
483
- }
484
 
485
- // set new visibility status
486
- this.visible = show;
487
 
488
- // calculate new styling rules
489
- this.setCustomBoxStyling();
490
 
491
- // trigger event
492
- Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]);
493
 
494
- // show or hide box using selected animation
495
- if (this.config.position === 'center') {
496
- this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');
497
- Animator.toggle(this.overlay, "fade");
498
- }
499
 
500
- Animator.toggle(this.element, this.config.animation, function () {
501
- if (this.visible) {
502
- return;
503
- }
504
- this.contentElement.innerHTML = this.contentElement.innerHTML;
505
- }.bind(this));
506
 
507
- return true;
508
  };
509
 
510
  // show the box
511
  Box.prototype.show = function () {
512
- return this.toggle(true);
513
  };
514
 
515
  // hide the box
516
  Box.prototype.hide = function () {
517
- return this.toggle(false);
518
  };
519
 
520
  // calculate trigger height
521
  Box.prototype.calculateTriggerHeight = function () {
522
- var triggerHeight = 0;
523
 
 
524
  if (this.config.trigger.method === 'element') {
525
- var triggerElement = document.body.querySelector(this.config.trigger.value);
526
- if (triggerElement) {
527
- var offset = triggerElement.getBoundingClientRect();
528
- triggerHeight = offset.top;
529
- }
530
  } else if (this.config.trigger.method === 'percentage') {
531
- triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();
532
  }
 
533
 
534
- return triggerHeight;
535
  };
536
 
537
  // checks whether window.location.hash equals the box element ID or that of any element inside the box
538
  Box.prototype.locationHashRefersBox = function () {
539
 
540
- if (!window.location.hash || 0 === window.location.hash.length) {
541
- return false;
542
- }
543
 
544
- var elementId = window.location.hash.substring(1);
545
 
546
- // only attempt on strings looking like an ID or classname
547
- var regex = /^[a-zA-Z\-\_0-9]{1,}$/;
548
- if (regex.test(elementId)) {
549
- return false;
550
- }
551
 
552
- if (elementId === this.element.id) {
553
- return true;
554
- } else if (this.element.querySelector('#' + elementId)) {
555
- return true;
556
- }
557
 
558
- return false;
559
  };
560
 
561
  Box.prototype.fits = function () {
562
- if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {
563
- return true;
564
- }
565
 
566
- switch (this.config.screenWidthCondition.condition) {
567
- case "larger":
568
- return window.innerWidth > this.config.screenWidthCondition.value;
569
- case "smaller":
570
- return window.innerWidth < this.config.screenWidthCondition.value;
571
- }
572
 
573
- // meh.. condition should be "smaller" or "larger", just return true.
574
- return true;
 
 
 
 
 
575
  };
576
 
577
  // is this box enabled?
578
  Box.prototype.mayAutoShow = function () {
579
 
580
- if (this.dismissed) {
581
- return false;
582
- }
583
 
584
- // check if box fits on given minimum screen width
585
- if (!this.fits()) {
586
- return false;
587
- }
588
 
589
- // if trigger empty or error in calculating triggerHeight, return false
590
- if (!this.config.trigger) {
591
- return false;
592
- }
593
 
594
- // rely on cookie value (show if not set, don't show if set)
595
- return !this.cookieSet;
596
  };
597
 
598
  Box.prototype.mayRehide = function () {
599
- return this.config.rehide && this.triggered;
600
  };
601
 
602
  Box.prototype.isCookieSet = function () {
603
- // always show on test mode
604
- if (this.config.testMode) {
605
- return false;
606
- }
607
 
608
- // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.
609
- if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {
610
- return false;
611
- }
612
 
613
- var cookieSet = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + 'boxzilla_box_' + this.id + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1") === "true";
614
- return cookieSet;
615
  };
616
 
617
  // set cookie that disables automatically showing the box
618
  Box.prototype.setCookie = function (hours) {
619
- var expiryDate = new Date();
620
- expiryDate.setHours(expiryDate.getHours() + hours);
621
- document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';
622
  };
623
 
624
  Box.prototype.trigger = function () {
625
- var shown = this.show();
626
- if (!shown) {
627
- return;
628
- }
629
-
630
- this.triggered = true;
631
- if (this.config.cookie && this.config.cookie.triggered) {
632
- this.setCookie(this.config.cookie.triggered);
633
- }
634
  };
635
 
636
  /**
637
- * Dismisses the box and optionally sets a cookie.
638
- *
639
- * @param e The event that triggered this dismissal.
640
- * @returns {boolean}
641
- */
642
  Box.prototype.dismiss = function (e) {
643
- // prevent default action
644
- e && e.preventDefault();
645
 
646
- // only dismiss box if it's currently open.
647
- if (!this.visible) {
648
- return false;
649
- }
650
 
651
- // hide box element
652
- this.hide();
653
 
654
- // set cookie
655
- if (this.config.cookie && this.config.cookie.dismissed) {
656
- this.setCookie(this.config.cookie.dismissed);
657
- }
658
 
659
- this.dismissed = true;
660
- Boxzilla.trigger('box.dismiss', [this]);
661
- return true;
662
  };
663
 
664
  module.exports = function (_Boxzilla) {
665
- Boxzilla = _Boxzilla;
666
- return Box;
667
  };
668
 
669
  },{"./animator.js":2}],4:[function(require,module,exports){
@@ -782,7 +780,7 @@ function checkHeightCriteria() {
782
  // recalculate heights and variables based on height
783
  function recalculateHeights() {
784
  boxes.forEach(function (box) {
785
- box.setCustomBoxStyling();
786
  });
787
  }
788
 
280
  'use strict';
281
 
282
  var defaults = {
283
+ 'animation': 'fade',
284
+ 'rehide': false,
285
+ 'content': '',
286
+ 'cookie': null,
287
+ 'icon': '&times',
288
+ 'screenWidthCondition': null,
289
+ 'position': 'center',
290
+ 'testMode': false,
291
+ 'trigger': false,
292
+ 'closable': true
293
  },
294
  Boxzilla,
295
  Animator = require('./animator.js');
296
 
297
  /**
298
+ * Merge 2 objects, values of the latter overwriting the former.
299
+ *
300
+ * @param obj1
301
+ * @param obj2
302
+ * @returns {*}
303
+ */
304
  function merge(obj1, obj2) {
305
+ var obj3 = {};
306
+ for (var attrname in obj1) {
307
+ obj3[attrname] = obj1[attrname];
308
+ }
309
+ for (var attrname in obj2) {
310
+ obj3[attrname] = obj2[attrname];
311
+ }
312
+ return obj3;
313
  }
314
 
315
  /**
316
+ * Get the real height of entire document.
317
+ * @returns {number}
318
+ */
319
  function getDocumentHeight() {
320
+ var body = document.body,
321
+ html = document.documentElement;
322
 
323
+ var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
324
 
325
+ return height;
326
  }
327
 
328
  // Box Object
329
  var Box = function Box(id, config) {
330
+ this.id = id;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
331
 
332
+ // store config values
333
+ this.config = merge(defaults, config);
334
+
335
+ // store ref to overlay
336
+ this.overlay = document.getElementById('boxzilla-overlay');
337
+
338
+ // state
339
+ this.visible = false;
340
+ this.dismissed = false;
341
+ this.triggered = false;
342
+ this.triggerHeight = this.calculateTriggerHeight();
343
+ this.cookieSet = this.isCookieSet();
344
+ this.element = null;
345
+ this.contentElement = null;
346
+ this.closeIcon = null;
347
 
348
+ // create dom elements for this box
349
+ this.dom();
350
 
351
+ // further initialise the box
352
+ this.events();
353
  };
354
 
355
  // initialise the box
356
  Box.prototype.events = function () {
357
+ var box = this;
358
 
359
+ // attach event to "close" icon inside box
360
+ if (this.closeIcon) {
361
+ this.closeIcon.addEventListener('click', this.dismiss.bind(this));
362
+ }
363
 
364
+ this.element.addEventListener('click', function (e) {
365
+ if (e.target.tagName === 'A') {
366
+ Boxzilla.trigger('box.interactions.link', [box, e.target]);
367
+ }
368
+ }, false);
369
 
370
+ this.element.addEventListener('submit', function (e) {
371
+ box.setCookie();
372
+ Boxzilla.trigger('box.interactions.form', [box, e.target]);
373
+ }, false);
374
 
375
+ // maybe show box right away
376
+ if (this.fits() && this.locationHashRefersBox()) {
377
+ window.addEventListener('load', this.show.bind(this));
378
+ }
379
  };
380
 
381
  // generate dom elements for this box
382
  Box.prototype.dom = function () {
383
+ var wrapper = document.createElement('div');
384
+ wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';
385
+
386
+ var box = document.createElement('div');
387
+ box.setAttribute('id', 'boxzilla-' + this.id);
388
+ box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;
389
+ box.style.display = 'none';
390
+ wrapper.appendChild(box);
391
+
392
+ var content = document.createElement('div');
393
+ content.className = 'boxzilla-content';
394
+ content.innerHTML = this.config.content;
395
+ box.appendChild(content);
396
+
397
+ // remove <script> from box content and append them to the document body
398
+ var scripts = content.querySelectorAll('script');
399
+ if (scripts.length) {
400
+ for (var i = 0; i < scripts.length; i++) {
401
+ var script = document.createElement('script');
402
+ if (scripts[i].src) {
403
+ script.src = scripts[i].src;
404
+ }
405
+ script.appendChild(document.createTextNode(scripts[i].text));
406
+ scripts[i].parentNode.removeChild(scripts[i]);
407
+ document.body.appendChild(script);
 
 
 
 
 
 
 
 
 
408
  }
409
+ }
410
+
411
+ if (this.config.closable && this.config.icon) {
412
+ var closeIcon = document.createElement('span');
413
+ closeIcon.className = "boxzilla-close-icon";
414
+ closeIcon.innerHTML = this.config.icon;
415
+ box.appendChild(closeIcon);
416
+ this.closeIcon = closeIcon;
417
+ }
418
+
419
+ document.body.appendChild(wrapper);
420
+ this.contentElement = content;
421
+ this.element = box;
422
  };
423
 
424
  // set (calculate) custom box styling depending on box options
425
  Box.prototype.setCustomBoxStyling = function () {
426
 
427
+ // reset element to its initial state
428
+ var origDisplay = this.element.style.display;
429
+ this.element.style.display = '';
430
+ this.element.style.overflowY = 'auto';
431
+ this.element.style.maxHeight = 'none';
432
+
433
+ // get new dimensions
434
+ var windowHeight = window.innerHeight;
435
+ var boxHeight = this.element.clientHeight;
436
+
437
+ // add scrollbar to box and limit height
438
+ if (boxHeight > windowHeight) {
439
+ this.element.style.maxHeight = windowHeight + "px";
440
+ this.element.style.overflowY = 'scroll';
441
+ }
442
+
443
+ // set new top margin for boxes which are centered
444
+ if (this.config.position === 'center') {
445
+ var newTopMargin = (windowHeight - boxHeight) / 2;
446
+ newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;
447
+ this.element.style.marginTop = newTopMargin + "px";
448
+ }
449
+
450
+ this.element.style.display = origDisplay;
451
  };
452
 
453
  // toggle visibility of the box
454
  Box.prototype.toggle = function (show) {
455
 
456
+ // revert visibility if no explicit argument is given
457
+ if (typeof show === "undefined") {
458
+ show = !this.visible;
459
+ }
460
 
461
+ // is box already at desired visibility?
462
+ if (show === this.visible) {
463
+ return false;
464
+ }
465
 
466
+ // is box being animated?
467
+ if (Animator.animated(this.element)) {
468
+ return false;
469
+ }
470
 
471
+ // if box should be hidden but is not closable, bail.
472
+ if (!show && !this.config.closable) {
473
+ return false;
474
+ }
475
 
476
+ // set new visibility status
477
+ this.visible = show;
478
 
479
+ // calculate new styling rules
480
+ this.setCustomBoxStyling();
481
 
482
+ // trigger event
483
+ Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]);
484
 
485
+ // show or hide box using selected animation
486
+ if (this.config.position === 'center') {
487
+ this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');
488
+ Animator.toggle(this.overlay, "fade");
489
+ }
490
 
491
+ Animator.toggle(this.element, this.config.animation, function () {
492
+ if (this.visible) {
493
+ return;
494
+ }
495
+ this.contentElement.innerHTML = this.contentElement.innerHTML;
496
+ }.bind(this));
497
 
498
+ return true;
499
  };
500
 
501
  // show the box
502
  Box.prototype.show = function () {
503
+ return this.toggle(true);
504
  };
505
 
506
  // hide the box
507
  Box.prototype.hide = function () {
508
+ return this.toggle(false);
509
  };
510
 
511
  // calculate trigger height
512
  Box.prototype.calculateTriggerHeight = function () {
513
+ var triggerHeight = 0;
514
 
515
+ if (this.config.trigger) {
516
  if (this.config.trigger.method === 'element') {
517
+ var triggerElement = document.body.querySelector(this.config.trigger.value);
518
+ if (triggerElement) {
519
+ var offset = triggerElement.getBoundingClientRect();
520
+ triggerHeight = offset.top;
521
+ }
522
  } else if (this.config.trigger.method === 'percentage') {
523
+ triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();
524
  }
525
+ }
526
 
527
+ return triggerHeight;
528
  };
529
 
530
  // checks whether window.location.hash equals the box element ID or that of any element inside the box
531
  Box.prototype.locationHashRefersBox = function () {
532
 
533
+ if (!window.location.hash || 0 === window.location.hash.length) {
534
+ return false;
535
+ }
536
 
537
+ var elementId = window.location.hash.substring(1);
538
 
539
+ // only attempt on strings looking like an ID or classname
540
+ var regex = /^[a-zA-Z\-\_0-9]{1,}$/;
541
+ if (regex.test(elementId)) {
542
+ return false;
543
+ }
544
 
545
+ if (elementId === this.element.id) {
546
+ return true;
547
+ } else if (this.element.querySelector('#' + elementId)) {
548
+ return true;
549
+ }
550
 
551
+ return false;
552
  };
553
 
554
  Box.prototype.fits = function () {
555
+ if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {
556
+ return true;
557
+ }
558
 
559
+ switch (this.config.screenWidthCondition.condition) {
560
+ case "larger":
561
+ return window.innerWidth > this.config.screenWidthCondition.value;
562
+ case "smaller":
563
+ return window.innerWidth < this.config.screenWidthCondition.value;
564
+ }
565
 
566
+ // meh.. condition should be "smaller" or "larger", just return true.
567
+ return true;
568
+ };
569
+
570
+ Box.prototype.onResize = function () {
571
+ this.triggerHeight = this.calculateTriggerHeight();
572
+ this.setCustomBoxStyling();
573
  };
574
 
575
  // is this box enabled?
576
  Box.prototype.mayAutoShow = function () {
577
 
578
+ if (this.dismissed) {
579
+ return false;
580
+ }
581
 
582
+ // check if box fits on given minimum screen width
583
+ if (!this.fits()) {
584
+ return false;
585
+ }
586
 
587
+ // if trigger empty or error in calculating triggerHeight, return false
588
+ if (!this.config.trigger) {
589
+ return false;
590
+ }
591
 
592
+ // rely on cookie value (show if not set, don't show if set)
593
+ return !this.cookieSet;
594
  };
595
 
596
  Box.prototype.mayRehide = function () {
597
+ return this.config.rehide && this.triggered;
598
  };
599
 
600
  Box.prototype.isCookieSet = function () {
601
+ // always show on test mode or when no auto-trigger is configured
602
+ if (this.config.testMode || !this.config.trigger) {
603
+ return false;
604
+ }
605
 
606
+ // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.
607
+ if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {
608
+ return false;
609
+ }
610
 
611
+ var cookieSet = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + 'boxzilla_box_' + this.id + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1") === "true";
612
+ return cookieSet;
613
  };
614
 
615
  // set cookie that disables automatically showing the box
616
  Box.prototype.setCookie = function (hours) {
617
+ var expiryDate = new Date();
618
+ expiryDate.setHours(expiryDate.getHours() + hours);
619
+ document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';
620
  };
621
 
622
  Box.prototype.trigger = function () {
623
+ var shown = this.show();
624
+ if (!shown) {
625
+ return;
626
+ }
627
+
628
+ this.triggered = true;
629
+ if (this.config.cookie && this.config.cookie.triggered) {
630
+ this.setCookie(this.config.cookie.triggered);
631
+ }
632
  };
633
 
634
  /**
635
+ * Dismisses the box and optionally sets a cookie.
636
+ *
637
+ * @param e The event that triggered this dismissal.
638
+ * @returns {boolean}
639
+ */
640
  Box.prototype.dismiss = function (e) {
641
+ // prevent default action
642
+ e && e.preventDefault();
643
 
644
+ // only dismiss box if it's currently open.
645
+ if (!this.visible) {
646
+ return false;
647
+ }
648
 
649
+ // hide box element
650
+ this.hide();
651
 
652
+ // set cookie
653
+ if (this.config.cookie && this.config.cookie.dismissed) {
654
+ this.setCookie(this.config.cookie.dismissed);
655
+ }
656
 
657
+ this.dismissed = true;
658
+ Boxzilla.trigger('box.dismiss', [this]);
659
+ return true;
660
  };
661
 
662
  module.exports = function (_Boxzilla) {
663
+ Boxzilla = _Boxzilla;
664
+ return Box;
665
  };
666
 
667
  },{"./animator.js":2}],4:[function(require,module,exports){
780
  // recalculate heights and variables based on height
781
  function recalculateHeights() {
782
  boxes.forEach(function (box) {
783
+ box.onResize();
784
  });
785
  }
786
 
assets/js/script.min.js CHANGED
@@ -1,2 +1,2 @@
1
- !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 h=n[a]={exports:{}};e[a][0].call(h.exports,function(t){var i=e[a][1][t];return r(i?i:t)},h,h.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){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){function e(t,e){e.background_color&&(t.style.background=e.background_color),e.color&&(t.style.color=e.color),e.border_color&&(t.style.borderColor=e.border_color),e.border_width&&(t.style.borderWidth=parseInt(e.border_width)+"px"),e.border_style&&(t.style.borderStyle=e.border_style),e.width&&(t.style.maxWidth=parseInt(e.width)+"px")}function i(){var t=document.body.className.indexOf("logged-in")>-1;if(!s.inited){t&&s.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),r.init();for(var i=0;i<s.boxes.length;i++){var n=s.boxes[i];if(n.testMode=t&&s.testMode,"https:"===window.location.protocol&&window.location.host){var o="http://"+window.location.host,a=o.replace("http://","https://");n.content=n.content.replace(o,a)}var l=r.create(n.id,n);l.element.className=l.element.className+" boxzilla-"+n.post.slug,e(l.element,n.css),l.element.firstChild.firstChild.className+=" first-child",l.element.firstChild.lastChild.className+=" last-child"}s.inited=!0,r.trigger("done")}}function o(){if("object"===n(window.mc4wp_forms_config)&&window.mc4wp_forms_config.submitted_form){var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=r.boxes;for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];if(o.element.querySelector(t))return void o.show()}}}var r=t("boxzilla"),s=window.boxzilla_options;window.Boxzilla=r,window.addEventListener("load",o),i()}()},{boxzilla:4}],2:[function(t,e,i){"use strict";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,i){var s="none"!=t.style.display||t.offsetLeft>0,a=t.cloneNode(!0),c=function(){t.removeAttribute("data-animated"),t.setAttribute("style",a.getAttribute("style")),t.style.display=s?"none":"",i&&i()};t.setAttribute("data-animated","true"),s||(t.style.display="");var d,h;if("slide"===e){if(d=o(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),h={},!s){var f=window.getComputedStyle(t);if(h=r(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f),!isFinite(h.height)){var u=t.getBoundingClientRect();h.height=u.height}n(t,d)}t.style.overflowY="hidden",l(t,s?d:h,c)}else d={opacity:0},h={opacity:1},s||n(t,d),l(t,s?d:h,c)}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 h=function f(){var o,a,l,c,d=+new Date,h=d-n,u=!0;for(var g in e){o=s[g],a=e[g],l=o*h,c=r[g]+l,o>0&&c>=a||o<0&&c<=a?c=a:u=!1,r[g]=c;var m="opacity"!==g?"px":"";t.style[g]=c+m}n=+new Date,u?i&&i():window.requestAnimationFrame&&requestAnimationFrame(f)||setTimeout(f,32)};h()}var c=320;e.exports={toggle:a,animate:l,animated:s}},{}],3:[function(t,e,i){"use strict";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",screenWidthCondition:null,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.contentElement=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",this.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),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=0;o<n.length;o++){var r=document.createElement("script");n[o].src&&(r.src=n[o].src),r.appendChild(document.createTextNode(n[o].text)),n[o].parentNode.removeChild(n[o]),document.body.appendChild(r)}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.contentElement=i,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){return"undefined"==typeof t&&(t=!this.visible),t!==this.visible&&(!a.animated(this.element)&&(!(!t&&!this.config.closable)&&(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,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)),!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),e=/^[a-zA-Z\-\_0-9]{1,}$/;return!e.test(t)&&(t===this.element.id||!!this.element.querySelector("#"+t))},l.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},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){"use strict";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&&E.dismiss()}function r(){f()||_.forEach(function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&w>=t.config.trigger.value&&t.trigger()})}function s(){f()||_.forEach(function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&b.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&y.time>=t.config.trigger.value&&t.trigger())})}function a(){var t=C.hasOwnProperty("pageYOffset")?C.pageYOffset:C.scrollTop;t+=.9*window.innerHeight,_.forEach(function(e){if(e.mayAutoShow()&&!(e.triggerHeight<=0))if(t>e.triggerHeight){if(f())return;e.trigger()}else e.mayRehide()&&e.hide()})}function 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=40;(e<n.left-o||e>n.right+o||i<n.top-o||i>n.bottom+o)&&t.dismiss()})}function d(){v||f()||(_.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()}),v=!0)}function h(t){var e=400;t.clientY<=0&&(p=window.setTimeout(d,e))}function f(){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)}function g(t){for(var e=t.target||t.srcElement,i=3,n=0;n<=i&&(e&&"A"!==e.tagName);n++)e=e.parentElement;if(e&&"A"===e.tagName&&e.getAttribute("href")&&0===e.getAttribute("href").toLowerCase().indexOf("#boxzilla-")){var o=e.getAttribute("href").toLowerCase().substring("#boxzilla-".length);E.toggle(o)}}var m,p,v,b,y,w,x=t("wolfy87-eventemitter"),E=Object.create(x.prototype),z=t("./box.js")(E),L=t("./timer.js"),_=[],C=window,k={start:function(){try{var t=sessionStorage.getItem("boxzilla_timer");t&&(b.time=t)}catch(e){}b.start(),y.start()},stop:function(){sessionStorage.setItem("boxzilla_timer",b.time),b.stop(),y.stop()}};E.init=function(){document.body.addEventListener("click",g,!1);try{w=sessionStorage.getItem("boxzilla_pageviews")||0}catch(e){w=0}b=new L(0),y=new L(0);var i=t("./styles.js"),d=document.createElement("style");d.setAttribute("type","text/css"),d.innerHTML=i,document.head.appendChild(d),m=document.createElement("div"),m.style.display="none",m.id="boxzilla-overlay",document.body.appendChild(m),C.addEventListener("touchstart",n(a),!0),C.addEventListener("scroll",n(a),!0),window.addEventListener("resize",n(l)),window.addEventListener("load",l),m.addEventListener("click",c),window.setInterval(s,1e3),window.setTimeout(r,1e3),document.documentElement.addEventListener("mouseleave",h),document.documentElement.addEventListener("mouseenter",u),document.addEventListener("keyup",o),k.start(),window.addEventListener("focus",k.start),window.addEventListener("beforeunload",function(){k.stop(),sessionStorage.setItem("boxzilla_pageviews",++w)}),window.addEventListener("blur",k.stop),E.trigger("ready")},E.create=function(t,e){"undefined"!=typeof e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new z(t,e);return _.push(i),i},E.get=function(t){for(var e=0;e<_.length;e++){var i=_[e];if(i.id==t)return i}throw new Error("No box exists with ID "+t)},E.dismiss=function(t){"undefined"==typeof t?_.forEach(function(t){t.dismiss()}):E.get(t).dismiss()},E.hide=function(t){"undefined"==typeof t?_.forEach(function(t){t.hide()}):E.get(t).hide()},E.show=function(t){"undefined"==typeof t?_.forEach(function(t){t.show()}):E.get(t).show()},E.toggle=function(t){"undefined"==typeof t?_.forEach(function(t){t.toggle()}):E.get(t).toggle()},E.boxes=_,window.Boxzilla=E,"undefined"!=typeof e&&e.exports&&(e.exports=E)},{"./box.js":3,"./styles.js":5,"./timer.js":6,"wolfy87-eventemitter":7}],5:[function(t,e,i){"use strict";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){"use strict";var n=function(t){this.time=t,this.interval=0};n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}],7:[function(t,i,n){(function(){"use strict";function t(){}function n(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}var r=t.prototype,s=this,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"==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"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},r.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},r.removeAllListeners=o("removeEvent"),r.emitEvent=function(t,e){var i,n,o,r,s,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"==typeof i&&i.exports?i.exports=t:s.EventEmitter=t}).call(this)},{}]},{},[1])}();
2
  //# sourceMappingURL=script.min.js.map
1
+ !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 h=n[a]={exports:{}};e[a][0].call(h.exports,function(t){var i=e[a][1][t];return r(i?i:t)},h,h.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){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){function e(t,e){e.background_color&&(t.style.background=e.background_color),e.color&&(t.style.color=e.color),e.border_color&&(t.style.borderColor=e.border_color),e.border_width&&(t.style.borderWidth=parseInt(e.border_width)+"px"),e.border_style&&(t.style.borderStyle=e.border_style),e.width&&(t.style.maxWidth=parseInt(e.width)+"px")}function i(){var t=document.body.className.indexOf("logged-in")>-1;if(!s.inited){t&&s.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),r.init();for(var i=0;i<s.boxes.length;i++){var n=s.boxes[i];if(n.testMode=t&&s.testMode,"https:"===window.location.protocol&&window.location.host){var o="http://"+window.location.host,a=o.replace("http://","https://");n.content=n.content.replace(o,a)}var l=r.create(n.id,n);l.element.className=l.element.className+" boxzilla-"+n.post.slug,e(l.element,n.css),l.element.firstChild.firstChild.className+=" first-child",l.element.firstChild.lastChild.className+=" last-child"}s.inited=!0,r.trigger("done")}}function o(){if("object"===n(window.mc4wp_forms_config)&&window.mc4wp_forms_config.submitted_form){var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=r.boxes;for(var i in e)if(e.hasOwnProperty(i)){var o=e[i];if(o.element.querySelector(t))return void o.show()}}}var r=t("boxzilla"),s=window.boxzilla_options;window.Boxzilla=r,window.addEventListener("load",o),i()}()},{boxzilla:4}],2:[function(t,e,i){"use strict";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,i){var s="none"!=t.style.display||t.offsetLeft>0,a=t.cloneNode(!0),c=function(){t.removeAttribute("data-animated"),t.setAttribute("style",a.getAttribute("style")),t.style.display=s?"none":"",i&&i()};t.setAttribute("data-animated","true"),s||(t.style.display="");var d,h;if("slide"===e){if(d=o(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),h={},!s){var f=window.getComputedStyle(t);if(h=r(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f),!isFinite(h.height)){var u=t.getBoundingClientRect();h.height=u.height}n(t,d)}t.style.overflowY="hidden",l(t,s?d:h,c)}else d={opacity:0},h={opacity:1},s||n(t,d),l(t,s?d:h,c)}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 h=function f(){var o,a,l,c,d=+new Date,h=d-n,u=!0;for(var g in e){o=s[g],a=e[g],l=o*h,c=r[g]+l,o>0&&c>=a||o<0&&c<=a?c=a:u=!1,r[g]=c;var m="opacity"!==g?"px":"";t.style[g]=c+m}n=+new Date,u?i&&i():window.requestAnimationFrame&&requestAnimationFrame(f)||setTimeout(f,32)};h()}var c=320;e.exports={toggle:a,animate:l,animated:s}},{}],3:[function(t,e,i){"use strict";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",screenWidthCondition:null,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=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()};l.prototype.events=function(){var t=this;this.closeIcon&&this.closeIcon.addEventListener("click",this.dismiss.bind(this)),this.element.addEventListener("click",function(e){"A"===e.target.tagName&&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),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=0;o<n.length;o++){var r=document.createElement("script");n[o].src&&(r.src=n[o].src),r.appendChild(document.createTextNode(n[o].text)),n[o].parentNode.removeChild(n[o]),document.body.appendChild(r)}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.contentElement=i,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){return"undefined"==typeof t&&(t=!this.visible),t!==this.visible&&(!a.animated(this.element)&&(!(!t&&!this.config.closable)&&(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,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)),!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(this.config.trigger)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),e=/^[a-zA-Z\-\_0-9]{1,}$/;return!e.test(t)&&(t===this.element.id||!!this.element.querySelector("#"+t))},l.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},l.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},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||!this.config.trigger)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){"use strict";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&&E.dismiss()}function r(){f()||_.forEach(function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&w>=t.config.trigger.value&&t.trigger()})}function s(){f()||_.forEach(function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&b.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&y.time>=t.config.trigger.value&&t.trigger())})}function a(){var t=C.hasOwnProperty("pageYOffset")?C.pageYOffset:C.scrollTop;t+=.9*window.innerHeight,_.forEach(function(e){if(e.mayAutoShow()&&!(e.triggerHeight<=0))if(t>e.triggerHeight){if(f())return;e.trigger()}else e.mayRehide()&&e.hide()})}function l(){_.forEach(function(t){t.onResize()})}function c(t){var e=t.offsetX,i=t.offsetY;_.forEach(function(t){var n=t.element.getBoundingClientRect(),o=40;(e<n.left-o||e>n.right+o||i<n.top-o||i>n.bottom+o)&&t.dismiss()})}function d(){v||f()||(_.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()}),v=!0)}function h(t){var e=400;t.clientY<=0&&(p=window.setTimeout(d,e))}function f(){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)}function g(t){for(var e=t.target||t.srcElement,i=3,n=0;n<=i&&(e&&"A"!==e.tagName);n++)e=e.parentElement;if(e&&"A"===e.tagName&&e.getAttribute("href")&&0===e.getAttribute("href").toLowerCase().indexOf("#boxzilla-")){var o=e.getAttribute("href").toLowerCase().substring("#boxzilla-".length);E.toggle(o)}}var m,p,v,b,y,w,x=t("wolfy87-eventemitter"),E=Object.create(x.prototype),z=t("./box.js")(E),L=t("./timer.js"),_=[],C=window,k={start:function(){try{var t=sessionStorage.getItem("boxzilla_timer");t&&(b.time=t)}catch(e){}b.start(),y.start()},stop:function(){sessionStorage.setItem("boxzilla_timer",b.time),b.stop(),y.stop()}};E.init=function(){document.body.addEventListener("click",g,!1);try{w=sessionStorage.getItem("boxzilla_pageviews")||0}catch(e){w=0}b=new L(0),y=new L(0);var i=t("./styles.js"),d=document.createElement("style");d.setAttribute("type","text/css"),d.innerHTML=i,document.head.appendChild(d),m=document.createElement("div"),m.style.display="none",m.id="boxzilla-overlay",document.body.appendChild(m),C.addEventListener("touchstart",n(a),!0),C.addEventListener("scroll",n(a),!0),window.addEventListener("resize",n(l)),window.addEventListener("load",l),m.addEventListener("click",c),window.setInterval(s,1e3),window.setTimeout(r,1e3),document.documentElement.addEventListener("mouseleave",h),document.documentElement.addEventListener("mouseenter",u),document.addEventListener("keyup",o),k.start(),window.addEventListener("focus",k.start),window.addEventListener("beforeunload",function(){k.stop(),sessionStorage.setItem("boxzilla_pageviews",++w)}),window.addEventListener("blur",k.stop),E.trigger("ready")},E.create=function(t,e){"undefined"!=typeof e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new z(t,e);return _.push(i),i},E.get=function(t){for(var e=0;e<_.length;e++){var i=_[e];if(i.id==t)return i}throw new Error("No box exists with ID "+t)},E.dismiss=function(t){"undefined"==typeof t?_.forEach(function(t){t.dismiss()}):E.get(t).dismiss()},E.hide=function(t){"undefined"==typeof t?_.forEach(function(t){t.hide()}):E.get(t).hide()},E.show=function(t){"undefined"==typeof t?_.forEach(function(t){t.show()}):E.get(t).show()},E.toggle=function(t){"undefined"==typeof t?_.forEach(function(t){t.toggle()}):E.get(t).toggle()},E.boxes=_,window.Boxzilla=E,"undefined"!=typeof e&&e.exports&&(e.exports=E)},{"./box.js":3,"./styles.js":5,"./timer.js":6,"wolfy87-eventemitter":7}],5:[function(t,e,i){"use strict";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){"use strict";var n=function(t){this.time=t,this.interval=0};n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}],7:[function(t,i,n){(function(){"use strict";function t(){}function n(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}var r=t.prototype,s=this,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"==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"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},r.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},r.removeAllListeners=o("removeEvent"),r.emitEvent=function(t,e){var i,n,o,r,s,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"==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":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","_typeof","Symbol","iterator","obj","constructor","prototype","css","element","styles","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","createBoxesFromConfig","isLoggedIn","document","body","className","indexOf","options","inited","testMode","console","log","Boxzilla","init","boxes","boxOpts","window","location","protocol","host","replace","content","box","create","id","post","slug","firstChild","lastChild","trigger","openMailChimpForWordPressBox","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","querySelector","show","boxzilla_options","addEventListener","boxzilla","2","property","initObjectProperties","properties","value","newObject","copyObjectProperties","object","animated","getAttribute","toggle","animation","callbackFn","nowVisible","display","offsetLeft","clone","cloneNode","cleanup","removeAttribute","setAttribute","hiddenStyles","visibleStyles","computedStyles","getComputedStyle","isFinite","height","clientRect","getBoundingClientRect","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","Math","max","scrollHeight","offsetHeight","clientHeight","defaults","rehide","cookie","icon","screenWidthCondition","position","closable","Animator","Box","config","this","overlay","getElementById","visible","dismissed","triggered","triggerHeight","cookieSet","contentElement","closeIcon","method","calculateTriggerHeight","isCookieSet","dom","events","dismiss","bind","target","tagName","setCookie","fits","locationHashRefersBox","wrapper","createElement","appendChild","innerHTML","scripts","querySelectorAll","script","src","createTextNode","text","parentNode","removeChild","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","newTopMargin","marginTop","classList","hide","triggerElement","offset","top","hash","elementId","substring","regex","test","condition","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","scrollElement","pageYOffset","scrollTop","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","margin","left","right","bottom","triggerExitIntent","exitIntentTriggered","onMouseLeave","delay","clientY","exitIntentDelayTimer","onMouseEnter","clearInterval","onElementClick","el","srcElement","depth","parentElement","toLowerCase","EventEmitter","Object","Timer","timers","start","sessionTime","sessionStorage","getItem","stop","setItem","styleElement","head","setInterval","opts","minimumScreenWidth","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","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":"CAAA,WAAe,GAAIA,GAAUC,OAAgEC,EAASD,QAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG,IAAIQ,WAAYZ,GAAEI,GAA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E,WAAa,WAEtB,MADA3U,GAAQqQ,aAAe+B,EAChB/B,GAIW,kBAAXnR,IAAyBA,EAAO0V,IACvC1V,EAAO,WACH,MAAOmR,KAGY,gBAAXjQ,IAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAUqQ,EAGjBrQ,EAAQqQ,aAAeA,IAE7BpQ,KAAKgJ,gBAEI","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n(function () {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n var options = window.boxzilla_options;\n\n // expose Boxzilla object to window\n window.Boxzilla = Boxzilla;\n\n // helper function for setting CSS styles\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n function createBoxesFromConfig() {\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n // failsafe against including script twice.\n if (options.inited) {\n return;\n }\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 = o.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 box slug to box element as classname\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug;\n\n // add custom css to box\n css(box.element, boxOpts.css);\n\n box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n }\n\n // set flag to prevent initialising twice\n options.inited = true;\n\n // trigger \"done\" event.\n Boxzilla.trigger('done');\n }\n\n function openMailChimpForWordPressBox() {\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.addEventListener('load', openMailChimpForWordPressBox);\n createBoxesFromConfig();\n})();\n\n},{\"boxzilla\":4}],2:[function(require,module,exports){\n'use strict';\n\nvar duration = 320;\n\nfunction css(element, styles) {\n for (var property in styles) {\n element.style[property] = styles[property];\n }\n}\n\nfunction initObjectProperties(properties, value) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n return newObject;\n}\n\nfunction copyObjectProperties(properties, object) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n return newObject;\n}\n\n/**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\nfunction animated(element) {\n return !!element.getAttribute('data-animated');\n}\n\n/**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n */\nfunction toggle(element, animation, callbackFn) {\n var nowVisible = element.style.display != 'none' || element.offsetLeft > 0;\n\n // create clone for reference\n var clone = element.cloneNode(true);\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n if (callbackFn) {\n callbackFn();\n }\n };\n\n // store attribute so everyone knows we're animating this element\n element.setAttribute('data-animated', \"true\");\n\n // toggle element visiblity right away if we're making something visible\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles, visibleStyles;\n\n // animate properties\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles);\n\n // in some browsers, getComputedStyle returns \"auto\" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.\n if (!isFinite(visibleStyles.height)) {\n var clientRect = element.getBoundingClientRect();\n visibleStyles.height = clientRect.height;\n }\n css(element, hiddenStyles);\n }\n\n // don't show a scrollbar during animation\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = { opacity: 0 };\n visibleStyles = { opacity: 1 };\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n}\n\nfunction animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n // make sure we have an object filled with floats\n targetStyles[property] = parseFloat(targetStyles[property]);\n\n // calculate step size & current value\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]);\n\n // is there something to do?\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n\n var step, to, increment, newValue;\n for (var property in targetStyles) {\n step = propSteps[property];\n to = targetStyles[property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n }\n\n // store new value\n currentStyles[property] = newValue;\n\n var suffix = property !== \"opacity\" ? \"px\" : \"\";\n element.style[property] = newValue + suffix;\n }\n\n last = +new Date();\n\n // keep going until we're done for all props\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n}\n\nmodule.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n};\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'screenWidthCondition': null,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n},\n Boxzilla,\n Animator = require('./animator.js');\n\n/**\n * Merge 2 objects, values of the latter overwriting the former.\n *\n * @param obj1\n * @param obj2\n * @returns {*}\n */\nfunction merge(obj1, obj2) {\n var obj3 = {};\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n return obj3;\n}\n\n/**\n * Get the real height of entire document.\n * @returns {number}\n */\nfunction getDocumentHeight() {\n var body = document.body,\n html = document.documentElement;\n\n var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n\n return height;\n}\n\n// Box Object\nvar Box = function Box(id, config) {\n this.id = id;\n\n // store config values\n this.config = merge(defaults, config);\n\n // store ref to overlay\n this.overlay = document.getElementById('boxzilla-overlay');\n\n // state\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = 0;\n this.cookieSet = false;\n this.element = null;\n this.contentElement = 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\nBox.prototype.events = function () {\n var box = this;\n\n // attach event to \"close\" icon inside box\n if (this.closeIcon) {\n this.closeIcon.addEventListener('click', this.dismiss.bind(this));\n }\n\n this.element.addEventListener('click', function (e) {\n if (e.target.tagName === 'A') {\n Boxzilla.trigger('box.interactions.link', [box, e.target]);\n }\n }, false);\n\n this.element.addEventListener('submit', function (e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [box, e.target]);\n }, false);\n\n // 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\nBox.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n\n var content = document.createElement('div');\n content.className = 'boxzilla-content';\n content.innerHTML = this.config.content;\n box.appendChild(content);\n\n // remove <script> from box content and append them to the document body\n var scripts = content.querySelectorAll('script');\n if (scripts.length) {\n for (var i = 0; i < scripts.length; i++) {\n var script = document.createElement('script');\n if (scripts[i].src) {\n script.src = scripts[i].src;\n }\n script.appendChild(document.createTextNode(scripts[i].text));\n scripts[i].parentNode.removeChild(scripts[i]);\n document.body.appendChild(script);\n }\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.contentElement = content;\n this.element = box;\n};\n\n// set (calculate) custom box styling depending on box options\nBox.prototype.setCustomBoxStyling = function () {\n\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = 'auto';\n this.element.style.maxHeight = 'none';\n\n // get new dimensions\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight;\n\n // add scrollbar to box and limit height\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n }\n\n // set new top margin for boxes which are centered\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n};\n\n// toggle visibility of the box\nBox.prototype.toggle = function (show) {\n\n // revert visibility if no explicit argument is given\n if (typeof show === \"undefined\") {\n show = !this.visible;\n }\n\n // is box already at desired visibility?\n if (show === this.visible) {\n return false;\n }\n\n // is box being animated?\n if (Animator.animated(this.element)) {\n return false;\n }\n\n // if box should be hidden but is not closable, bail.\n if (!show && !this.config.closable) {\n return false;\n }\n\n // set new visibility status\n this.visible = show;\n\n // calculate new styling rules\n this.setCustomBoxStyling();\n\n // trigger event\n Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]);\n\n // show or hide box using selected animation\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n Animator.toggle(this.overlay, \"fade\");\n }\n\n Animator.toggle(this.element, this.config.animation, function () {\n if (this.visible) {\n return;\n }\n this.contentElement.innerHTML = this.contentElement.innerHTML;\n }.bind(this));\n\n return true;\n};\n\n// show the box\nBox.prototype.show = function () {\n return this.toggle(true);\n};\n\n// hide the box\nBox.prototype.hide = function () {\n return this.toggle(false);\n};\n\n// calculate trigger height\nBox.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger.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\nBox.prototype.locationHashRefersBox = function () {\n\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n }\n\n var elementId = window.location.hash.substring(1);\n\n // only attempt on strings looking like an ID or classname\n var regex = /^[a-zA-Z\\-\\_0-9]{1,}$/;\n if (regex.test(elementId)) {\n return false;\n }\n\n if (elementId === this.element.id) {\n return true;\n } else if (this.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n};\n\nBox.prototype.fits = function () {\n if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {\n return true;\n }\n\n switch (this.config.screenWidthCondition.condition) {\n case \"larger\":\n return window.innerWidth > this.config.screenWidthCondition.value;\n case \"smaller\":\n return window.innerWidth < this.config.screenWidthCondition.value;\n }\n\n // meh.. condition should be \"smaller\" or \"larger\", just return true.\n return true;\n};\n\n// is this box enabled?\nBox.prototype.mayAutoShow = function () {\n\n if (this.dismissed) {\n return false;\n }\n\n // check if box fits on given minimum screen width\n if (!this.fits()) {\n return false;\n }\n\n // if trigger empty or error in calculating triggerHeight, return false\n if (!this.config.trigger) {\n return false;\n }\n\n // rely on cookie value (show if not set, don't show if set)\n return !this.cookieSet;\n};\n\nBox.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function () {\n // always show on test mode\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\nBox.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n};\n\nBox.prototype.trigger = function () {\n var shown = this.show();\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n};\n\n/**\n * Dismisses the box and optionally sets a cookie.\n *\n * @param e The event that triggered this dismissal.\n * @returns {boolean}\n */\nBox.prototype.dismiss = function (e) {\n // prevent default action\n e && e.preventDefault();\n\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n }\n\n // hide box element\n this.hide();\n\n // set cookie\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n Boxzilla.trigger('box.dismiss', [this]);\n return true;\n};\n\nmodule.exports = function (_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n};\n\n},{\"./animator.js\":2}],4:[function(require,module,exports){\n'use strict';\n\nvar EventEmitter = require('wolfy87-eventemitter'),\n Boxzilla = Object.create(EventEmitter.prototype),\n Box = require('./box.js')(Boxzilla),\n Timer = require('./timer.js'),\n boxes = [],\n overlay,\n scrollElement = window,\n exitIntentDelayTimer,\n exitIntentTriggered,\n siteTimer,\n pageTimer,\n pageViews;\n\nfunction throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n\n var now = +new Date(),\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n}\n\n// \"keyup\" listener\nfunction onKeyUp(e) {\n if (e.keyCode == 27) {\n Boxzilla.dismiss();\n }\n}\n\n// check \"pageviews\" criteria for each box\nfunction checkPageViewsCriteria() {\n\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {\n box.trigger();\n }\n });\n}\n\n// check time trigger criteria for each box\nfunction checkTimeCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n // check \"time on site\" trigger\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n\n // check \"time on page\" trigger\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n}\n\n// check triggerHeight criteria for all boxes\nfunction checkHeightCriteria() {\n\n var scrollY = scrollElement.hasOwnProperty('pageYOffset') ? scrollElement.pageYOffset : scrollElement.scrollTop;\n scrollY = scrollY + window.innerHeight * 0.9;\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n // trigger box\n box.trigger();\n } else if (box.mayRehide()) {\n box.hide();\n }\n });\n}\n\n// recalculate heights and variables based on height\nfunction recalculateHeights() {\n boxes.forEach(function (box) {\n box.setCustomBoxStyling();\n });\n}\n\nfunction onOverlayClick(e) {\n var x = e.offsetX;\n var y = e.offsetY;\n\n // calculate if click was less than 40px outside box to avoid closing it by accident\n boxes.forEach(function (box) {\n var rect = box.element.getBoundingClientRect();\n var margin = 40;\n\n // if click was not anywhere near box, dismiss it.\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n}\n\nfunction triggerExitIntent() {\n // do nothing if already triggered OR another box is visible.\n if (exitIntentTriggered || isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n\n exitIntentTriggered = true;\n}\n\nfunction onMouseLeave(e) {\n var delay = 400;\n\n // did mouse leave at top of window?\n if (e.clientY <= 0) {\n exitIntentDelayTimer = window.setTimeout(triggerExitIntent, delay);\n }\n}\n\nfunction isAnyBoxVisible() {\n\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n\n if (box.visible) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction onMouseEnter() {\n if (exitIntentDelayTimer) {\n window.clearInterval(exitIntentDelayTimer);\n exitIntentDelayTimer = null;\n }\n}\n\nfunction onElementClick(e) {\n // find <a> element in up to 3 parent elements\n var el = e.target || e.srcElement;\n var depth = 3;\n for (var i = 0; i <= depth; i++) {\n if (!el || el.tagName === 'A') {\n break;\n }\n\n el = el.parentElement;\n }\n\n if (!el || el.tagName !== 'A' || !el.getAttribute('href')) {\n return;\n }\n\n if (el.getAttribute('href').toLowerCase().indexOf('#boxzilla-') === 0) {\n var boxId = el.getAttribute('href').toLowerCase().substring(\"#boxzilla-\".length);\n Boxzilla.toggle(boxId);\n }\n}\n\nvar timers = {\n start: function start() {\n try {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if (sessionTime) siteTimer.time = sessionTime;\n } catch (e) {}\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n};\n\n// initialise & add event listeners\nBoxzilla.init = function () {\n document.body.addEventListener('click', onElementClick, false);\n\n try {\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n } catch (e) {\n pageViews = 0;\n }\n\n siteTimer = new Timer(0);\n pageTimer = new Timer(0);\n\n // insert styles into DOM\n var styles = require('./styles.js');\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement);\n\n // add overlay element to dom\n overlay = document.createElement('div');\n overlay.style.display = 'none';\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay);\n\n // event binds\n scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true);\n scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true);\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n overlay.addEventListener('click', onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.addEventListener('keyup', onKeyUp);\n\n timers.start();\n window.addEventListener('focus', timers.start);\n window.addEventListener('beforeunload', function () {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n window.addEventListener('blur', timers.stop);\n\n Boxzilla.trigger('ready');\n};\n\n/**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\nBoxzilla.create = function (id, opts) {\n\n // preserve backwards compat for minimumScreenWidth option\n if (typeof opts.minimumScreenWidth !== \"undefined\") {\n opts.screenWidthCondition = {\n condition: \"larger\",\n value: opts.minimumScreenWidth\n };\n }\n\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n};\n\nBoxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n if (box.id == id) {\n return box;\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n};\n\n// dismiss a single box (or all by omitting id param)\nBoxzilla.dismiss = function (id) {\n // if no id given, dismiss all current open boxes\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.dismiss();\n });\n } else {\n Boxzilla.get(id).dismiss();\n }\n};\n\nBoxzilla.hide = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.hide();\n });\n } else {\n Boxzilla.get(id).hide();\n }\n};\n\nBoxzilla.show = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.show();\n });\n } else {\n Boxzilla.get(id).show();\n }\n};\n\nBoxzilla.toggle = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.toggle();\n });\n } else {\n Boxzilla.get(id).toggle();\n }\n};\n\n// expose each individual box.\nBoxzilla.boxes = boxes;\n\n// expose boxzilla object\nwindow.Boxzilla = Boxzilla;\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n}\n\n},{\"./box.js\":3,\"./styles.js\":5,\"./timer.js\":6,\"wolfy87-eventemitter\":7}],5:[function(require,module,exports){\n\"use strict\";\n\nvar styles = \"#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\nmodule.exports = styles;\n\n},{}],6:[function(require,module,exports){\n'use strict';\n\nvar Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function () {\n this.time++;\n};\n\nTimer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n};\n\nmodule.exports = Timer;\n\n},{}],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 function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var exports = this;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n i = listeners.length;\n\n while (i--) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}.call(this));\n\n},{}]},{},[1]);\n; })();"]}
1
+ {"version":3,"sources":["script.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","_typeof","Symbol","iterator","obj","constructor","prototype","css","element","styles","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","createBoxesFromConfig","isLoggedIn","document","body","className","indexOf","options","inited","testMode","console","log","Boxzilla","init","boxes","boxOpts","window","location","protocol","host","replace","content","box","create","id","post","slug","firstChild","lastChild","trigger","openMailChimpForWordPressBox","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","querySelector","show","boxzilla_options","addEventListener","boxzilla","2","property","initObjectProperties","properties","value","newObject","copyObjectProperties","object","animated","getAttribute","toggle","animation","callbackFn","nowVisible","display","offsetLeft","clone","cloneNode","cleanup","removeAttribute","setAttribute","hiddenStyles","visibleStyles","computedStyles","getComputedStyle","isFinite","height","clientRect","getBoundingClientRect","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","Math","max","scrollHeight","offsetHeight","clientHeight","defaults","rehide","cookie","icon","screenWidthCondition","position","closable","Animator","Box","config","this","overlay","getElementById","visible","dismissed","triggered","triggerHeight","calculateTriggerHeight","cookieSet","isCookieSet","contentElement","closeIcon","dom","events","dismiss","bind","target","tagName","setCookie","fits","locationHashRefersBox","wrapper","createElement","appendChild","innerHTML","scripts","querySelectorAll","script","src","createTextNode","text","parentNode","removeChild","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","newTopMargin","marginTop","classList","hide","method","triggerElement","offset","top","hash","elementId","substring","regex","test","condition","innerWidth","onResize","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","scrollElement","pageYOffset","scrollTop","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","margin","left","right","bottom","triggerExitIntent","exitIntentTriggered","onMouseLeave","delay","clientY","exitIntentDelayTimer","onMouseEnter","clearInterval","onElementClick","el","srcElement","depth","parentElement","toLowerCase","EventEmitter","Object","Timer","timers","start","sessionTime","sessionStorage","getItem","stop","setItem","styleElement","head","setInterval","opts","minimumScreenWidth","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","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":"CAAA,WAAe,GAAIA,GAAUC,OAAgEC,EAASD,QAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kB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AMsC,mBAAqB,SAA4BlQ,GAEnD,MADAyE,MAAK0L,iBAAmBnQ,EACjByE,MAWXmJ,EAAMoC,oBAAsB,WACxB,OAAIvL,KAAKnF,eAAe,qBACbmF,KAAK0L,kBAapBvC,EAAMM,WAAa,WACf,MAAOzJ,MAAKkL,UAAYlL,KAAKkL,aAQjC7D,EAAasE,WAAa,WAEtB,MADA5U,GAAQsQ,aAAe+B,EAChB/B,GAIW,kBAAXpR,IAAyBA,EAAO2V,IACvC3V,EAAO,WACH,MAAOoR,KAGY,gBAAXlQ,IAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAUsQ,EAGjBtQ,EAAQsQ,aAAeA,IAE7BrQ,KAAKgJ,gBAEI","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\n(function () {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n var options = window.boxzilla_options;\n\n // expose Boxzilla object to window\n window.Boxzilla = Boxzilla;\n\n // helper function for setting CSS styles\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n function createBoxesFromConfig() {\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n // failsafe against including script twice.\n if (options.inited) {\n return;\n }\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 = o.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 box slug to box element as classname\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug;\n\n // add custom css to box\n css(box.element, boxOpts.css);\n\n box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n }\n\n // set flag to prevent initialising twice\n options.inited = true;\n\n // trigger \"done\" event.\n Boxzilla.trigger('done');\n }\n\n function openMailChimpForWordPressBox() {\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.addEventListener('load', openMailChimpForWordPressBox);\n createBoxesFromConfig();\n})();\n\n},{\"boxzilla\":4}],2:[function(require,module,exports){\n'use strict';\n\nvar duration = 320;\n\nfunction css(element, styles) {\n for (var property in styles) {\n element.style[property] = styles[property];\n }\n}\n\nfunction initObjectProperties(properties, value) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n return newObject;\n}\n\nfunction copyObjectProperties(properties, object) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n return newObject;\n}\n\n/**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\nfunction animated(element) {\n return !!element.getAttribute('data-animated');\n}\n\n/**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n */\nfunction toggle(element, animation, callbackFn) {\n var nowVisible = element.style.display != 'none' || element.offsetLeft > 0;\n\n // create clone for reference\n var clone = element.cloneNode(true);\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n if (callbackFn) {\n callbackFn();\n }\n };\n\n // store attribute so everyone knows we're animating this element\n element.setAttribute('data-animated', \"true\");\n\n // toggle element visiblity right away if we're making something visible\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles, visibleStyles;\n\n // animate properties\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles);\n\n // in some browsers, getComputedStyle returns \"auto\" value. this falls back to getBoundingClientRect() in those browsers since we need an actual height.\n if (!isFinite(visibleStyles.height)) {\n var clientRect = element.getBoundingClientRect();\n visibleStyles.height = clientRect.height;\n }\n css(element, hiddenStyles);\n }\n\n // don't show a scrollbar during animation\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = { opacity: 0 };\n visibleStyles = { opacity: 1 };\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n}\n\nfunction animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n // make sure we have an object filled with floats\n targetStyles[property] = parseFloat(targetStyles[property]);\n\n // calculate step size & current value\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]);\n\n // is there something to do?\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n\n var step, to, increment, newValue;\n for (var property in targetStyles) {\n step = propSteps[property];\n to = targetStyles[property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n }\n\n // store new value\n currentStyles[property] = newValue;\n\n var suffix = property !== \"opacity\" ? \"px\" : \"\";\n element.style[property] = newValue + suffix;\n }\n\n last = +new Date();\n\n // keep going until we're done for all props\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n}\n\nmodule.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n};\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '&times',\n 'screenWidthCondition': null,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n},\n Boxzilla,\n Animator = require('./animator.js');\n\n/**\n* Merge 2 objects, values of the latter overwriting the former.\n*\n* @param obj1\n* @param obj2\n* @returns {*}\n*/\nfunction merge(obj1, obj2) {\n var obj3 = {};\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n return obj3;\n}\n\n/**\n* Get the real height of entire document.\n* @returns {number}\n*/\nfunction getDocumentHeight() {\n var body = document.body,\n html = document.documentElement;\n\n var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);\n\n return height;\n}\n\n// Box Object\nvar Box = function Box(id, config) {\n this.id = id;\n\n // store config values\n this.config = merge(defaults, config);\n\n // store ref to overlay\n this.overlay = document.getElementById('boxzilla-overlay');\n\n // state\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = this.calculateTriggerHeight();\n this.cookieSet = this.isCookieSet();\n this.element = null;\n this.contentElement = null;\n this.closeIcon = null;\n\n // create dom elements for this box\n this.dom();\n\n // further initialise the box\n this.events();\n};\n\n// initialise the box\nBox.prototype.events = function () {\n var box = this;\n\n // attach event to \"close\" icon inside box\n if (this.closeIcon) {\n this.closeIcon.addEventListener('click', this.dismiss.bind(this));\n }\n\n this.element.addEventListener('click', function (e) {\n if (e.target.tagName === 'A') {\n Boxzilla.trigger('box.interactions.link', [box, e.target]);\n }\n }, false);\n\n this.element.addEventListener('submit', function (e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [box, e.target]);\n }, false);\n\n // 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\nBox.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n\n var content = document.createElement('div');\n content.className = 'boxzilla-content';\n content.innerHTML = this.config.content;\n box.appendChild(content);\n\n // remove <script> from box content and append them to the document body\n var scripts = content.querySelectorAll('script');\n if (scripts.length) {\n for (var i = 0; i < scripts.length; i++) {\n var script = document.createElement('script');\n if (scripts[i].src) {\n script.src = scripts[i].src;\n }\n script.appendChild(document.createTextNode(scripts[i].text));\n scripts[i].parentNode.removeChild(scripts[i]);\n document.body.appendChild(script);\n }\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.contentElement = content;\n this.element = box;\n};\n\n// set (calculate) custom box styling depending on box options\nBox.prototype.setCustomBoxStyling = function () {\n\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = 'auto';\n this.element.style.maxHeight = 'none';\n\n // get new dimensions\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight;\n\n // add scrollbar to box and limit height\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n }\n\n // set new top margin for boxes which are centered\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n};\n\n// toggle visibility of the box\nBox.prototype.toggle = function (show) {\n\n // revert visibility if no explicit argument is given\n if (typeof show === \"undefined\") {\n show = !this.visible;\n }\n\n // is box already at desired visibility?\n if (show === this.visible) {\n return false;\n }\n\n // is box being animated?\n if (Animator.animated(this.element)) {\n return false;\n }\n\n // if box should be hidden but is not closable, bail.\n if (!show && !this.config.closable) {\n return false;\n }\n\n // set new visibility status\n this.visible = show;\n\n // calculate new styling rules\n this.setCustomBoxStyling();\n\n // trigger event\n Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]);\n\n // show or hide box using selected animation\n if (this.config.position === 'center') {\n this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');\n Animator.toggle(this.overlay, \"fade\");\n }\n\n Animator.toggle(this.element, this.config.animation, function () {\n if (this.visible) {\n return;\n }\n this.contentElement.innerHTML = this.contentElement.innerHTML;\n }.bind(this));\n\n return true;\n};\n\n// show the box\nBox.prototype.show = function () {\n return this.toggle(true);\n};\n\n// hide the box\nBox.prototype.hide = function () {\n return this.toggle(false);\n};\n\n// calculate trigger height\nBox.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger) {\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * getDocumentHeight();\n }\n }\n\n return triggerHeight;\n};\n\n// checks whether window.location.hash equals the box element ID or that of any element inside the box\nBox.prototype.locationHashRefersBox = function () {\n\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n }\n\n var elementId = window.location.hash.substring(1);\n\n // only attempt on strings looking like an ID or classname\n var regex = /^[a-zA-Z\\-\\_0-9]{1,}$/;\n if (regex.test(elementId)) {\n return false;\n }\n\n if (elementId === this.element.id) {\n return true;\n } else if (this.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n};\n\nBox.prototype.fits = function () {\n if (!this.config.screenWidthCondition || !this.config.screenWidthCondition.value) {\n return true;\n }\n\n switch (this.config.screenWidthCondition.condition) {\n case \"larger\":\n return window.innerWidth > this.config.screenWidthCondition.value;\n case \"smaller\":\n return window.innerWidth < this.config.screenWidthCondition.value;\n }\n\n // meh.. condition should be \"smaller\" or \"larger\", just return true.\n return true;\n};\n\nBox.prototype.onResize = function () {\n this.triggerHeight = this.calculateTriggerHeight();\n this.setCustomBoxStyling();\n};\n\n// is this box enabled?\nBox.prototype.mayAutoShow = function () {\n\n if (this.dismissed) {\n return false;\n }\n\n // check if box fits on given minimum screen width\n if (!this.fits()) {\n return false;\n }\n\n // if trigger empty or error in calculating triggerHeight, return false\n if (!this.config.trigger) {\n return false;\n }\n\n // rely on cookie value (show if not set, don't show if set)\n return !this.cookieSet;\n};\n\nBox.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function () {\n // always show on test mode or when no auto-trigger is configured\n if (this.config.testMode || !this.config.trigger) {\n return false;\n }\n\n // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n};\n\n// set cookie that disables automatically showing the box\nBox.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n};\n\nBox.prototype.trigger = function () {\n var shown = this.show();\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n};\n\n/**\n* Dismisses the box and optionally sets a cookie.\n*\n* @param e The event that triggered this dismissal.\n* @returns {boolean}\n*/\nBox.prototype.dismiss = function (e) {\n // prevent default action\n e && e.preventDefault();\n\n // only dismiss box if it's currently open.\n if (!this.visible) {\n return false;\n }\n\n // hide box element\n this.hide();\n\n // set cookie\n if (this.config.cookie && this.config.cookie.dismissed) {\n this.setCookie(this.config.cookie.dismissed);\n }\n\n this.dismissed = true;\n Boxzilla.trigger('box.dismiss', [this]);\n return true;\n};\n\nmodule.exports = function (_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n};\n\n},{\"./animator.js\":2}],4:[function(require,module,exports){\n'use strict';\n\nvar EventEmitter = require('wolfy87-eventemitter'),\n Boxzilla = Object.create(EventEmitter.prototype),\n Box = require('./box.js')(Boxzilla),\n Timer = require('./timer.js'),\n boxes = [],\n overlay,\n scrollElement = window,\n exitIntentDelayTimer,\n exitIntentTriggered,\n siteTimer,\n pageTimer,\n pageViews;\n\nfunction throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n\n var now = +new Date(),\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n}\n\n// \"keyup\" listener\nfunction onKeyUp(e) {\n if (e.keyCode == 27) {\n Boxzilla.dismiss();\n }\n}\n\n// check \"pageviews\" criteria for each box\nfunction checkPageViewsCriteria() {\n\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {\n box.trigger();\n }\n });\n}\n\n// check time trigger criteria for each box\nfunction checkTimeCriteria() {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n // check \"time on site\" trigger\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n\n // check \"time on page\" trigger\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n}\n\n// check triggerHeight criteria for all boxes\nfunction checkHeightCriteria() {\n\n var scrollY = scrollElement.hasOwnProperty('pageYOffset') ? scrollElement.pageYOffset : scrollElement.scrollTop;\n scrollY = scrollY + window.innerHeight * 0.9;\n\n boxes.forEach(function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollY > box.triggerHeight) {\n // don't bother if another box is currently open\n if (isAnyBoxVisible()) {\n return;\n }\n\n // trigger box\n box.trigger();\n } else if (box.mayRehide()) {\n box.hide();\n }\n });\n}\n\n// recalculate heights and variables based on height\nfunction recalculateHeights() {\n boxes.forEach(function (box) {\n box.onResize();\n });\n}\n\nfunction onOverlayClick(e) {\n var x = e.offsetX;\n var y = e.offsetY;\n\n // calculate if click was less than 40px outside box to avoid closing it by accident\n boxes.forEach(function (box) {\n var rect = box.element.getBoundingClientRect();\n var margin = 40;\n\n // if click was not anywhere near box, dismiss it.\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n}\n\nfunction triggerExitIntent() {\n // do nothing if already triggered OR another box is visible.\n if (exitIntentTriggered || isAnyBoxVisible()) {\n return;\n }\n\n boxes.forEach(function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n\n exitIntentTriggered = true;\n}\n\nfunction onMouseLeave(e) {\n var delay = 400;\n\n // did mouse leave at top of window?\n if (e.clientY <= 0) {\n exitIntentDelayTimer = window.setTimeout(triggerExitIntent, delay);\n }\n}\n\nfunction isAnyBoxVisible() {\n\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n\n if (box.visible) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction onMouseEnter() {\n if (exitIntentDelayTimer) {\n window.clearInterval(exitIntentDelayTimer);\n exitIntentDelayTimer = null;\n }\n}\n\nfunction onElementClick(e) {\n // find <a> element in up to 3 parent elements\n var el = e.target || e.srcElement;\n var depth = 3;\n for (var i = 0; i <= depth; i++) {\n if (!el || el.tagName === 'A') {\n break;\n }\n\n el = el.parentElement;\n }\n\n if (!el || el.tagName !== 'A' || !el.getAttribute('href')) {\n return;\n }\n\n if (el.getAttribute('href').toLowerCase().indexOf('#boxzilla-') === 0) {\n var boxId = el.getAttribute('href').toLowerCase().substring(\"#boxzilla-\".length);\n Boxzilla.toggle(boxId);\n }\n}\n\nvar timers = {\n start: function start() {\n try {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if (sessionTime) siteTimer.time = sessionTime;\n } catch (e) {}\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n};\n\n// initialise & add event listeners\nBoxzilla.init = function () {\n document.body.addEventListener('click', onElementClick, false);\n\n try {\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n } catch (e) {\n pageViews = 0;\n }\n\n siteTimer = new Timer(0);\n pageTimer = new Timer(0);\n\n // insert styles into DOM\n var styles = require('./styles.js');\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement);\n\n // add overlay element to dom\n overlay = document.createElement('div');\n overlay.style.display = 'none';\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay);\n\n // event binds\n scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true);\n scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true);\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n overlay.addEventListener('click', onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000);\n document.documentElement.addEventListener('mouseleave', onMouseLeave);\n document.documentElement.addEventListener('mouseenter', onMouseEnter);\n document.addEventListener('keyup', onKeyUp);\n\n timers.start();\n window.addEventListener('focus', timers.start);\n window.addEventListener('beforeunload', function () {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n window.addEventListener('blur', timers.stop);\n\n Boxzilla.trigger('ready');\n};\n\n/**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\nBoxzilla.create = function (id, opts) {\n\n // preserve backwards compat for minimumScreenWidth option\n if (typeof opts.minimumScreenWidth !== \"undefined\") {\n opts.screenWidthCondition = {\n condition: \"larger\",\n value: opts.minimumScreenWidth\n };\n }\n\n var box = new Box(id, opts);\n boxes.push(box);\n return box;\n};\n\nBoxzilla.get = function (id) {\n for (var i = 0; i < boxes.length; i++) {\n var box = boxes[i];\n if (box.id == id) {\n return box;\n }\n }\n\n throw new Error(\"No box exists with ID \" + id);\n};\n\n// dismiss a single box (or all by omitting id param)\nBoxzilla.dismiss = function (id) {\n // if no id given, dismiss all current open boxes\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.dismiss();\n });\n } else {\n Boxzilla.get(id).dismiss();\n }\n};\n\nBoxzilla.hide = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.hide();\n });\n } else {\n Boxzilla.get(id).hide();\n }\n};\n\nBoxzilla.show = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.show();\n });\n } else {\n Boxzilla.get(id).show();\n }\n};\n\nBoxzilla.toggle = function (id) {\n if (typeof id === \"undefined\") {\n boxes.forEach(function (box) {\n box.toggle();\n });\n } else {\n Boxzilla.get(id).toggle();\n }\n};\n\n// expose each individual box.\nBoxzilla.boxes = boxes;\n\n// expose boxzilla object\nwindow.Boxzilla = Boxzilla;\n\nif (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n}\n\n},{\"./box.js\":3,\"./styles.js\":5,\"./timer.js\":6,\"wolfy87-eventemitter\":7}],5:[function(require,module,exports){\n\"use strict\";\n\nvar styles = \"#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\nmodule.exports = styles;\n\n},{}],6:[function(require,module,exports){\n'use strict';\n\nvar Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function () {\n this.time++;\n};\n\nTimer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function () {\n if (this.interval) {\n window.clearInterval(this.interval);\n this.interval = 0;\n }\n};\n\nmodule.exports = Timer;\n\n},{}],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 function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var exports = this;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n i = listeners.length;\n\n while (i--) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}.call(this));\n\n},{}]},{},[1]);\n; })();"]}
boxzilla.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
- Version: 3.1.18
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.18' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
1
  <?php
2
  /*
3
  Plugin Name: Boxzilla
4
+ Version: 3.1.19
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.19' );
45
 
46
  require __DIR__ . '/bootstrap.php';
47
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Ibericode, DvanKooten, hchouhan, lapzor
3
  Donate link: https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=boxzilla&utm_campaign=donate-link
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.1
6
- Tested up to: 4.8.1
7
- Stable tag: 3.1.18
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
@@ -150,6 +150,13 @@ Have a look at the [frequently asked questions](https://wordpress.org/plugins/bo
150
  == Changelog ==
151
 
152
 
 
 
 
 
 
 
 
153
  #### 3.1.18 - September 7, 2017
154
 
155
  **Additions**
3
  Donate link: https://boxzillaplugin.com/#utm_source=wp-plugin-repo&utm_medium=boxzilla&utm_campaign=donate-link
4
  Tags: scroll triggered box, cta, social, pop-up, newsletter, call to action, mailchimp, contact form 7, social media, mc4wp, ibericode
5
  Requires at least: 4.1
6
+ Tested up to: 4.8.2
7
+ Stable tag: 3.1.19
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  Requires PHP: 5.3
150
  == Changelog ==
151
 
152
 
153
+ #### 3.1.19 - September 20, 2017
154
+
155
+ **Improvements**
156
+
157
+ - Trigger points based on height (scroll %, element) will now be recalculated when the page height changes.
158
+
159
+
160
  #### 3.1.18 - September 7, 2017
161
 
162
  **Additions**