Version Description
Download this release
Release Info
Developer | DvanKooten |
Plugin | Boxzilla |
Version | 3.1 |
Comparing to | |
See all releases |
Code changes from version 3.0.3 to 3.1
- assets/css/admin-styles.css +123 -154
- assets/css/admin-styles.min.css +1 -1
- assets/css/styles.css +0 -99
- assets/css/styles.min.css +0 -1
- assets/js/admin-script.min.js +1 -1
- assets/js/admin-script.min.js.map +1 -1
- assets/js/script.js +280 -97
- assets/js/script.min.js +1 -1
- assets/js/script.min.js.map +1 -1
- assets/scss/admin-styles.scss +169 -0
- boxzilla.php +2 -2
- languages/boxzilla.pot +59 -51
- readme.txt +17 -3
- src/admin/class-admin.php +2 -1
- src/admin/migrations/4.0.0-cookie-option.php +24 -0
- src/admin/views/extensions.php +2 -2
- src/admin/views/metaboxes/box-option-controls.php +56 -16
- src/admin/views/metaboxes/email-optin.php +6 -5
- src/admin/views/metaboxes/need-help.php +6 -1
- src/class-box.php +12 -3
- src/class-loader.php +2 -4
- src/licensing/views/license-form.php +1 -1
assets/css/admin-styles.css
CHANGED
@@ -1,154 +1,123 @@
|
|
1 |
-
/* first row can't be deleted */
|
2 |
-
.boxzilla-rule-row-0 .boxzilla-close{
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
}
|
13 |
-
|
14 |
-
.boxzilla-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
}
|
21 |
-
|
22 |
-
.boxzilla-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
}
|
49 |
-
|
50 |
-
.post-type-boxzilla-box .
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
.post-type-boxzilla-box .wp-picker-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
#boxzilla-admin .status {
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
}
|
90 |
-
|
91 |
-
|
92 |
-
.
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
}
|
103 |
-
|
104 |
-
.boxzilla-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
}
|
117 |
-
|
118 |
-
.boxzilla-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
}
|
124 |
-
|
125 |
-
.boxzilla-box h3,
|
126 |
-
.boxzilla-box:first-child {
|
127 |
-
margin-top: 0;
|
128 |
-
}
|
129 |
-
|
130 |
-
.boxzilla-box:last-child {
|
131 |
-
margin-bottom: 0;
|
132 |
-
}
|
133 |
-
|
134 |
-
.boxzilla-sidebar form label {
|
135 |
-
display: block;
|
136 |
-
font-weight: bold;
|
137 |
-
margin-bottom: 6px;
|
138 |
-
}
|
139 |
-
|
140 |
-
@media( max-width: 920px ) {
|
141 |
-
.boxzilla-row {
|
142 |
-
margin: 0;
|
143 |
-
}
|
144 |
-
.boxzilla-col-one-third,
|
145 |
-
.boxzilla-col-two-third {
|
146 |
-
float: none;
|
147 |
-
padding: 0;
|
148 |
-
width: auto;
|
149 |
-
}
|
150 |
-
|
151 |
-
.boxzilla-sidebar {
|
152 |
-
margin-top: 40px;
|
153 |
-
}
|
154 |
-
}
|
1 |
+
/* first row can't be deleted */
|
2 |
+
.boxzilla-rule-row-0 .boxzilla-close {
|
3 |
+
visibility: hidden; }
|
4 |
+
|
5 |
+
.column-box_id {
|
6 |
+
width: 80px; }
|
7 |
+
|
8 |
+
.boxzilla-sm {
|
9 |
+
width: 150px; }
|
10 |
+
|
11 |
+
.boxzilla-xsm {
|
12 |
+
width: 15px; }
|
13 |
+
|
14 |
+
.boxzilla-title {
|
15 |
+
margin-top: 2em !important; }
|
16 |
+
|
17 |
+
.boxzilla-label {
|
18 |
+
display: block;
|
19 |
+
font-weight: bold;
|
20 |
+
margin-bottom: 6px; }
|
21 |
+
|
22 |
+
.boxzilla-close {
|
23 |
+
padding: 0;
|
24 |
+
cursor: pointer;
|
25 |
+
background: transparent;
|
26 |
+
border: 0;
|
27 |
+
-webkit-appearance: none;
|
28 |
+
font-size: 21px;
|
29 |
+
font-weight: bold;
|
30 |
+
line-height: 26px;
|
31 |
+
text-shadow: 0 1px 0 #fff;
|
32 |
+
opacity: .3;
|
33 |
+
filter: alpha(opacity=30); }
|
34 |
+
.boxzilla-close:hover, .boxzilla-close:focus {
|
35 |
+
color: #000;
|
36 |
+
text-decoration: none;
|
37 |
+
cursor: pointer;
|
38 |
+
opacity: .6;
|
39 |
+
filter: alpha(opacity=60); }
|
40 |
+
|
41 |
+
.post-type-boxzilla-box .form-table {
|
42 |
+
table-layout: fixed; }
|
43 |
+
|
44 |
+
.post-type-boxzilla-box .window-positions {
|
45 |
+
border: 1px solid #EEE; }
|
46 |
+
.post-type-boxzilla-box .window-positions td {
|
47 |
+
padding: 3px;
|
48 |
+
margin-bottom: 0; }
|
49 |
+
|
50 |
+
.post-type-boxzilla-box .wp-picker-container {
|
51 |
+
white-space: nowrap; }
|
52 |
+
|
53 |
+
.post-type-boxzilla-box .wp-picker-clear,
|
54 |
+
.post-type-boxzilla-box .wp-picker-holder,
|
55 |
+
.post-type-boxzilla-box .wp-picker-input-wrap {
|
56 |
+
background: white;
|
57 |
+
z-index: 999 !important;
|
58 |
+
position: absolute !important; }
|
59 |
+
|
60 |
+
#boxzilla-admin .status {
|
61 |
+
display: inline-block;
|
62 |
+
padding: 3px 6px;
|
63 |
+
color: white;
|
64 |
+
text-transform: uppercase;
|
65 |
+
font-weight: bold; }
|
66 |
+
#boxzilla-admin .status.positive {
|
67 |
+
background-color: limeGreen; }
|
68 |
+
#boxzilla-admin .status.negative {
|
69 |
+
background: #c3c3c3; }
|
70 |
+
|
71 |
+
/* Radio Switches */
|
72 |
+
.radio-label {
|
73 |
+
font-weight: normal; }
|
74 |
+
.radio-label > input {
|
75 |
+
margin-top: 0 !important; }
|
76 |
+
|
77 |
+
/** Grid */
|
78 |
+
.boxzilla-row {
|
79 |
+
margin: 0 -20px; }
|
80 |
+
|
81 |
+
.boxzilla-col-one-third,
|
82 |
+
.boxzilla-col-two-third {
|
83 |
+
float: left;
|
84 |
+
-webkit-box-sizing: border-box;
|
85 |
+
box-sizing: border-box;
|
86 |
+
padding: 0 20px; }
|
87 |
+
|
88 |
+
.boxzilla-col-two-third {
|
89 |
+
width: 66.66%; }
|
90 |
+
|
91 |
+
.boxzilla-col-one-third {
|
92 |
+
width: 33.33%; }
|
93 |
+
|
94 |
+
/* admin sidebar */
|
95 |
+
.boxzilla-sidebar {
|
96 |
+
margin-top: 10px; }
|
97 |
+
|
98 |
+
.boxzilla-box {
|
99 |
+
background: white;
|
100 |
+
padding: 20px;
|
101 |
+
margin-bottom: 20px;
|
102 |
+
border: 1px solid #ccc; }
|
103 |
+
.boxzilla-box h3,
|
104 |
+
.boxzilla-box :first-child {
|
105 |
+
margin-top: 0; }
|
106 |
+
.boxzilla-box :last-child {
|
107 |
+
margin-bottom: 0; }
|
108 |
+
|
109 |
+
.boxzilla-sidebar form label {
|
110 |
+
display: block;
|
111 |
+
font-weight: bold;
|
112 |
+
margin-bottom: 6px; }
|
113 |
+
|
114 |
+
@media (max-width: 920px) {
|
115 |
+
.boxzilla-row {
|
116 |
+
margin: 0; }
|
117 |
+
.boxzilla-col-one-third,
|
118 |
+
.boxzilla-col-two-third {
|
119 |
+
float: none;
|
120 |
+
padding: 0;
|
121 |
+
width: auto; }
|
122 |
+
.boxzilla-sidebar {
|
123 |
+
margin-top: 40px; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/admin-styles.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.boxzilla-rule-row-0 .boxzilla-close{visibility:hidden}.column-box_id{width:80px}.boxzilla-sm{width:150px}.boxzilla-xsm{width:15px}.boxzilla-title{margin-top:2em!important}.boxzilla-label{display:block;font-weight:700;margin-bottom:6px}.boxzilla-close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;font-size:21px;font-weight:700;line-height:26px;text-shadow:0 1px 0 #fff;opacity:.3;filter:alpha(opacity=30)}.boxzilla-close:focus,.boxzilla-close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.6;filter:alpha(opacity=60)}.post-type-boxzilla-box .form-table{table-layout:fixed}.post-type-boxzilla-box .wp-picker-container{white-space:nowrap}.post-type-boxzilla-box .wp-picker-clear,.post-type-boxzilla-box .wp-picker-holder,.post-type-boxzilla-box .wp-picker-input-wrap{background:#fff;z-index:999!important;position:absolute!important}#boxzilla-admin .status{display:inline-block;padding:3px 6px;color:#fff;text-transform:uppercase;font-weight:700}#boxzilla-admin .status.positive{background-color:#32cd32}#boxzilla-admin .status.negative{background:#c3c3c3}.radio-label{font-weight:400}.radio-label>input{margin-top:0!important}.boxzilla-row{margin:0 -20px}.boxzilla-col-one-third,.boxzilla-col-two-third{float:left;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px}.boxzilla-col-two-third{width:66.66%}.boxzilla-col-one-third{width:33.33%}.boxzilla-sidebar{margin-top:10px}.boxzilla-box{background:#fff;padding:20px;margin-bottom:20px;border:1px solid #ccc}.boxzilla-box
|
1 |
+
.boxzilla-rule-row-0 .boxzilla-close{visibility:hidden}.column-box_id{width:80px}.boxzilla-sm{width:150px}.boxzilla-xsm{width:15px}.boxzilla-title{margin-top:2em!important}.boxzilla-label{display:block;font-weight:700;margin-bottom:6px}.boxzilla-close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;font-size:21px;font-weight:700;line-height:26px;text-shadow:0 1px 0 #fff;opacity:.3;filter:alpha(opacity=30)}.boxzilla-close:focus,.boxzilla-close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.6;filter:alpha(opacity=60)}.post-type-boxzilla-box .form-table{table-layout:fixed}.post-type-boxzilla-box .window-positions{border:1px solid #EEE}.post-type-boxzilla-box .window-positions td{padding:3px;margin-bottom:0}.post-type-boxzilla-box .wp-picker-container{white-space:nowrap}.post-type-boxzilla-box .wp-picker-clear,.post-type-boxzilla-box .wp-picker-holder,.post-type-boxzilla-box .wp-picker-input-wrap{background:#fff;z-index:999!important;position:absolute!important}#boxzilla-admin .status{display:inline-block;padding:3px 6px;color:#fff;text-transform:uppercase;font-weight:700}#boxzilla-admin .status.positive{background-color:#32cd32}#boxzilla-admin .status.negative{background:#c3c3c3}.radio-label{font-weight:400}.radio-label>input{margin-top:0!important}.boxzilla-row{margin:0 -20px}.boxzilla-col-one-third,.boxzilla-col-two-third{float:left;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0 20px}.boxzilla-col-two-third{width:66.66%}.boxzilla-col-one-third{width:33.33%}.boxzilla-sidebar{margin-top:10px}.boxzilla-box{background:#fff;padding:20px;margin-bottom:20px;border:1px solid #ccc}.boxzilla-box :first-child,.boxzilla-box h3{margin-top:0}.boxzilla-box :last-child{margin-bottom:0}.boxzilla-sidebar form label{display:block;font-weight:700;margin-bottom:6px}@media (max-width:920px){.boxzilla-row{margin:0}.boxzilla-col-one-third,.boxzilla-col-two-third{float:none;padding:0;width:auto}.boxzilla-sidebar{margin-top:40px}}
|
assets/css/styles.css
DELETED
@@ -1,99 +0,0 @@
|
|
1 |
-
html,
|
2 |
-
body {
|
3 |
-
min-height: 100%;
|
4 |
-
height: auto;
|
5 |
-
}
|
6 |
-
|
7 |
-
.boxzilla-center-container {
|
8 |
-
position: fixed;
|
9 |
-
top: 0;
|
10 |
-
left: 0;
|
11 |
-
right: 0;
|
12 |
-
height: 0;
|
13 |
-
text-align: center;
|
14 |
-
z-index: 999999;
|
15 |
-
line-height: 0;
|
16 |
-
}
|
17 |
-
|
18 |
-
.boxzilla-center-container .boxzilla{
|
19 |
-
display: inline-block;
|
20 |
-
text-align: left;
|
21 |
-
position: relative;
|
22 |
-
}
|
23 |
-
|
24 |
-
.boxzilla {
|
25 |
-
position: fixed;
|
26 |
-
z-index: 999999;
|
27 |
-
margin: 0;
|
28 |
-
-webkit-box-sizing: border-box;
|
29 |
-
-moz-box-sizing: border-box;
|
30 |
-
box-sizing: border-box;
|
31 |
-
background: white;
|
32 |
-
|
33 |
-
/* reset line-height because of container line-height hack */
|
34 |
-
line-height: normal;
|
35 |
-
padding: 25px;
|
36 |
-
}
|
37 |
-
|
38 |
-
.boxzilla.boxzilla-top-left{
|
39 |
-
top: 0; left: 0; bottom: auto; right: auto;
|
40 |
-
}
|
41 |
-
|
42 |
-
.boxzilla.boxzilla-top-right{
|
43 |
-
top: 0; right: 0; bottom: auto; left: auto;
|
44 |
-
}
|
45 |
-
|
46 |
-
.boxzilla.boxzilla-bottom-left{
|
47 |
-
bottom: 0; left: 0; top: auto; right: auto;
|
48 |
-
}
|
49 |
-
|
50 |
-
.boxzilla.boxzilla-bottom-right{
|
51 |
-
bottom: 0; right: 0; top: auto; left: auto;
|
52 |
-
}
|
53 |
-
|
54 |
-
/* remove top & bottom margin from last child element */
|
55 |
-
.boxzilla-content > *:first-child {
|
56 |
-
margin-top: 0;
|
57 |
-
padding-top: 0;
|
58 |
-
}
|
59 |
-
.boxzilla-content > *:last-child {
|
60 |
-
margin-bottom: 0;
|
61 |
-
padding-bottom: 0;
|
62 |
-
}
|
63 |
-
|
64 |
-
.boxzilla-close-icon {
|
65 |
-
position:absolute;
|
66 |
-
right :0;
|
67 |
-
top: 0;
|
68 |
-
text-align:center;
|
69 |
-
padding: 6px;
|
70 |
-
cursor: pointer;
|
71 |
-
background: transparent;
|
72 |
-
border: 0;
|
73 |
-
-webkit-appearance: none;
|
74 |
-
font-size: 36px;
|
75 |
-
font-weight: bold;
|
76 |
-
line-height: 20px;
|
77 |
-
color: #000;
|
78 |
-
opacity: .5;
|
79 |
-
filter: alpha(opacity=50);
|
80 |
-
}
|
81 |
-
|
82 |
-
.boxzilla-close-icon:hover, .boxzilla-close-icon:focus {
|
83 |
-
color: #000;
|
84 |
-
text-decoration: none;
|
85 |
-
cursor: pointer;
|
86 |
-
opacity: .8;
|
87 |
-
filter: alpha(opacity=80);
|
88 |
-
}
|
89 |
-
|
90 |
-
#boxzilla-overlay {
|
91 |
-
position: fixed;
|
92 |
-
background: rgba(0,0,0,0.65);
|
93 |
-
width: 100%;
|
94 |
-
height: 100%;
|
95 |
-
z-index: 99999;
|
96 |
-
display: none;
|
97 |
-
top: 0;
|
98 |
-
left: 0;
|
99 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/css/styles.min.css
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
body,html{min-height:100%;height:auto}.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}.boxzilla{position:fixed;z-index:999999;margin:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;line-height:normal;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0;bottom:auto;right:auto}.boxzilla.boxzilla-top-right{top:0;right:0;bottom:auto;left:auto}.boxzilla.boxzilla-bottom-left{bottom:0;left:0;top:auto;right:auto}.boxzilla.boxzilla-bottom-right{bottom:0;right:0;top:auto;left:auto}.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;background:0 0;border:0;-webkit-appearance:none;font-size:36px;font-weight:700;line-height:20px;color:#000;opacity:.5;filter:alpha(opacity=50)}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.8;filter:alpha(opacity=80)}#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;z-index:99999;display:none;top:0;left:0}
|
|
assets/js/admin-script.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
|
2 |
//# sourceMappingURL=admin-script.min.js.map
|
1 |
+
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};!function(){var e=void 0,t=void 0;!function n(t,o,r){function i(s,a){if(!o[s]){if(!t[s]){var u="function"==typeof e&&e;if(!a&&u)return u(s,!0);if(l)return l(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var p=o[s]={exports:{}};t[s][0].call(p.exports,function(e){var n=t[s][1][e];return i(n?n:e)},p,p.exports,n,t,o,r)}return o[s].exports}for(var l="function"==typeof e&&e,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){window.Boxzilla_Admin=e("./admin/_admin.js")},{"./admin/_admin.js":2}],2:[function(e,t,n){function o(){c.find(".boxzilla-trigger-options").toggle(""!==this.value)}function r(){s(this).parents("tr").remove()}function i(){var e="tr"===this.tagName.toLowerCase()?this:s(this).parents("tr").get(0),t=e.querySelector(".boxzilla-rule-condition").value,n=e.querySelector(".boxzilla-rule-value"),o=e.querySelector(".boxzilla-rule-qualifier"),r=n.cloneNode(!0),i=s(r);switch(s(e.querySelectorAll(".boxzilla-helper")).remove(),r.removeAttribute("name"),r.className=r.className+" boxzilla-helper",n.parentNode.insertBefore(r,n.nextSibling),i.change(function(){n.value=this.value}),r.style.display="",n.style.display="none",o.style.display="",t){default:r.placeholder=m.enterCommaSeparatedValues;break;case"":case"everywhere":o.value="1",n.value="",r.style.display="none",o.style.display="none";break;case"is_single":case"is_post":r.placeholder=m.enterCommaSeparatedPosts,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post",{multiple:!0,multipleSep:","});break;case"is_page":r.placeholder=m.enterCommaSeparatedPages,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=page",{multiple:!0,multipleSep:","});break;case"is_post_type":r.placeholder=m.enterCommaSeparatedPostTypes,i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_type",{multiple:!0,multipleSep:","});break;case"is_url":r.placeholder=m.enterCommaSeparatedRelativeUrls;break;case"is_post_in_category":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=category",{multiple:!0,multipleSep:","});break;case"is_post_with_tag":i.suggest(ajaxurl+"?action=boxzilla_autocomplete&type=post_tag",{multiple:!0,multipleSep:","})}}function l(){var e={key:u.querySelectorAll(".boxzilla-rule-row").length},t=h(e);return s(document.getElementById("boxzilla-box-rules")).after(t),!1}var s=window.jQuery,a=e("./_option.js"),u=document.getElementById("boxzilla-box-options-controls"),c=s(u);if(0!==c.length){var p=e("wolfy87-eventemitter"),d=new p,f=e("./_designer.js")(s,a,d),h=wp.template("rule-row-template"),m=boxzilla_i18n;c.on("click",".boxzilla-add-rule",l),c.on("click",".boxzilla-remove-rule",r),c.on("change",".boxzilla-rule-condition",i),c.find(".boxzilla-auto-show-trigger").on("change",o),s(window).load(function(){"undefined"==typeof window.tinyMCE&&(document.getElementById("notice-notinymce").style.display="")}),s(".boxzilla-rule-row").each(i),t.exports={Designer:f,Option:a,events:d}}},{"./_designer.js":3,"./_option.js":4,"wolfy87-eventemitter":5}],3:[function(e,t,n){var o=function(e,t,n){function o(){"object"===_typeof(window.tinyMCE)&&null!==tinyMCE.get("content")&&(s=e("#content_ifr"),l=s.contents().find("html"),l.css({background:"white"}),a=l.find("#tinymce"),a.addClass("boxzilla boxzilla-"+u),a.css({margin:0,background:"white",display:"inline-block",width:"auto","min-width":"240px",position:"relative"}),a.get(0).style.cssText+=";padding: 25px !important;",p=!0,n.trigger("editor.init"))}function r(){return!!p&&(a.css({"border-color":c.borderColor.getColorValue(),"border-width":c.borderWidth.getPxValue(),"border-style":c.borderStyle.getValue(),"background-color":c.backgroundColor.getColorValue(),width:c.width.getPxValue(),color:c.color.getColorValue()}),n.trigger("editor.styles.apply"),!0)}function i(){for(var e in c)"theme"!==e.substring(0,5)&&c[e].clear();r(),n.trigger("editor.styles.reset")}var l,s,a,u=document.getElementById("post_ID").value||0,c={},p=!1,d=e("#boxzilla-box-appearance-controls");return c.borderColor=new t("border-color"),c.borderWidth=new t("border-width"),c.borderStyle=new t("border-style"),c.backgroundColor=new t("background-color"),c.width=new t("width"),c.color=new t("color"),d.find("input.boxzilla-color-field").wpColorPicker({change:r,clear:r}),d.find(":input").not(".boxzilla-color-field").change(r),n.on("editor.init",r),{init:o,resetStyles:i,options:c}};t.exports=o},{}],4:[function(e,t,n){var o=window.jQuery,r=function(e){"string"==typeof e&&(e=document.getElementById("boxzilla-"+e)),e||console.error("Unable to find option element."),this.element=e};r.prototype.getColorValue=function(){return this.element.value.length>0?o(this.element).hasClass("wp-color-field")?o(this.element).wpColorPicker("color"):this.element.value:""},r.prototype.getPxValue=function(e){return this.element.value.length>0?parseInt(this.element.value)+"px":e||""},r.prototype.getValue=function(e){return this.element.value.length>0?this.element.value:e||""},r.prototype.clear=function(){this.element.value=""},r.prototype.setValue=function(e){this.element.value=e},t.exports=r},{}],5:[function(e,n,o){(function(){function e(){}function o(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function r(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,l=this,s=l.EventEmitter;i.getListeners=function(e){var t,n,o=this._getEvents();if(e instanceof RegExp){t={};for(n in o)o.hasOwnProperty(n)&&e.test(n)&&(t[n]=o[n])}else t=o[e]||(o[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;t<e.length;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,t){var n,r=this.getListenersAsObject(e),i="object"===("undefined"==typeof t?"undefined":_typeof(t));for(n in r)r.hasOwnProperty(n)&&o(r[n],t)===-1&&r[n].push(i?t:{listener:t,once:!1});return this},i.on=r("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=r("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,t){var n,r,i=this.getListenersAsObject(e);for(r in i)i.hasOwnProperty(r)&&(n=o(i[r],t),n!==-1&&i[r].splice(n,1));return this},i.off=r("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var o,r,i=e?this.removeListener:this.addListener,l=e?this.removeListeners:this.addListeners;if("object"!==("undefined"==typeof t?"undefined":_typeof(t))||t instanceof RegExp)for(o=n.length;o--;)i.call(this,t,n[o]);else for(o in t)t.hasOwnProperty(o)&&(r=t[o])&&("function"==typeof r?i.call(this,o,r):l.call(this,o,r));return this},i.removeEvent=function(e){var t,n="undefined"==typeof e?"undefined":_typeof(e),o=this._getEvents();if("string"===n)delete o[e];else if(e instanceof RegExp)for(t in o)o.hasOwnProperty(t)&&e.test(t)&&delete o[t];else delete this._events;return this},i.removeAllListeners=r("removeEvent"),i.emitEvent=function(e,t){var n,o,r,i,l,s=this.getListenersAsObject(e);for(i in s)if(s.hasOwnProperty(i))for(n=s[i].slice(0),r=n.length;r--;)o=n[r],o.once===!0&&this.removeListener(e,o.listener),l=o.listener.apply(this,t||[]),l===this._getOnceReturnValue()&&this.removeListener(e,o.listener);return this},i.trigger=r("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return l.EventEmitter=s,e},"function"==typeof t&&t.amd?t(function(){return e}):"object"===("undefined"==typeof n?"undefined":_typeof(n))&&n.exports?n.exports=e:l.EventEmitter=e}).call(this)},{}]},{},[1])}();
|
2 |
//# sourceMappingURL=admin-script.min.js.map
|
assets/js/admin-script.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["admin-script.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","window","Boxzilla_Admin","./admin/_admin.js","2","toggleTriggerOptions","$optionControls","find","toggle","this","value","removeRule","$","parents","remove","setContextualHelpers","context","tagName","toLowerCase","get","condition","querySelector","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","querySelectorAll","removeAttribute","className","parentNode","insertBefore","nextSibling","change","style","display","placeholder","i18n","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","addRuleFields","data","key","optionControls","html","rowTemplate","document","getElementById","after","jQuery","Option","EventEmitter","events","Designer","wp","template","boxzilla_i18n","on","load","each","./_designer.js","./_option.js","wolfy87-eventemitter","3","init","tinyMCE","$editorFrame","$editor","contents","css","background","$innerEditor","addClass","boxId","margin","width","min-width","position","cssText","visualEditorInitialised","trigger","applyStyles","border-color","options","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","color","resetStyles","substring","clear","$appearanceControls","wpColorPicker","not","4","element","console","error","prototype","hasClass","fallbackValue","parseInt","setValue","5","indexOfListener","listeners","listener","alias","name","apply","arguments","proto","originalGlobalValue","getListeners","evt","response","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,GAAIA,GAAUC,OAAgEC,EAASD,QAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI,IAAII,GAAE,GAAIC,OAAM,uBAAuBL,EAAE,IAAK,MAAMI,GAAEE,KAAK,mBAAmBF,EAAE,GAAIG,GAAEV,EAAEG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AAeoE,EAChBpE,GAIW,kBAAX5E,IAAyBA,EAAOyL,IACvCzL,EAAO,WACH,MAAO4E,KAGY,gBAAX1D,IAAuBA,EAAOJ,QAC1CI,EAAOJ,QAAU8D,EAGjB9D,EAAQ8D,aAAeA,IAE7B7D,KAAKY,gBAEI","file":"admin-script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\nvar Option = require('./_option.js');\nvar optionControls = document.getElementById('boxzilla-box-options-controls');\nvar $optionControls = $(optionControls);\n\n// sanity check, are we on the correct page?\nif( $optionControls.length === 0 ) {\n\treturn;\n}\n\nvar EventEmitter = require('wolfy87-eventemitter');\nvar events = new EventEmitter();\nvar Designer = require('./_designer.js')($, Option, events);\nvar rowTemplate = wp.template('rule-row-template');\nvar i18n = boxzilla_i18n;\n\n// events\n$optionControls.on('click', \".boxzilla-add-rule\", addRuleFields);\n$optionControls.on('click', \".boxzilla-remove-rule\", removeRule);\n$optionControls.on('change', \".boxzilla-rule-condition\", setContextualHelpers);\n$optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions );\n\n$(window).load(function() {\n\tif( typeof(window.tinyMCE) === \"undefined\" ) {\n\t\tdocument.getElementById('notice-notinymce').style.display = '';\n\t}\n});\n\n// call contextual helper method for each row\n$('.boxzilla-rule-row').each(setContextualHelpers);\n\nfunction toggleTriggerOptions() {\n\t$optionControls.find('.boxzilla-trigger-options').toggle( this.value !== '' );\n}\n\nfunction removeRule() {\n\t$(this).parents('tr').remove();\n}\n\nfunction setContextualHelpers() {\n\n\tvar context = ( this.tagName.toLowerCase() === \"tr\" ) ? this : $(this).parents('tr').get(0);\n\tvar condition = context.querySelector('.boxzilla-rule-condition').value;\n\tvar valueInput = context.querySelector('.boxzilla-rule-value');\n\tvar qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n\tvar betterInput = valueInput.cloneNode(true);\n\tvar $betterInput = $(betterInput);\n\n\t// remove previously added helpers\n\t$(context.querySelectorAll('.boxzilla-helper')).remove();\n\n\t// prepare better input\n\tbetterInput.removeAttribute('name');\n\tbetterInput.className = betterInput.className + ' boxzilla-helper';\n\tvalueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n\t$betterInput.change(function() { valueInput.value = this.value; });\n\n\tbetterInput.style.display = '';\n\tvalueInput.style.display = 'none';\n\tqualifierInput.style.display = '';\n\n\t// change placeholder for textual help\n\tswitch(condition) {\n\t\tdefault:\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedValues;\n\t\t\tbreak;\n\n\t\tcase '':\n\t\tcase 'everywhere':\n\t\t\tqualifierInput.value = '1';\n\t\t\tvalueInput.value = '';\n\t\t\tbetterInput.style.display = 'none';\n\t\t\tqualifierInput.style.display = 'none';\n\t\t\tbreak;\n\n\t\tcase 'is_single':\n\t\tcase 'is_post':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedPosts;\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_page':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedPages;\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_post_type':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_url':\n\t\t\tbetterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n\t\t\tbreak;\n\n\t\tcase 'is_post_in_category':\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\n\t\tcase 'is_post_with_tag':\n\t\t\t$betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", {multiple:true, multipleSep: \",\"});\n\t\t\tbreak;\n\t}\n}\n\nfunction addRuleFields() {\n\tvar data = {\n\t\t'key': optionControls.querySelectorAll('.boxzilla-rule-row').length\n\t};\n\tvar html = rowTemplate(data);\n\t$(document.getElementById('boxzilla-box-rules')).after(html);\n\treturn false;\n}\n\nmodule.exports = {\n\t'Designer': Designer,\n\t'Option': Option,\n\t'events': events\n};\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\nvar Designer = function($, Option, events) {\n\n\t// vars\n\tvar boxId = document.getElementById('post_ID').value || 0,\n\t\t$editor, $editorFrame,\n\t\t$innerEditor,\n\t\toptions = {},\n\t\tvisualEditorInitialised = false;\n\n\tvar $appearanceControls = $(\"#boxzilla-box-appearance-controls\");\n\n\t// create Option objects\n\toptions.borderColor = new Option('border-color');\n\toptions.borderWidth = new Option('border-width');\n\toptions.borderStyle = new Option('border-style');\n\toptions.backgroundColor = new Option('background-color');\n\toptions.width = new Option('width');\n\toptions.color = new Option('color');\n\n\t// functions\n\tfunction init() {\n\n\t\t// Only run if TinyMCE has actually inited\n\t\tif( typeof( window.tinyMCE ) !== \"object\" || tinyMCE.get('content') === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// add classes to TinyMCE <html>\n\t\t$editorFrame = $(\"#content_ifr\");\n\t\t$editor = $editorFrame.contents().find('html');\n\t\t$editor.css({\n\t\t\t'background': 'white'\n\t\t});\n\n\t\t// add content class and padding to TinyMCE <body>\n\t\t$innerEditor = $editor.find('#tinymce');\n\t\t$innerEditor.addClass('boxzilla boxzilla-' + boxId);\n\t\t$innerEditor.css({\n\t\t\t'margin': 0,\n\t\t\t'background': 'white',\n\t\t\t'display': 'inline-block',\n\t\t\t'width': 'auto',\n\t\t\t'min-width': '240px',\n\t\t\t'position': 'relative'\n\t\t});\n\t\t$innerEditor.get(0).style.cssText += ';padding: 25px !important;';\n\n\t\tvisualEditorInitialised = true;\n\n\t\t/* @since 2.0.3 */\n\t\tevents.trigger('editor.init');\n\t}\n\n\t/**\n\t * Applies the styles from the options to the TinyMCE Editor\n\t *\n\t * @return bool\n\t */\n\tfunction applyStyles() {\n\n\t\tif( ! visualEditorInitialised ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// apply styles from CSS editor\n\t\t$innerEditor.css({\n\t\t\t'border-color': options.borderColor.getColorValue(), //getColorValue( 'borderColor', '' ),\n\t\t\t'border-width': options.borderWidth.getPxValue(), //getPxValue( 'borderWidth', '' ),\n\t\t\t'border-style': options.borderStyle.getValue(), //getValue('borderStyle', '' ),\n\t\t\t'background-color': options.backgroundColor.getColorValue(), //getColorValue( 'backgroundColor', ''),\n\t\t\t'width': options.width.getPxValue(), //getPxValue( 'width', 'auto' ),\n\t\t\t'color': options.color.getColorValue() // getColorValue( 'color', '' )\n\t\t});\n\n\t\t/* @since 2.0.3 */\n\t\tevents.trigger('editor.styles.apply');\n\n\t\treturn true;\n\t}\n\n\tfunction resetStyles() {\n\t\tfor( var key in options ) {\n\t\t\tif( key.substring(0,5) === 'theme' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\toptions[key].clear();\n\t\t}\n\t\tapplyStyles();\n\n\t\t/* @since 2.0.3 */\n\t\tevents.trigger('editor.styles.reset');\n\t}\n\n\t// event binders\n\t$appearanceControls.find('input.boxzilla-color-field').wpColorPicker({ change: applyStyles, clear: applyStyles });\n\t$appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n\tevents.on('editor.init', applyStyles);\n\n\t// public methods\n\treturn {\n\t\t'init': init,\n\t\t'resetStyles': resetStyles,\n\t\t'options': options\n\t};\n\n};\n\nmodule.exports = Designer;\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\n\nvar Option = function( element ) {\n\n\t// find corresponding element\n\tif( typeof(element) == \"string\" ) {\n\t\telement = document.getElementById('boxzilla-' + element);\n\t}\n\n\tif( ! element ) {\n\t\tconsole.error(\"Unable to find option element.\");\n\t}\n\n\tthis.element = element;\n};\n\nOption.prototype.getColorValue = function() {\n\tif( this.element.value.length > 0 ) {\n\t\tif( $(this.element).hasClass('wp-color-field')) {\n\t\t\treturn $(this.element).wpColorPicker('color');\n\t\t} else {\n\t\t\treturn this.element.value;\n\t\t}\n\t}\n\n\treturn '';\n};\n\nOption.prototype.getPxValue = function( fallbackValue ) {\n\tif( this.element.value.length > 0 ) {\n\t\treturn parseInt( this.element.value ) + \"px\";\n\t}\n\n\treturn fallbackValue || '';\n};\n\nOption.prototype.getValue = function( fallbackValue ) {\n\n\tif( this.element.value.length > 0 ) {\n\t\treturn this.element.value;\n\t}\n\n\treturn fallbackValue || '';\n};\n\nOption.prototype.clear = function() {\n\tthis.element.value = '';\n};\n\nOption.prototype.setValue = function(value) {\n\tthis.element.value = value;\n};\n\nmodule.exports = Option;\n},{}],5:[function(require,module,exports){\n/*!\n * EventEmitter v4.2.11 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function () {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var exports = this;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n i = listeners.length;\n\n while (i--) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}.call(this));\n\n},{}]},{},[1]);\n; })();"],"sourceRoot":"/source/"}
|
1 |
+
{"version":3,"sources":["admin-script.js"],"names":["_typeof","Symbol","iterator","obj","constructor","require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","window","Boxzilla_Admin","./admin/_admin.js","2","toggleTriggerOptions","$optionControls","find","toggle","this","value","removeRule","$","parents","remove","setContextualHelpers","context","tagName","toLowerCase","get","condition","querySelector","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","querySelectorAll","removeAttribute","className","parentNode","insertBefore","nextSibling","change","style","display","placeholder","i18n","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","addRuleFields","data","key","optionControls","html","rowTemplate","document","getElementById","after","jQuery","Option","EventEmitter","events","Designer","wp","template","boxzilla_i18n","on","load","tinyMCE","each","./_designer.js","./_option.js","wolfy87-eventemitter","3","init","$editorFrame","$editor","contents","css","background","$innerEditor","addClass","boxId","margin","width","min-width","position","cssText","visualEditorInitialised","trigger","applyStyles","border-color","options","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","color","resetStyles","substring","clear","$appearanceControls","wpColorPicker","not","4","element","console","error","prototype","hasClass","fallbackValue","parseInt","setValue","5","indexOfListener","listeners","listener","alias","name","apply","arguments","proto","originalGlobalValue","getListeners","evt","response","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"AAAA,YAEA,IAAIA,SAA4B,kBAAXC,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,OAAS,eAAkBE,KAE1O,WACE,GAAIE,GAAUC,OAA6DC,EAASD,QAAU,QAAUE,GAAEC,EAAGC,EAAGC,GAC9G,QAASC,GAAEC,EAAGC,GACZ,IAAKJ,EAAEG,GAAI,CACT,IAAKJ,EAAEI,GAAI,CACT,GAAIE,GAAsB,kBAAXV,IAAyBA,CAAQ,KAAKS,GAAKC,EAAG,MAAOA,GAAEF,GAAG,EAAI,IAAIG,EAAG,MAAOA,GAAEH,GAAG,EAAI,IAAII,GAAI,GAAIC,OAAM,uBAAyBL,EAAI,IAAK,MAAMI,GAAEE,KAAO,mBAAoBF,EAC5L,GAAIG,GAAIV,EAA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YhBxC,EAAMK,WAAa,WACjB,MAAOzH,MAAKmJ,UAAYnJ,KAAKmJ,aAQ/BlG,EAAa4G,WAAa,WAExB,MADA1K,GAAQ8D,aAAeoE,EAChBpE,GAIa,kBAAX5E,IAAyBA,EAAOyL,IACzCzL,EAAO,WACL,MAAO4E,KAEoE,YAAjD,mBAAX1D,GAAyB,YAAczB,QAAQyB,KAAyBA,EAAOJ,QAChGI,EAAOJ,QAAU8D,EAEjB9D,EAAQ8D,aAAeA,IAExB7D,KAAKY,gBACK","file":"admin-script.min.js","sourcesContent":["\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n(function () {\n var require = undefined;var module = undefined;var exports = undefined;var define = undefined;(function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n var a = typeof require == \"function\" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error(\"Cannot find module '\" + o + \"'\");throw f.code = \"MODULE_NOT_FOUND\", f;\n }var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {\n var n = t[o][1][e];return s(n ? n : e);\n }, l, l.exports, e, t, n, r);\n }return n[o].exports;\n }var i = typeof require == \"function\" && require;for (var o = 0; o < r.length; o++) {\n s(r[o]);\n }return s;\n })({ 1: [function (require, module, exports) {\n window.Boxzilla_Admin = require('./admin/_admin.js');\n }, { \"./admin/_admin.js\": 2 }], 2: [function (require, module, exports) {\n 'use strict';\n\n var $ = window.jQuery;\n var Option = require('./_option.js');\n var optionControls = document.getElementById('boxzilla-box-options-controls');\n var $optionControls = $(optionControls);\n\n // sanity check, are we on the correct page?\n if ($optionControls.length === 0) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter');\n var events = new EventEmitter();\n var Designer = require('./_designer.js')($, Option, events);\n var rowTemplate = wp.template('rule-row-template');\n var i18n = boxzilla_i18n;\n\n // events\n $optionControls.on('click', \".boxzilla-add-rule\", addRuleFields);\n $optionControls.on('click', \".boxzilla-remove-rule\", removeRule);\n $optionControls.on('change', \".boxzilla-rule-condition\", setContextualHelpers);\n $optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);\n\n $(window).load(function () {\n if (typeof window.tinyMCE === \"undefined\") {\n document.getElementById('notice-notinymce').style.display = '';\n }\n });\n\n // call contextual helper method for each row\n $('.boxzilla-rule-row').each(setContextualHelpers);\n\n function toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n }\n\n function removeRule() {\n $(this).parents('tr').remove();\n }\n\n function setContextualHelpers() {\n\n var context = this.tagName.toLowerCase() === \"tr\" ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput);\n\n // remove previously added helpers\n $(context.querySelectorAll('.boxzilla-helper')).remove();\n\n // prepare better input\n betterInput.removeAttribute('name');\n betterInput.className = betterInput.className + ' boxzilla-helper';\n valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);\n $betterInput.change(function () {\n valueInput.value = this.value;\n });\n\n betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n\n // change placeholder for textual help\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_url':\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", { multiple: true, multipleSep: \",\" });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", { multiple: true, multipleSep: \",\" });\n break;\n }\n }\n\n function addRuleFields() {\n var data = {\n 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length\n };\n var html = rowTemplate(data);\n $(document.getElementById('boxzilla-box-rules')).after(html);\n return false;\n }\n\n module.exports = {\n 'Designer': Designer,\n 'Option': Option,\n 'events': events\n };\n }, { \"./_designer.js\": 3, \"./_option.js\": 4, \"wolfy87-eventemitter\": 5 }], 3: [function (require, module, exports) {\n var Designer = function Designer($, Option, events) {\n\n // vars\n var boxId = document.getElementById('post_ID').value || 0,\n $editor,\n $editorFrame,\n $innerEditor,\n options = {},\n visualEditorInitialised = false;\n\n var $appearanceControls = $(\"#boxzilla-box-appearance-controls\");\n\n // create Option objects\n options.borderColor = new Option('border-color');\n options.borderWidth = new Option('border-width');\n options.borderStyle = new Option('border-style');\n options.backgroundColor = new Option('background-color');\n options.width = new Option('width');\n options.color = new Option('color');\n\n // functions\n function init() {\n\n // Only run if TinyMCE has actually inited\n if (_typeof(window.tinyMCE) !== \"object\" || tinyMCE.get('content') === null) {\n return;\n }\n\n // add classes to TinyMCE <html>\n $editorFrame = $(\"#content_ifr\");\n $editor = $editorFrame.contents().find('html');\n $editor.css({\n 'background': 'white'\n });\n\n // add content class and padding to TinyMCE <body>\n $innerEditor = $editor.find('#tinymce');\n $innerEditor.addClass('boxzilla boxzilla-' + boxId);\n $innerEditor.css({\n 'margin': 0,\n 'background': 'white',\n 'display': 'inline-block',\n 'width': 'auto',\n 'min-width': '240px',\n 'position': 'relative'\n });\n $innerEditor.get(0).style.cssText += ';padding: 25px !important;';\n\n visualEditorInitialised = true;\n\n /* @since 2.0.3 */\n events.trigger('editor.init');\n }\n\n /**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n function applyStyles() {\n\n if (!visualEditorInitialised) {\n return false;\n }\n\n // apply styles from CSS editor\n $innerEditor.css({\n 'border-color': options.borderColor.getColorValue(), //getColorValue( 'borderColor', '' ),\n 'border-width': options.borderWidth.getPxValue(), //getPxValue( 'borderWidth', '' ),\n 'border-style': options.borderStyle.getValue(), //getValue('borderStyle', '' ),\n 'background-color': options.backgroundColor.getColorValue(), //getColorValue( 'backgroundColor', ''),\n 'width': options.width.getPxValue(), //getPxValue( 'width', 'auto' ),\n 'color': options.color.getColorValue() // getColorValue( 'color', '' )\n });\n\n /* @since 2.0.3 */\n events.trigger('editor.styles.apply');\n\n return true;\n }\n\n function resetStyles() {\n for (var key in options) {\n if (key.substring(0, 5) === 'theme') {\n continue;\n }\n\n options[key].clear();\n }\n applyStyles();\n\n /* @since 2.0.3 */\n events.trigger('editor.styles.reset');\n }\n\n // event binders\n $appearanceControls.find('input.boxzilla-color-field').wpColorPicker({ change: applyStyles, clear: applyStyles });\n $appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n events.on('editor.init', applyStyles);\n\n // public methods\n return {\n 'init': init,\n 'resetStyles': resetStyles,\n 'options': options\n };\n };\n\n module.exports = Designer;\n }, {}], 4: [function (require, module, exports) {\n 'use strict';\n\n var $ = window.jQuery;\n\n var Option = function Option(element) {\n\n // find corresponding element\n if (typeof element == \"string\") {\n element = document.getElementById('boxzilla-' + element);\n }\n\n if (!element) {\n console.error(\"Unable to find option element.\");\n }\n\n this.element = element;\n };\n\n Option.prototype.getColorValue = function () {\n if (this.element.value.length > 0) {\n if ($(this.element).hasClass('wp-color-field')) {\n return $(this.element).wpColorPicker('color');\n } else {\n return this.element.value;\n }\n }\n\n return '';\n };\n\n Option.prototype.getPxValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return parseInt(this.element.value) + \"px\";\n }\n\n return fallbackValue || '';\n };\n\n Option.prototype.getValue = function (fallbackValue) {\n\n if (this.element.value.length > 0) {\n return this.element.value;\n }\n\n return fallbackValue || '';\n };\n\n Option.prototype.clear = function () {\n this.element.value = '';\n };\n\n Option.prototype.setValue = function (value) {\n this.element.value = value;\n };\n\n module.exports = Option;\n }, {}], 5: [function (require, module, exports) {\n /*!\n * EventEmitter v4.2.11 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n ;(function () {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var exports = this;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n } else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = (typeof listener === \"undefined\" ? \"undefined\" : _typeof(listener)) === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if ((typeof evt === \"undefined\" ? \"undefined\" : _typeof(evt)) === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n } else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n } else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt === \"undefined\" ? \"undefined\" : _typeof(evt);\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n } else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n } else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n i = listeners.length;\n\n while (i--) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n } else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n module.exports = EventEmitter;\n } else {\n exports.EventEmitter = EventEmitter;\n }\n }).call(this);\n }, {}] }, {}, [1]);\n ;\n})();"],"sourceRoot":"/source/"}
|
assets/js/script.js
CHANGED
@@ -79,15 +79,170 @@ window.addEventListener('load', function() {
|
|
79 |
});
|
80 |
|
81 |
window.Boxzilla = Boxzilla;
|
82 |
-
},{"boxzilla":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
'use strict';
|
84 |
|
85 |
-
var
|
86 |
-
defaults = {
|
87 |
'animation': 'fade',
|
88 |
'rehide': false,
|
89 |
'content': '',
|
90 |
-
'
|
91 |
'icon': '×',
|
92 |
'minimumScreenWidth': 0,
|
93 |
'position': 'center',
|
@@ -95,7 +250,8 @@ var $ = window.jQuery,
|
|
95 |
'trigger': false,
|
96 |
'closable': true
|
97 |
},
|
98 |
-
Boxzilla
|
|
|
99 |
|
100 |
/**
|
101 |
* Merge 2 objects, values of the latter overwriting the former.
|
@@ -123,10 +279,12 @@ var Box = function( id, config ) {
|
|
123 |
|
124 |
// state
|
125 |
this.visible = false;
|
126 |
-
this.
|
127 |
this.triggered = false;
|
128 |
this.triggerHeight = 0;
|
129 |
this.cookieSet = false;
|
|
|
|
|
130 |
|
131 |
// if a trigger was given, calculate values once and store
|
132 |
if( this.config.trigger ) {
|
@@ -137,9 +295,8 @@ var Box = function( id, config ) {
|
|
137 |
this.cookieSet = this.isCookieSet();
|
138 |
}
|
139 |
|
140 |
-
// create dom
|
141 |
-
this.
|
142 |
-
this.$element = $(this.element);
|
143 |
|
144 |
// further initialise the box
|
145 |
this.events();
|
@@ -150,26 +307,39 @@ Box.prototype.events = function() {
|
|
150 |
var box = this;
|
151 |
|
152 |
// attach event to "close" icon inside box
|
153 |
-
this
|
154 |
|
155 |
-
this
|
156 |
-
|
157 |
-
|
|
|
|
|
158 |
|
159 |
-
this
|
160 |
box.setCookie();
|
161 |
Boxzilla.trigger('box.interactions.form', [ box, e.target ]);
|
162 |
-
});
|
163 |
|
164 |
-
//
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
|
170 |
// maybe show box right away
|
171 |
if( this.fits() && this.locationHashRefersBox() ) {
|
172 |
-
|
173 |
}
|
174 |
|
175 |
};
|
@@ -200,32 +370,31 @@ Box.prototype.dom = function() {
|
|
200 |
}
|
201 |
document.body.appendChild(script);
|
202 |
}
|
203 |
-
|
204 |
-
// for safety measure, restore jQuery
|
205 |
-
window.jQuery = $;
|
206 |
-
|
207 |
if( this.config.closable && this.config.icon ) {
|
208 |
-
var
|
209 |
-
|
210 |
-
|
211 |
-
box.appendChild(
|
|
|
212 |
}
|
213 |
|
214 |
document.body.appendChild(wrapper);
|
215 |
-
|
216 |
-
return box;
|
217 |
};
|
218 |
|
219 |
// set (calculate) custom box styling depending on box options
|
220 |
Box.prototype.setCustomBoxStyling = function() {
|
221 |
|
222 |
// reset element to its initial state
|
|
|
|
|
223 |
this.element.style.overflowY = 'auto';
|
224 |
this.element.style.maxHeight = 'none';
|
225 |
|
226 |
// get new dimensions
|
227 |
var windowHeight = window.innerHeight;
|
228 |
-
var boxHeight = this
|
229 |
|
230 |
// add scrollbar to box and limit height
|
231 |
if( boxHeight > windowHeight ) {
|
@@ -240,6 +409,7 @@ Box.prototype.setCustomBoxStyling = function() {
|
|
240 |
this.element.style.marginTop = newTopMargin + "px";
|
241 |
}
|
242 |
|
|
|
243 |
};
|
244 |
|
245 |
// toggle visibility of the box
|
@@ -250,13 +420,13 @@ Box.prototype.toggle = function(show) {
|
|
250 |
show = ! this.visible;
|
251 |
}
|
252 |
|
253 |
-
//
|
254 |
-
if( this
|
255 |
return false;
|
256 |
}
|
257 |
|
258 |
-
// is box
|
259 |
-
if(
|
260 |
return false;
|
261 |
}
|
262 |
|
@@ -268,26 +438,24 @@ Box.prototype.toggle = function(show) {
|
|
268 |
// set new visibility status
|
269 |
this.visible = show;
|
270 |
|
271 |
-
// calculate
|
272 |
this.setCustomBoxStyling();
|
273 |
|
274 |
-
// fadein / fadeout the overlay if position is "center"
|
275 |
-
if( this.config.position === 'center' ) {
|
276 |
-
$(this.overlay).fadeToggle('slow');
|
277 |
-
}
|
278 |
-
|
279 |
// trigger event
|
280 |
Boxzilla.trigger('box.' + ( show ? 'show' : 'hide' ), [ this ] );
|
281 |
|
282 |
// show or hide box using selected animation
|
283 |
-
if( this.config.
|
284 |
-
this
|
285 |
-
} else {
|
286 |
-
this.$element.slideToggle( 'slow' );
|
287 |
}
|
288 |
|
289 |
-
|
290 |
-
|
|
|
|
|
|
|
|
|
|
|
291 |
|
292 |
return true;
|
293 |
};
|
@@ -307,27 +475,18 @@ Box.prototype.calculateTriggerHeight = function() {
|
|
307 |
var triggerHeight = 0;
|
308 |
|
309 |
if( this.config.trigger.method === 'element' ) {
|
310 |
-
var
|
311 |
-
|
|
|
|
|
|
|
312 |
} else if( this.config.trigger.method === 'percentage' ) {
|
313 |
-
triggerHeight = ( this.config.trigger.value / 100 *
|
314 |
}
|
315 |
|
316 |
return triggerHeight;
|
317 |
};
|
318 |
|
319 |
-
// set cookie that disables automatically showing the box
|
320 |
-
Box.prototype.setCookie = function() {
|
321 |
-
// do nothing if cookieTime evaluates to false
|
322 |
-
if(! this.config.cookieTime) {
|
323 |
-
return;
|
324 |
-
}
|
325 |
-
|
326 |
-
var expiryDate = new Date();
|
327 |
-
expiryDate.setDate( expiryDate.getDate() + this.config.cookieTime );
|
328 |
-
document.cookie = 'boxzilla_box_'+ this.id + '=true; expires='+ expiryDate.toUTCString() +'; path=/';
|
329 |
-
};
|
330 |
-
|
331 |
// checks whether window.location.hash equals the box element ID or that of any element inside the box
|
332 |
Box.prototype.locationHashRefersBox = function() {
|
333 |
|
@@ -356,8 +515,7 @@ Box.prototype.fits = function() {
|
|
356 |
// is this box enabled?
|
357 |
Box.prototype.mayAutoShow = function() {
|
358 |
|
359 |
-
|
360 |
-
if( this.closed ) {
|
361 |
return false;
|
362 |
}
|
363 |
|
@@ -381,31 +539,46 @@ Box.prototype.mayRehide = function() {
|
|
381 |
|
382 |
Box.prototype.isCookieSet = function() {
|
383 |
// always show on test mode
|
384 |
-
if(
|
385 |
return false;
|
386 |
}
|
387 |
|
388 |
-
//
|
389 |
-
if( ! this.config.
|
390 |
return false;
|
391 |
}
|
392 |
|
393 |
var cookieSet = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + 'boxzilla_box_' + this.id + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1") === "true";
|
394 |
return cookieSet;
|
|
|
395 |
|
|
|
|
|
|
|
|
|
|
|
396 |
};
|
397 |
|
398 |
Box.prototype.trigger = function() {
|
399 |
var shown = this.show();
|
400 |
-
if( shown ) {
|
401 |
-
|
|
|
|
|
|
|
|
|
|
|
402 |
}
|
403 |
};
|
404 |
|
405 |
Box.prototype.dismiss = function() {
|
406 |
this.hide();
|
407 |
-
|
408 |
-
this.
|
|
|
|
|
|
|
|
|
409 |
Boxzilla.trigger('box.dismiss', [ this ]);
|
410 |
};
|
411 |
|
@@ -413,22 +586,17 @@ module.exports = function(_Boxzilla) {
|
|
413 |
Boxzilla = _Boxzilla;
|
414 |
return Box;
|
415 |
};
|
416 |
-
},{}],
|
417 |
'use strict';
|
418 |
|
419 |
-
var
|
420 |
-
EventEmitter = require('wolfy87-eventemitter'),
|
421 |
Boxzilla = Object.create(EventEmitter.prototype),
|
422 |
-
Box = require('./
|
423 |
-
Timer = require('./
|
424 |
boxes = {},
|
425 |
-
windowHeight
|
426 |
-
|
427 |
-
|
428 |
-
exitIntentTriggered,
|
429 |
-
siteTimer = new Timer(sessionStorage.getItem('boxzilla_timer') || 0),
|
430 |
-
pageTimer = new Timer(0),
|
431 |
-
pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;
|
432 |
|
433 |
function each( obj, callback ) {
|
434 |
for( var key in obj ) {
|
@@ -586,30 +754,42 @@ var timers = {
|
|
586 |
|
587 |
// initialise & add event listeners
|
588 |
Boxzilla.init = function() {
|
589 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
590 |
|
591 |
// add overlay element to dom
|
|
|
|
|
592 |
overlay.id = 'boxzilla-overlay';
|
593 |
document.body.appendChild(overlay);
|
594 |
|
595 |
// event binds
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
$(html).on('mouseenter', onMouseEnter);
|
601 |
-
$(html).on('keyup', onKeyUp);
|
602 |
-
$(overlay).click(onOverlayClick);
|
603 |
window.setInterval(checkTimeCriteria, 1000);
|
604 |
window.setTimeout(checkPageViewsCriteria, 1000 );
|
|
|
|
|
|
|
605 |
|
606 |
timers.start();
|
607 |
-
|
608 |
-
|
609 |
timers.stop();
|
610 |
sessionStorage.setItem('boxzilla_pageviews', ++pageViews);
|
611 |
});
|
612 |
-
|
613 |
|
614 |
Boxzilla.trigger('ready');
|
615 |
};
|
@@ -666,7 +846,10 @@ window.Boxzilla = Boxzilla;
|
|
666 |
if ( typeof module !== 'undefined' && module.exports ) {
|
667 |
module.exports = Boxzilla;
|
668 |
}
|
669 |
-
},{"./
|
|
|
|
|
|
|
670 |
'use strict';
|
671 |
|
672 |
var Timer = function(start) {
|
@@ -690,7 +873,7 @@ Timer.prototype.stop = function() {
|
|
690 |
};
|
691 |
|
692 |
module.exports = Timer;
|
693 |
-
},{}],
|
694 |
/*!
|
695 |
* EventEmitter v4.2.11 - git.io/ee
|
696 |
* Unlicense - http://unlicense.org/
|
79 |
});
|
80 |
|
81 |
window.Boxzilla = Boxzilla;
|
82 |
+
},{"boxzilla":4}],2:[function(require,module,exports){
|
83 |
+
var duration = 320;
|
84 |
+
|
85 |
+
function css(element, styles) {
|
86 |
+
for(var property in styles) {
|
87 |
+
element.style[property] = styles[property];
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
function initObjectProperties(properties, value) {
|
92 |
+
var newObject = {};
|
93 |
+
for(var i=0; i<properties.length; i++) {
|
94 |
+
newObject[properties[i]] = value;
|
95 |
+
}
|
96 |
+
return newObject;
|
97 |
+
}
|
98 |
+
|
99 |
+
function copyObjectProperties(properties, object) {
|
100 |
+
var newObject = {}
|
101 |
+
for(var i=0; i<properties.length; i++) {
|
102 |
+
newObject[properties[i]] = object[properties[i]];
|
103 |
+
}
|
104 |
+
return newObject;
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Checks if the given element is currently being animated.
|
109 |
+
*
|
110 |
+
* @param element
|
111 |
+
* @returns {boolean}
|
112 |
+
*/
|
113 |
+
function animated(element) {
|
114 |
+
return !! element.getAttribute('data-animated');
|
115 |
+
}
|
116 |
+
|
117 |
+
/**
|
118 |
+
* Toggles the element using the given animation.
|
119 |
+
*
|
120 |
+
* @param element
|
121 |
+
* @param animation Either "fade" or "slide"
|
122 |
+
*/
|
123 |
+
function toggle(element, animation) {
|
124 |
+
var nowVisible = element.style.display != 'none' || element.offsetLeft > 0;
|
125 |
+
|
126 |
+
// create clone for reference
|
127 |
+
var clone = element.cloneNode(true);
|
128 |
+
var cleanup = function() {
|
129 |
+
element.removeAttribute('data-animated');
|
130 |
+
element.setAttribute('style', clone.getAttribute('style'));
|
131 |
+
element.style.display = nowVisible ? 'none' : '';
|
132 |
+
};
|
133 |
+
|
134 |
+
// store attribute so everyone knows we're animating this element
|
135 |
+
element.setAttribute('data-animated', "true");
|
136 |
+
|
137 |
+
// toggle element visiblity right away if we're making something visible
|
138 |
+
if( ! nowVisible ) {
|
139 |
+
element.style.display = '';
|
140 |
+
}
|
141 |
+
|
142 |
+
var hiddenStyles, visibleStyles;
|
143 |
+
|
144 |
+
// animate properties
|
145 |
+
if( animation === 'slide' ) {
|
146 |
+
hiddenStyles = initObjectProperties(["height", "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], 0);
|
147 |
+
visibleStyles = {};
|
148 |
+
|
149 |
+
if( ! nowVisible ) {
|
150 |
+
var computedStyles = window.getComputedStyle(element);
|
151 |
+
visibleStyles = copyObjectProperties(["height", "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], computedStyles);
|
152 |
+
css(element, hiddenStyles);
|
153 |
+
}
|
154 |
+
|
155 |
+
// don't show a scrollbar during animation
|
156 |
+
element.style.overflowY = 'hidden';
|
157 |
+
animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);
|
158 |
+
} else {
|
159 |
+
hiddenStyles = { opacity: 0 };
|
160 |
+
visibleStyles = { opacity: 1 };
|
161 |
+
if( ! nowVisible ) {
|
162 |
+
css(element, hiddenStyles);
|
163 |
+
}
|
164 |
+
|
165 |
+
animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);
|
166 |
+
}
|
167 |
+
}
|
168 |
+
|
169 |
+
function animate(element, targetStyles, fn) {
|
170 |
+
var last = +new Date();
|
171 |
+
var initialStyles = window.getComputedStyle(element);
|
172 |
+
var currentStyles = {};
|
173 |
+
var propSteps = {};
|
174 |
+
|
175 |
+
for(var property in targetStyles) {
|
176 |
+
// make sure we have an object filled with floats
|
177 |
+
targetStyles[property] = parseFloat(targetStyles[property]);
|
178 |
+
|
179 |
+
// calculate step size & current value
|
180 |
+
var to = targetStyles[property];
|
181 |
+
var current = parseFloat(initialStyles[property]);
|
182 |
+
|
183 |
+
// is there something to do?
|
184 |
+
if( current == to ) {
|
185 |
+
delete targetStyles[property];
|
186 |
+
continue;
|
187 |
+
}
|
188 |
+
|
189 |
+
propSteps[property] = ( to - current ) / duration; // points per second
|
190 |
+
currentStyles[property] = current;
|
191 |
+
}
|
192 |
+
|
193 |
+
var tick = function() {
|
194 |
+
var now = +new Date();
|
195 |
+
var timeSinceLastTick = now - last;
|
196 |
+
var done = true;
|
197 |
+
|
198 |
+
var step, to, increment, newValue;
|
199 |
+
for(var property in targetStyles ) {
|
200 |
+
step = propSteps[property];
|
201 |
+
to = targetStyles[property];
|
202 |
+
increment = step * timeSinceLastTick;
|
203 |
+
newValue = currentStyles[property] + increment;
|
204 |
+
|
205 |
+
if( step > 0 && newValue >= to || step < 0 && newValue <= to ) {
|
206 |
+
newValue = to;
|
207 |
+
} else {
|
208 |
+
done = false;
|
209 |
+
}
|
210 |
+
|
211 |
+
// store new value
|
212 |
+
currentStyles[property] = newValue;
|
213 |
+
|
214 |
+
var suffix = property !== "opacity" ? "px" : "";
|
215 |
+
element.style[property] = newValue + suffix;
|
216 |
+
}
|
217 |
+
|
218 |
+
last = +new Date();
|
219 |
+
|
220 |
+
// keep going until we're done for all props
|
221 |
+
if(!done) {
|
222 |
+
(window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 32);
|
223 |
+
} else {
|
224 |
+
// call callback
|
225 |
+
fn && fn();
|
226 |
+
}
|
227 |
+
};
|
228 |
+
|
229 |
+
tick();
|
230 |
+
}
|
231 |
+
|
232 |
+
|
233 |
+
module.exports = {
|
234 |
+
'toggle': toggle,
|
235 |
+
'animate': animate,
|
236 |
+
'animated': animated
|
237 |
+
};
|
238 |
+
},{}],3:[function(require,module,exports){
|
239 |
'use strict';
|
240 |
|
241 |
+
var defaults = {
|
|
|
242 |
'animation': 'fade',
|
243 |
'rehide': false,
|
244 |
'content': '',
|
245 |
+
'cookie': null,
|
246 |
'icon': '×',
|
247 |
'minimumScreenWidth': 0,
|
248 |
'position': 'center',
|
250 |
'trigger': false,
|
251 |
'closable': true
|
252 |
},
|
253 |
+
Boxzilla,
|
254 |
+
Animator = require('./animator.js');
|
255 |
|
256 |
/**
|
257 |
* Merge 2 objects, values of the latter overwriting the former.
|
279 |
|
280 |
// state
|
281 |
this.visible = false;
|
282 |
+
this.dismissed = false;
|
283 |
this.triggered = false;
|
284 |
this.triggerHeight = 0;
|
285 |
this.cookieSet = false;
|
286 |
+
this.element = null;
|
287 |
+
this.closeIcon = null;
|
288 |
|
289 |
// if a trigger was given, calculate values once and store
|
290 |
if( this.config.trigger ) {
|
295 |
this.cookieSet = this.isCookieSet();
|
296 |
}
|
297 |
|
298 |
+
// create dom elements for this box
|
299 |
+
this.dom();
|
|
|
300 |
|
301 |
// further initialise the box
|
302 |
this.events();
|
307 |
var box = this;
|
308 |
|
309 |
// attach event to "close" icon inside box
|
310 |
+
this.closeIcon && this.closeIcon.addEventListener('click', box.dismiss.bind(this));
|
311 |
|
312 |
+
this.element.addEventListener('click', function(e) {
|
313 |
+
if( e.target.tagName === 'A' ) {
|
314 |
+
Boxzilla.trigger('box.interactions.link', [ box, e.target ] );
|
315 |
+
}
|
316 |
+
}, false);
|
317 |
|
318 |
+
this.element.addEventListener('submit', function(e) {
|
319 |
box.setCookie();
|
320 |
Boxzilla.trigger('box.interactions.form', [ box, e.target ]);
|
321 |
+
}, false);
|
322 |
|
323 |
+
// listen to all "click" events
|
324 |
+
document.body.addEventListener('click', function(e) {
|
325 |
+
|
326 |
+
// only act on links
|
327 |
+
if( e.target.tagName !== 'A' ) {
|
328 |
+
return;
|
329 |
+
}
|
330 |
+
|
331 |
+
// check if link href ends with "#boxzilla-{box.id}
|
332 |
+
var needle = "#boxzilla-" + box.id;
|
333 |
+
var haystack = e.target.getAttribute("href");
|
334 |
+
if( haystack && haystack.substring(-(needle.length)) === needle) {
|
335 |
+
box.toggle();
|
336 |
+
e.preventDefault();
|
337 |
+
}
|
338 |
+
}, false);
|
339 |
|
340 |
// maybe show box right away
|
341 |
if( this.fits() && this.locationHashRefersBox() ) {
|
342 |
+
window.addEventListener('load', this.show.bind(this));
|
343 |
}
|
344 |
|
345 |
};
|
370 |
}
|
371 |
document.body.appendChild(script);
|
372 |
}
|
373 |
+
|
|
|
|
|
|
|
374 |
if( this.config.closable && this.config.icon ) {
|
375 |
+
var closeIcon = document.createElement('span');
|
376 |
+
closeIcon.className = "boxzilla-close-icon";
|
377 |
+
closeIcon.innerHTML = this.config.icon;
|
378 |
+
box.appendChild(closeIcon);
|
379 |
+
this.closeIcon = closeIcon;
|
380 |
}
|
381 |
|
382 |
document.body.appendChild(wrapper);
|
383 |
+
this.element = box;
|
|
|
384 |
};
|
385 |
|
386 |
// set (calculate) custom box styling depending on box options
|
387 |
Box.prototype.setCustomBoxStyling = function() {
|
388 |
|
389 |
// reset element to its initial state
|
390 |
+
var origDisplay = this.element.style.display;
|
391 |
+
this.element.style.display = '';
|
392 |
this.element.style.overflowY = 'auto';
|
393 |
this.element.style.maxHeight = 'none';
|
394 |
|
395 |
// get new dimensions
|
396 |
var windowHeight = window.innerHeight;
|
397 |
+
var boxHeight = this.element.clientHeight;
|
398 |
|
399 |
// add scrollbar to box and limit height
|
400 |
if( boxHeight > windowHeight ) {
|
409 |
this.element.style.marginTop = newTopMargin + "px";
|
410 |
}
|
411 |
|
412 |
+
this.element.style.display = origDisplay;
|
413 |
};
|
414 |
|
415 |
// toggle visibility of the box
|
420 |
show = ! this.visible;
|
421 |
}
|
422 |
|
423 |
+
// is box already at desired visibility?
|
424 |
+
if( show === this.visible ) {
|
425 |
return false;
|
426 |
}
|
427 |
|
428 |
+
// is box being animated?
|
429 |
+
if( Animator.animated(this.element) ) {
|
430 |
return false;
|
431 |
}
|
432 |
|
438 |
// set new visibility status
|
439 |
this.visible = show;
|
440 |
|
441 |
+
// calculate new styling rules
|
442 |
this.setCustomBoxStyling();
|
443 |
|
|
|
|
|
|
|
|
|
|
|
444 |
// trigger event
|
445 |
Boxzilla.trigger('box.' + ( show ? 'show' : 'hide' ), [ this ] );
|
446 |
|
447 |
// show or hide box using selected animation
|
448 |
+
if( this.config.position === 'center' ) {
|
449 |
+
Animator.toggle(this.overlay, "fade");
|
|
|
|
|
450 |
}
|
451 |
|
452 |
+
Animator.toggle(this.element, this.config.animation);
|
453 |
+
|
454 |
+
// focus on first input field in box
|
455 |
+
var firstInput = this.element.querySelector('input, textarea');
|
456 |
+
if(firstInput) {
|
457 |
+
firstInput.focus();
|
458 |
+
}
|
459 |
|
460 |
return true;
|
461 |
};
|
475 |
var triggerHeight = 0;
|
476 |
|
477 |
if( this.config.trigger.method === 'element' ) {
|
478 |
+
var triggerElement = document.body.querySelector(this.config.trigger.value);
|
479 |
+
if( triggerElement ) {
|
480 |
+
var offset = triggerElement.getBoundingClientRect();
|
481 |
+
triggerHeight = offset.top;
|
482 |
+
}
|
483 |
} else if( this.config.trigger.method === 'percentage' ) {
|
484 |
+
triggerHeight = ( this.config.trigger.value / 100 * document.body.clientHeight );
|
485 |
}
|
486 |
|
487 |
return triggerHeight;
|
488 |
};
|
489 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
// checks whether window.location.hash equals the box element ID or that of any element inside the box
|
491 |
Box.prototype.locationHashRefersBox = function() {
|
492 |
|
515 |
// is this box enabled?
|
516 |
Box.prototype.mayAutoShow = function() {
|
517 |
|
518 |
+
if( this.dismissed ) {
|
|
|
519 |
return false;
|
520 |
}
|
521 |
|
539 |
|
540 |
Box.prototype.isCookieSet = function() {
|
541 |
// always show on test mode
|
542 |
+
if(this.config.testMode) {
|
543 |
return false;
|
544 |
}
|
545 |
|
546 |
+
// if either cookie is null or trigger & dismiss are both falsey, don't bother checking.
|
547 |
+
if(!this.config.cookie || ( ! this.config.cookie.triggered && ! this.config.cookie.dismissed ) ) {
|
548 |
return false;
|
549 |
}
|
550 |
|
551 |
var cookieSet = document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + 'boxzilla_box_' + this.id + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1") === "true";
|
552 |
return cookieSet;
|
553 |
+
};
|
554 |
|
555 |
+
// set cookie that disables automatically showing the box
|
556 |
+
Box.prototype.setCookie = function(hours) {
|
557 |
+
var expiryDate = new Date();
|
558 |
+
expiryDate.setHours( expiryDate.getHours() + hours);
|
559 |
+
document.cookie = 'boxzilla_box_'+ this.id + '=true; expires='+ expiryDate.toUTCString() +'; path=/';
|
560 |
};
|
561 |
|
562 |
Box.prototype.trigger = function() {
|
563 |
var shown = this.show();
|
564 |
+
if( ! shown ) {
|
565 |
+
return;
|
566 |
+
}
|
567 |
+
|
568 |
+
this.triggered = true;
|
569 |
+
if(this.config.cookie && this.config.cookie.triggered) {
|
570 |
+
this.setCookie(this.config.cookie.triggered);
|
571 |
}
|
572 |
};
|
573 |
|
574 |
Box.prototype.dismiss = function() {
|
575 |
this.hide();
|
576 |
+
|
577 |
+
if(this.config.cookie && this.config.cookie.dismissed) {
|
578 |
+
this.setCookie(this.config.cookie.dismissed);
|
579 |
+
}
|
580 |
+
|
581 |
+
this.dismissed = true;
|
582 |
Boxzilla.trigger('box.dismiss', [ this ]);
|
583 |
};
|
584 |
|
586 |
Boxzilla = _Boxzilla;
|
587 |
return Box;
|
588 |
};
|
589 |
+
},{"./animator.js":2}],4:[function(require,module,exports){
|
590 |
'use strict';
|
591 |
|
592 |
+
var EventEmitter = require('wolfy87-eventemitter'),
|
|
|
593 |
Boxzilla = Object.create(EventEmitter.prototype),
|
594 |
+
Box = require('./box.js')(Boxzilla),
|
595 |
+
Timer = require('./timer.js'),
|
596 |
boxes = {},
|
597 |
+
windowHeight, overlay,
|
598 |
+
exitIntentDelayTimer, exitIntentTriggered,
|
599 |
+
siteTimer, pageTimer, pageViews;
|
|
|
|
|
|
|
|
|
600 |
|
601 |
function each( obj, callback ) {
|
602 |
for( var key in obj ) {
|
754 |
|
755 |
// initialise & add event listeners
|
756 |
Boxzilla.init = function() {
|
757 |
+
siteTimer = new Timer(sessionStorage.getItem('boxzilla_timer') || 0);
|
758 |
+
pageTimer = new Timer(0);
|
759 |
+
pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;
|
760 |
+
windowHeight = window.innerHeight;
|
761 |
+
|
762 |
+
// insert styles into DOM
|
763 |
+
var styles = require('./styles.js');
|
764 |
+
var styleElement = document.createElement('style');
|
765 |
+
styleElement.setAttribute("type", "text/css");
|
766 |
+
styleElement.innerHTML = styles;
|
767 |
+
document.head.appendChild(styleElement);
|
768 |
|
769 |
// add overlay element to dom
|
770 |
+
overlay = document.createElement('div');
|
771 |
+
overlay.style.display = 'none';
|
772 |
overlay.id = 'boxzilla-overlay';
|
773 |
document.body.appendChild(overlay);
|
774 |
|
775 |
// event binds
|
776 |
+
window.addEventListener('scroll', throttle(checkHeightCriteria));
|
777 |
+
window.addEventListener('resize', throttle(recalculateHeights));
|
778 |
+
window.addEventListener('load', recalculateHeights );
|
779 |
+
overlay.addEventListener('click', onOverlayClick);
|
|
|
|
|
|
|
780 |
window.setInterval(checkTimeCriteria, 1000);
|
781 |
window.setTimeout(checkPageViewsCriteria, 1000 );
|
782 |
+
document.addEventListener('mouseleave', onMouseLeave);
|
783 |
+
document.addEventListener('mouseenter', onMouseEnter);
|
784 |
+
document.addEventListener('keyup', onKeyUp);
|
785 |
|
786 |
timers.start();
|
787 |
+
window.addEventListener('focus', timers.start);
|
788 |
+
window.addEventListener('beforeunload', function() {
|
789 |
timers.stop();
|
790 |
sessionStorage.setItem('boxzilla_pageviews', ++pageViews);
|
791 |
});
|
792 |
+
window.addEventListener('blur', timers.stop);
|
793 |
|
794 |
Boxzilla.trigger('ready');
|
795 |
};
|
846 |
if ( typeof module !== 'undefined' && module.exports ) {
|
847 |
module.exports = Boxzilla;
|
848 |
}
|
849 |
+
},{"./box.js":3,"./styles.js":5,"./timer.js":6,"wolfy87-eventemitter":7}],5:[function(require,module,exports){
|
850 |
+
const styles = `#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}`;
|
851 |
+
module.exports = styles;
|
852 |
+
},{}],6:[function(require,module,exports){
|
853 |
'use strict';
|
854 |
|
855 |
var Timer = function(start) {
|
873 |
};
|
874 |
|
875 |
module.exports = Timer;
|
876 |
+
},{}],7:[function(require,module,exports){
|
877 |
/*!
|
878 |
* EventEmitter v4.2.11 - git.io/ee
|
879 |
* Unlicense - http://unlicense.org/
|
assets/js/script.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(){var e=void 0,t=void 0;!function i(t,n,o){function r(c,l){if(!n[c]){if(!t[c]){var a="function"==typeof e&&e;if(!l&&a)return a(c,!0);if(s)return s(c,!0);var f=new Error("Cannot find module '"+c+"'");throw f.code="MODULE_NOT_FOUND",f}var u=n[c]={exports:{}};t[c][0].call(u.exports,function(e){var i=t[c][1][e];return r(i?i:e)},u,u.exports,i,t,n,o)}return n[c].exports}for(var s="function"==typeof e&&e,c=0;c<o.length;c++)r(o[c]);return r}({1:[function(e,t,i){"use strict";function n(e,t){t.background_color&&(e.style.background=t.background_color),t.color&&(e.style.color=t.color),t.border_color&&(e.style.borderColor=t.border_color),t.border_width&&(e.style.borderWidth=parseInt(t.border_width)+"px"),t.border_style&&(e.style.borderStyle=t.border_style),t.width&&(e.style.maxWidth=parseInt(t.width)+"px")}var o=e("boxzilla"),r=window.boxzilla_options,s=document.body.className.indexOf("logged-in")>-1;s&&r.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),o.init();for(var c=0;c<r.boxes.length;c++){var l=r.boxes[c];l.testMode=s&&r.testMode,"https"===window.location.origin.substring(0,5)&&(l.content=l.content.replace(window.location.origin.replace("https","http"),window.location.origin));var a=o.create(l.id,l);n(a.element,l.css)}window.addEventListener("load",function(){if("object"==typeof window.mc4wp_forms_config&&window.mc4wp_forms_config.submitted_form){var e="#"+window.mc4wp_forms_config.submitted_form.element_id,t=o.boxes;for(var i in t)if(t.hasOwnProperty(i)){var n=t[i];if(n.element.querySelector(e))return void n.show()}}}),window.Boxzilla=o},{boxzilla:3}],2:[function(e,t,i){"use strict";function n(e,t){var i={};for(var n in e)i[n]=e[n];for(var n in t)i[n]=t[n];return i}var o,r=window.jQuery,s={animation:"fade",rehide:!1,content:"",cookieTime:0,icon:"×",minimumScreenWidth:0,position:"center",testMode:!1,trigger:!1,closable:!0},c=function(e,t){this.id=e,this.config=n(s,t),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.closed=!1,this.triggered=!1,this.triggerHeight=0,this.cookieSet=!1,this.config.trigger&&("percentage"!==this.config.trigger.method&&"element"!==this.config.trigger.method||(this.triggerHeight=this.calculateTriggerHeight()),this.cookieSet=this.isCookieSet()),this.element=this.dom(),this.$element=r(this.element),this.events()};c.prototype.events=function(){var e=this;this.$element.find(".boxzilla-close-icon").click(e.dismiss.bind(this)),this.$element.on("click","a",function(t){o.trigger("box.interactions.link",[e,t.target])}),this.$element.on("submit","form",function(t){e.setCookie(),o.trigger("box.interactions.form",[e,t.target])}),r(document.body).on("click",'a[href="#boxzilla-'+e.id+'"]',function(){return e.toggle(),!1}),this.fits()&&this.locationHashRefersBox()&&r(window).load(this.show.bind(this))},c.prototype.dom=function(){var e=document.createElement("div");e.className="boxzilla-container boxzilla-"+this.config.position+"-container";var t=document.createElement("div");t.setAttribute("id","boxzilla-"+this.id),t.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,t.style.display="none",e.appendChild(t);var i=document.createElement("div");i.className="boxzilla-content",i.innerHTML=this.config.content,t.appendChild(i);var n=i.querySelectorAll("script");if(n.length){for(var o=document.createElement("script"),s=0;s<n.length;s++)o.appendChild(document.createTextNode(n[s].text)),n[s].parentNode.removeChild(n[s]);document.body.appendChild(o)}if(window.jQuery=r,this.config.closable&&this.config.icon){var c=document.createElement("span");c.className="boxzilla-close-icon",c.innerHTML=this.config.icon,t.appendChild(c)}return document.body.appendChild(e),t},c.prototype.setCustomBoxStyling=function(){this.element.style.overflowY="auto",this.element.style.maxHeight="none";var e=window.innerHeight,t=this.$element.outerHeight();if(t>e&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var i=(e-t)/2;i=i>=0?i:0,this.element.style.marginTop=i+"px"}},c.prototype.toggle=function(e){return"undefined"==typeof e&&(e=!this.visible),!this.$element.is(":animated")&&(e!==this.visible&&(!(!e&&!this.config.closable)&&(this.visible=e,this.setCustomBoxStyling(),"center"===this.config.position&&r(this.overlay).fadeToggle("slow"),o.trigger("box."+(e?"show":"hide"),[this]),"fade"===this.config.animation?this.$element.fadeToggle("slow"):this.$element.slideToggle("slow"),!0)))},c.prototype.show=function(){return this.toggle(!0)},c.prototype.hide=function(){return this.toggle(!1)},c.prototype.calculateTriggerHeight=function(){var e=0;if("element"===this.config.trigger.method){var t=r(this.config.trigger.value).first();e=t.length>0?t.offset().top:0}else"percentage"===this.config.trigger.method&&(e=this.config.trigger.value/100*r(document).height());return e},c.prototype.setCookie=function(){if(this.config.cookieTime){var e=new Date;e.setDate(e.getDate()+this.config.cookieTime),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"}},c.prototype.locationHashRefersBox=function(){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.substring(1);return e===this.element.id||!!this.element.querySelector("#"+e)},c.prototype.fits=function(){return this.config.minimumScreenWidth<=0||window.innerWidth>this.config.minimumScreenWidth},c.prototype.mayAutoShow=function(){return!this.closed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},c.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},c.prototype.isCookieSet=function(){if(this.config.testMode)return!1;if(!this.config.cookieTime)return!1;var e="true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1");return e},c.prototype.trigger=function(){var e=this.show();e&&(this.triggered=!0)},c.prototype.dismiss=function(){this.hide(),this.setCookie(),this.closed=!0,o.trigger("box.dismiss",[this])},t.exports=function(e){return o=e,c}},{}],3:[function(e,t,i){"use strict";function n(e,t){for(var i in e)e.hasOwnProperty(i)&&t(e[i])}function o(e,t,i){t||(t=250);var n,o;return function(){var r=i||this,s=+new Date,c=arguments;n&&s<n+t?(clearTimeout(o),o=setTimeout(function(){n=s,e.apply(r,c)},t)):(n=s,e.apply(r,c))}}function r(e){27==e.keyCode&&w.dismiss()}function s(){n(x,function(e){e.mayAutoShow()&&"pageviews"===e.config.trigger.method&&z>=e.config.trigger.value&&e.trigger()})}function c(){n(x,function(e){e.mayAutoShow()&&("time_on_site"===e.config.trigger.method&&L.time>=e.config.trigger.value&&e.trigger(),"time_on_page"===e.config.trigger.method&&k.time>=e.config.trigger.value&&e.trigger())})}function l(){var e=window.scrollY,t=e+.667*_;n(x,function(e){!e.mayAutoShow()||e.triggerHeight<=0||(t>e.triggerHeight?e.trigger():e.mayRehide()&&e.hide())})}function a(){_=window.innerHeight,n(x,function(e){e.setCustomBoxStyling()})}function f(e){var t=e.offsetX,i=e.offsetY;n(x,function(e){var n=e.element.getBoundingClientRect(),o=100+.05*window.innerWidth;(t<n.left-o||t>n.right+o||i<n.top-o||i>n.bottom+o)&&e.dismiss()})}function u(){m||(n(x,function(e){e.mayAutoShow()&&"exit_intent"===e.config.trigger.method&&e.trigger()}),m=!0)}function h(e){var t=400;e.clientY<=0&&(g=window.setTimeout(u,t))}function d(){g&&(window.clearInterval(g),g=null)}var g,m,p=window.jQuery,v=e("wolfy87-eventemitter"),w=Object.create(v.prototype),y=e("./Box.js")(w),b=e("./Timer.js"),x={},_=window.innerHeight,E=document.createElement("div"),L=new b(sessionStorage.getItem("boxzilla_timer")||0),k=new b(0),z=sessionStorage.getItem("boxzilla_pageviews")||0,S={start:function(){var e=sessionStorage.getItem("boxzilla_timer");e&&(L.time=e),L.start(),k.start()},stop:function(){sessionStorage.setItem("boxzilla_timer",L.time),L.stop(),k.stop()}};w.init=function(){var e=document.documentElement;E.id="boxzilla-overlay",document.body.appendChild(E),p(window).on("scroll",o(l)),p(window).on("resize",o(a)),p(window).on("load",a),p(e).on("mouseleave",h),p(e).on("mouseenter",d),p(e).on("keyup",r),p(E).click(f),window.setInterval(c,1e3),window.setTimeout(s,1e3),S.start(),p(window).on("focus",S.start),p(window).on("beforeunload",function(){S.stop(),sessionStorage.setItem("boxzilla_pageviews",++z)}),p(window).on("blur",S.stop),w.trigger("ready")},w.create=function(e,t){return x[e]=new y(e,t),x[e]},w.dismiss=function(e){"undefined"==typeof e?n(x,function(e){e.dismiss()}):"object"==typeof x[e]&&x[e].dismiss()},w.hide=function(e){"undefined"==typeof e?n(x,function(e){e.hide()}):"object"==typeof x[e]&&x[e].hide()},w.show=function(e){"undefined"==typeof e?n(x,function(e){e.show()}):"object"==typeof x[e]&&x[e].show()},w.toggle=function(e){"undefined"==typeof e?n(x,function(e){e.toggle()}):"object"==typeof x[e]&&x[e].toggle()},window.Boxzilla=w,"undefined"!=typeof t&&t.exports&&(t.exports=w)},{"./Box.js":2,"./Timer.js":4,"wolfy87-eventemitter":5}],4:[function(e,t,i){"use strict";var n=function(e){this.time=e,this.interval=0};n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){window.clearInterval(this.interval),this.interval=0},t.exports=n},{}],5:[function(e,i,n){(function(){"use strict";function e(){}function n(e,t){for(var i=e.length;i--;)if(e[i].listener===t)return i;return-1}function o(e){return function(){return this[e].apply(this,arguments)}}var r=e.prototype,s=this,c=s.EventEmitter;r.getListeners=function(e){var t,i,n=this._getEvents();if(e instanceof RegExp){t={};for(i in n)n.hasOwnProperty(i)&&e.test(i)&&(t[i]=n[i])}else t=n[e]||(n[e]=[]);return t},r.flattenListeners=function(e){var t,i=[];for(t=0;t<e.length;t+=1)i.push(e[t].listener);return i},r.getListenersAsObject=function(e){var t,i=this.getListeners(e);return i instanceof Array&&(t={},t[e]=i),t||i},r.addListener=function(e,t){var i,o=this.getListenersAsObject(e),r="object"==typeof t;for(i in o)o.hasOwnProperty(i)&&n(o[i],t)===-1&&o[i].push(r?t:{listener:t,once:!1});return this},r.on=o("addListener"),r.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},r.once=o("addOnceListener"),r.defineEvent=function(e){return this.getListeners(e),this},r.defineEvents=function(e){for(var t=0;t<e.length;t+=1)this.defineEvent(e[t]);return this},r.removeListener=function(e,t){var i,o,r=this.getListenersAsObject(e);for(o in r)r.hasOwnProperty(o)&&(i=n(r[o],t),i!==-1&&r[o].splice(i,1));return this},r.off=o("removeListener"),r.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},r.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},r.manipulateListeners=function(e,t,i){var n,o,r=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(n=i.length;n--;)r.call(this,t,i[n]);else for(n in t)t.hasOwnProperty(n)&&(o=t[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},r.removeEvent=function(e){var t,i=typeof e,n=this._getEvents();if("string"===i)delete n[e];else if(e instanceof RegExp)for(t in n)n.hasOwnProperty(t)&&e.test(t)&&delete n[t];else delete this._events;return this},r.removeAllListeners=o("removeEvent"),r.emitEvent=function(e,t){var i,n,o,r,s,c=this.getListenersAsObject(e);for(r in c)if(c.hasOwnProperty(r))for(i=c[r].slice(0),o=i.length;o--;)n=i[o],n.once===!0&&this.removeListener(e,n.listener),s=n.listener.apply(this,t||[]),s===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},r.trigger=o("emitEvent"),r.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},r.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},r._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},r._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return s.EventEmitter=c,e},"function"==typeof t&&t.amd?t(function(){return e}):"object"==typeof i&&i.exports?i.exports=e:s.EventEmitter=e}).call(this)},{}]},{},[1])}();
|
2 |
//# sourceMappingURL=script.min.js.map
|
1 |
+
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};!function(){var t=void 0,e=void 0;!function i(e,n,o){function r(a,l){if(!n[a]){if(!e[a]){var c="function"==typeof t&&t;if(!l&&c)return c(a,!0);if(s)return s(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var i=e[a][1][t];return r(i?i:t)},f,f.exports,i,e,n,o)}return n[a].exports}for(var s="function"==typeof t&&t,a=0;a<o.length;a++)r(o[a]);return r}({1:[function(t,e,i){function n(t,e){e.background_color&&(t.style.background=e.background_color),e.color&&(t.style.color=e.color),e.border_color&&(t.style.borderColor=e.border_color),e.border_width&&(t.style.borderWidth=parseInt(e.border_width)+"px"),e.border_style&&(t.style.borderStyle=e.border_style),e.width&&(t.style.maxWidth=parseInt(e.width)+"px")}var o=t("boxzilla"),r=window.boxzilla_options,s=document.body.className.indexOf("logged-in")>-1;s&&r.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),o.init();for(var a=0;a<r.boxes.length;a++){var l=r.boxes[a];l.testMode=s&&r.testMode,"https"===window.location.origin.substring(0,5)&&(l.content=l.content.replace(window.location.origin.replace("https","http"),window.location.origin));var c=o.create(l.id,l);n(c.element,l.css)}window.addEventListener("load",function(){if("object"===_typeof(window.mc4wp_forms_config)&&window.mc4wp_forms_config.submitted_form){var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=o.boxes;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n.element.querySelector(t))return void n.show()}}}),window.Boxzilla=o},{boxzilla:4}],2:[function(t,e,i){function n(t,e){for(var i in e)t.style[i]=e[i]}function o(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}function r(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}function s(t){return!!t.getAttribute("data-animated")}function a(t,e){var i="none"!=t.style.display||t.offsetLeft>0,s=t.cloneNode(!0),a=function(){t.removeAttribute("data-animated"),t.setAttribute("style",s.getAttribute("style")),t.style.display=i?"none":""};t.setAttribute("data-animated","true"),i||(t.style.display="");var c,d;if("slide"===e){if(c=o(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),d={},!i){var f=window.getComputedStyle(t);d=r(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],f),n(t,c)}t.style.overflowY="hidden",l(t,i?c:d,a)}else c={opacity:0},d={opacity:1},i||n(t,c),l(t,i?c:d,a)}function l(t,e,i){var n=+new Date,o=window.getComputedStyle(t),r={},s={};for(var a in e){e[a]=parseFloat(e[a]);var l=e[a],d=parseFloat(o[a]);d!=l?(s[a]=(l-d)/c,r[a]=d):delete e[a]}var f=function u(){var o,a,l,c,d=+new Date,f=d-n,h=!0;for(var g in e){o=s[g],a=e[g],l=o*f,c=r[g]+l,o>0&&c>=a||o<0&&c<=a?c=a:h=!1,r[g]=c;var p="opacity"!==g?"px":"";t.style[g]=c+p}n=+new Date,h?i&&i():window.requestAnimationFrame&&requestAnimationFrame(u)||setTimeout(u,32)};f()}var c=320;e.exports={toggle:a,animate:l,animated:s}},{}],3:[function(t,e,i){function n(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i}var o,r={animation:"fade",rehide:!1,content:"",cookie:null,icon:"×",minimumScreenWidth:0,position:"center",testMode:!1,trigger:!1,closable:!0},s=t("./animator.js"),a=function(t,e){this.id=t,this.config=n(r,e),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=0,this.cookieSet=!1,this.element=null,this.closeIcon=null,this.config.trigger&&("percentage"!==this.config.trigger.method&&"element"!==this.config.trigger.method||(this.triggerHeight=this.calculateTriggerHeight()),this.cookieSet=this.isCookieSet()),this.dom(),this.events()};a.prototype.events=function(){var t=this;this.closeIcon&&this.closeIcon.addEventListener("click",t.dismiss.bind(this)),this.element.addEventListener("click",function(e){"A"===e.target.tagName&&o.trigger("box.interactions.link",[t,e.target])},!1),this.element.addEventListener("submit",function(e){t.setCookie(),o.trigger("box.interactions.form",[t,e.target])},!1),document.body.addEventListener("click",function(e){if("A"===e.target.tagName){var i="#boxzilla-"+t.id,n=e.target.getAttribute("href");n&&n.substring(-i.length)===i&&(t.toggle(),e.preventDefault())}},!1),this.fits()&&this.locationHashRefersBox()&&window.addEventListener("load",this.show.bind(this))},a.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e=document.createElement("div");e.setAttribute("id","boxzilla-"+this.id),e.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,e.style.display="none",t.appendChild(e);var i=document.createElement("div");i.className="boxzilla-content",i.innerHTML=this.config.content,e.appendChild(i);var n=i.querySelectorAll("script");if(n.length){for(var o=document.createElement("script"),r=0;r<n.length;r++)o.appendChild(document.createTextNode(n[r].text)),n[r].parentNode.removeChild(n[r]);document.body.appendChild(o)}if(this.config.closable&&this.config.icon){var s=document.createElement("span");s.className="boxzilla-close-icon",s.innerHTML=this.config.icon,e.appendChild(s),this.closeIcon=s}document.body.appendChild(t),this.element=e},a.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},a.prototype.toggle=function(t){if("undefined"==typeof t&&(t=!this.visible),t===this.visible)return!1;if(s.animated(this.element))return!1;if(!t&&!this.config.closable)return!1;this.visible=t,this.setCustomBoxStyling(),o.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&s.toggle(this.overlay,"fade"),s.toggle(this.element,this.config.animation);var e=this.element.querySelector("input, textarea");return e&&e.focus(),!0},a.prototype.show=function(){return this.toggle(!0)},a.prototype.hide=function(){return this.toggle(!1)},a.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*document.body.clientHeight);return t},a.prototype.locationHashRefersBox=function(){if(!window.location.hash||0===window.location.hash.length)return!1;var t=window.location.hash.substring(1);return t===this.element.id||!!this.element.querySelector("#"+t)},a.prototype.fits=function(){return this.config.minimumScreenWidth<=0||window.innerWidth>this.config.minimumScreenWidth},a.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},a.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},a.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},a.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},a.prototype.trigger=function(){var t=this.show();t&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},a.prototype.dismiss=function(){this.hide(),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,o.trigger("box.dismiss",[this])},e.exports=function(t){return o=t,a}},{"./animator.js":2}],4:[function(t,e,i){function n(t,e){for(var i in t)t.hasOwnProperty(i)&&e(t[i])}function o(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 r(t){27==t.keyCode&&_.dismiss()}function s(){n(E,function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&w>=t.config.trigger.value&&t.trigger()})}function a(){n(E,function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&y.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&b.time>=t.config.trigger.value&&t.trigger())})}function l(){var t=window.scrollY,e=t+.667*g;n(E,function(t){!t.mayAutoShow()||t.triggerHeight<=0||(e>t.triggerHeight?t.trigger():t.mayRehide()&&t.hide())})}function c(){g=window.innerHeight,n(E,function(t){t.setCustomBoxStyling()})}function d(t){var e=t.offsetX,i=t.offsetY;n(E,function(t){var n=t.element.getBoundingClientRect(),o=100+.05*window.innerWidth;(e<n.left-o||e>n.right+o||i<n.top-o||i>n.bottom+o)&&t.dismiss()})}function f(){v||(n(E,function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()}),v=!0)}function u(t){var e=400;t.clientY<=0&&(m=window.setTimeout(f,e))}function h(){m&&(window.clearInterval(m),m=null)}var g,p,m,v,y,b,w,x=t("wolfy87-eventemitter"),_=Object.create(x.prototype),z=t("./box.js")(_),L=t("./timer.js"),E={},k={start:function(){var t=sessionStorage.getItem("boxzilla_timer");t&&(y.time=t),y.start(),b.start()},stop:function(){sessionStorage.setItem("boxzilla_timer",y.time),y.stop(),b.stop()}};_.init=function(){y=new L(sessionStorage.getItem("boxzilla_timer")||0),b=new L(0),w=sessionStorage.getItem("boxzilla_pageviews")||0,g=window.innerHeight;var e=t("./styles.js"),i=document.createElement("style");i.setAttribute("type","text/css"),i.innerHTML=e,document.head.appendChild(i),p=document.createElement("div"),p.style.display="none",p.id="boxzilla-overlay",document.body.appendChild(p),window.addEventListener("scroll",o(l)),window.addEventListener("resize",o(c)),window.addEventListener("load",c),p.addEventListener("click",d),window.setInterval(a,1e3),window.setTimeout(s,1e3),document.addEventListener("mouseleave",u),document.addEventListener("mouseenter",h),document.addEventListener("keyup",r),k.start(),window.addEventListener("focus",k.start),window.addEventListener("beforeunload",function(){k.stop(),sessionStorage.setItem("boxzilla_pageviews",++w)}),window.addEventListener("blur",k.stop),_.trigger("ready")},_.create=function(t,e){return E[t]=new z(t,e),E[t]},_.dismiss=function(t){"undefined"==typeof t?n(E,function(t){t.dismiss()}):"object"===_typeof(E[t])&&E[t].dismiss()},_.hide=function(t){"undefined"==typeof t?n(E,function(t){t.hide()}):"object"===_typeof(E[t])&&E[t].hide()},_.show=function(t){"undefined"==typeof t?n(E,function(t){t.show()}):"object"===_typeof(E[t])&&E[t].show()},_.toggle=function(t){"undefined"==typeof t?n(E,function(t){t.toggle()}):"object"===_typeof(E[t])&&E[t].toggle()},window.Boxzilla=_,"undefined"!=typeof e&&e.exports&&(e.exports=_)},{"./box.js":3,"./styles.js":5,"./timer.js":6,"wolfy87-eventemitter":7}],5:[function(t,e,i){var n="#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}";e.exports=n},{}],6:[function(t,e,i){var n=function(t){this.time=t,this.interval=0};n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){window.clearInterval(this.interval),this.interval=0},e.exports=n},{}],7:[function(t,i,n){(function(){function t(){}function n(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function o(t){return function(){return this[t].apply(this,arguments)}}var r=t.prototype,s=this,a=s.EventEmitter;r.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp){e={};for(i in n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i])}else e=n[t]||(n[t]=[]);return e},r.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},r.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},r.addListener=function(t,e){var i,o=this.getListenersAsObject(t),r="object"===("undefined"==typeof e?"undefined":_typeof(e));for(i in o)o.hasOwnProperty(i)&&n(o[i],e)===-1&&o[i].push(r?e:{listener:e,once:!1});return this},r.on=o("addListener"),r.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},r.once=o("addOnceListener"),r.defineEvent=function(t){return this.getListeners(t),this},r.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},r.removeListener=function(t,e){var i,o,r=this.getListenersAsObject(t);for(o in r)r.hasOwnProperty(o)&&(i=n(r[o],e),i!==-1&&r[o].splice(i,1));return this},r.off=o("removeListener"),r.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},r.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},r.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!==("undefined"==typeof e?"undefined":_typeof(e))||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},r.removeEvent=function(t){var e,i="undefined"==typeof t?"undefined":_typeof(t),n=this._getEvents();if("string"===i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},r.removeAllListeners=o("removeEvent"),r.emitEvent=function(t,e){var i,n,o,r,s,a=this.getListenersAsObject(t);for(r in a)if(a.hasOwnProperty(r))for(i=a[r].slice(0),o=i.length;o--;)n=i[o],n.once===!0&&this.removeListener(t,n.listener),s=n.listener.apply(this,e||[]),s===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},r.trigger=o("emitEvent"),r.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},r.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},r._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},r._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return s.EventEmitter=a,t},"function"==typeof e&&e.amd?e(function(){return t}):"object"===("undefined"==typeof i?"undefined":_typeof(i))&&i.exports?i.exports=t:s.EventEmitter=t}).call(this)},{}]},{},[1])}();
|
2 |
//# sourceMappingURL=script.min.js.map
|
assets/js/script.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["script.js"],"names":["require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","css","element","styles","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","Boxzilla","options","window","boxzilla_options","isLoggedIn","document","body","className","indexOf","testMode","console","log","init","boxes","boxOpts","location","origin","substring","content","replace","box","create","id","addEventListener","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","querySelector","show","boxzilla","2","merge","obj1","obj2","obj3","attrname","$","jQuery","defaults","animation","rehide","cookieTime","icon","minimumScreenWidth","position","trigger","closable","Box","config","this","overlay","getElementById","visible","closed","triggered","triggerHeight","cookieSet","method","calculateTriggerHeight","isCookieSet","dom","$element","events","prototype","find","click","dismiss","bind","on","target","setCookie","toggle","fits","locationHashRefersBox","load","wrapper","createElement","setAttribute","display","appendChild","innerHTML","scripts","querySelectorAll","script","createTextNode","text","parentNode","removeChild","setCustomBoxStyling","overflowY","maxHeight","windowHeight","innerHeight","boxHeight","outerHeight","newTopMargin","marginTop","is","fadeToggle","slideToggle","hide","$triggerElement","value","first","offset","top","height","expiryDate","Date","setDate","getDate","cookie","toUTCString","hash","elementId","innerWidth","mayAutoShow","mayRehide","RegExp","shown","_Boxzilla","3","each","obj","callback","key","throttle","fn","threshhold","scope","last","deferTimer","context","now","args","arguments","clearTimeout","setTimeout","apply","onKeyUp","keyCode","checkPageViewsCriteria","pageViews","checkTimeCriteria","siteTimer","time","pageTimer","checkHeightCriteria","scrollY","scrollHeight","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","getBoundingClientRect","margin","left","right","bottom","triggerExitIntent","exitIntentTriggered","onMouseLeave","delay","clientY","exitIntentDelayTimer","onMouseEnter","clearInterval","EventEmitter","Object","Timer","sessionStorage","getItem","timers","start","sessionTime","stop","setItem","html","documentElement","setInterval","opts","./Box.js","./Timer.js","wolfy87-eventemitter","4","interval","tick","5","indexOfListener","listeners","listener","alias","name","proto","originalGlobalValue","getListeners","evt","response","_getEvents","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,GAAIA,GAAUC,OAAgEC,EAASD,QAAW,QAAUE,GAAEC,EAAEC,EAAEC,GAAG,QAASC,GAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,GAAIE,GAAkB,kBAATV,IAAqBA,CAAQ,KAAIS,GAAGC,EAAE,MAAOA,GAAEF,GAAE,EAAI,IAAGG,EAAE,MAAOA,GAAEH,GAAE,EAAI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AAOJ,QAC1CI,EAAOJ,QAAUkM,EAGjBlM,EAAQkM,aAAeA,IAE7BjM,KAAKwE,gBAEI","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){\n'use strict';\n\nvar Boxzilla = require('boxzilla');\nvar options = window.boxzilla_options;\nvar isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n// print message when test mode is enabled\nif( isLoggedIn && options.testMode ) {\n console.log( 'Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.' );\n}\n\n// init boxzilla\nBoxzilla.init();\n\n// create boxes from options\nfor( var i=0; i < options.boxes.length; i++ ) {\n // get opts\n var boxOpts = options.boxes[i];\n boxOpts.testMode = isLoggedIn && options.testMode;\n\n // fix http:// links in box content....\n if( window.location.origin.substring(0, 5) === \"https\" ) {\n boxOpts.content = boxOpts.content.replace(window.location.origin.replace(\"https\", \"http\"), window.location.origin);\n }\n\n // create box\n var box = Boxzilla.create( boxOpts.id, boxOpts);\n \n // add custom css to box\n css(box.element, boxOpts.css);\n}\n\n// helper function for setting CSS styles\nfunction css(element, styles) {\n if( styles.background_color ) {\n element.style.background = styles.background_color;\n }\n\n if( styles.color ) {\n element.style.color = styles.color;\n }\n\n if( styles.border_color ) {\n element.style.borderColor = styles.border_color;\n }\n\n if( styles.border_width ) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if( styles.border_style ) {\n element.style.borderStyle = styles.border_style;\n }\n\n if( styles.width ) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n}\n\n/**\n * If a MailChimp for WordPress form was submitted, open the box containing that form (if any)\n *\n * TODO: Just set location hash from MailChimp for WP?\n */\nwindow.addEventListener('load', function() {\n if( typeof(window.mc4wp_forms_config) === \"object\" && window.mc4wp_forms_config.submitted_form ) {\n var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;\n var boxes = Boxzilla.boxes;\n for( var boxId in boxes ) {\n if(!boxes.hasOwnProperty(boxId)) { continue; }\n var box = boxes[boxId];\n if( box.element.querySelector(selector)) {\n box.show();\n return;\n }\n }\n }\n});\n\nwindow.Boxzilla = Boxzilla;\n},{\"boxzilla\":3}],2:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery,\n defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookieTime': 0,\n 'icon': '×',\n 'minimumScreenWidth': 0,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n },\n Boxzilla;\n\n/**\n * Merge 2 objects, values of the latter overwriting the former.\n *\n * @param obj1\n * @param obj2\n * @returns {*}\n */\nfunction merge( obj1, obj2 ) {\n var obj3 = {};\n for (var attrname in obj1) { obj3[attrname] = obj1[attrname]; }\n for (var attrname in obj2) { obj3[attrname] = obj2[attrname]; }\n return obj3;\n}\n\n// Box Object\nvar Box = function( id, config ) {\n this.id \t\t= id;\n\n // store config values\n this.config = merge(defaults, config);\n\n // store ref to overlay\n this.overlay = document.getElementById('boxzilla-overlay');\n\n // state\n this.visible \t= false;\n this.closed \t= false;\n this.triggered \t= false;\n this.triggerHeight = 0;\n this.cookieSet = false;\n\n // if a trigger was given, calculate values once and store\n if( this.config.trigger ) {\n if( this.config.trigger.method === 'percentage' || this.config.trigger.method === 'element' ) {\n this.triggerHeight = this.calculateTriggerHeight();\n }\n\n this.cookieSet = this.isCookieSet();\n }\n\n // create dom element for this box\n this.element = this.dom();\n this.$element = $(this.element);\n\n // further initialise the box\n this.events();\n};\n\n// initialise the box\nBox.prototype.events = function() {\n var box = this;\n\n // attach event to \"close\" icon inside box\n this.$element.find('.boxzilla-close-icon').click(box.dismiss.bind(this));\n\n this.$element.on('click', 'a', function(e) {\n Boxzilla.trigger('box.interactions.link', [ box, e.target ] );\n });\n\n this.$element.on('submit', 'form', function(e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [ box, e.target ]);\n });\n\n // attach event to all links referring #boxzilla-{box_id}\n $(document.body).on('click', 'a[href=\"#boxzilla-' + box.id + '\"]', function() {\n box.toggle();\n return false;\n });\n\n // maybe show box right away\n if( this.fits() && this.locationHashRefersBox() ) {\n $(window).load(this.show.bind(this));\n }\n\n};\n\n// generate dom elements for this box\nBox.prototype.dom = function() {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n\n var content = document.createElement('div');\n content.className = 'boxzilla-content';\n content.innerHTML = this.config.content;\n box.appendChild(content);\n\n // remove <script> from box content and append them to the document body\n var scripts = content.querySelectorAll('script');\n if(scripts.length) {\n var script = document.createElement('script');\n for( var i=0; i<scripts.length; i++ ) {\n script.appendChild(document.createTextNode(scripts[i].text));\n scripts[i].parentNode.removeChild(scripts[i]);\n }\n document.body.appendChild(script);\n }\n\n // for safety measure, restore jQuery\n window.jQuery = $;\n\n if( this.config.closable && this.config.icon ) {\n var icon = document.createElement('span');\n icon.className = \"boxzilla-close-icon\";\n icon.innerHTML = this.config.icon;\n box.appendChild(icon);\n }\n\n document.body.appendChild(wrapper);\n\n return box;\n};\n\n// set (calculate) custom box styling depending on box options\nBox.prototype.setCustomBoxStyling = function() {\n\n // reset element to its initial state\n this.element.style.overflowY = 'auto';\n this.element.style.maxHeight = 'none';\n\n // get new dimensions\n var windowHeight = window.innerHeight;\n var boxHeight = this.$element.outerHeight();\n\n // add scrollbar to box and limit height\n if( boxHeight > windowHeight ) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n }\n\n // set new top margin for boxes which are centered\n if( this.config.position === 'center' ) {\n var newTopMargin = ( ( windowHeight - boxHeight ) / 2 );\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n};\n\n// toggle visibility of the box\nBox.prototype.toggle = function(show) {\n\n // revert visibility if no explicit argument is given\n if( typeof( show ) === \"undefined\" ) {\n show = ! this.visible;\n }\n\n // do nothing if element is being animated\n if( this.$element.is(':animated') ) {\n return false;\n }\n\n // is box already at desired visibility?\n if( show === this.visible ) {\n return false;\n }\n\n // if box should be hidden but is not closable, bail.\n if( ! show && ! this.config.closable ) {\n return false;\n }\n\n // set new visibility status\n this.visible = show;\n\n // calculate custom styling for which CSS is \"too stupid\"\n this.setCustomBoxStyling();\n\n // fadein / fadeout the overlay if position is \"center\"\n if( this.config.position === 'center' ) {\n $(this.overlay).fadeToggle('slow');\n }\n\n // trigger event\n Boxzilla.trigger('box.' + ( show ? 'show' : 'hide' ), [ this ] );\n\n // show or hide box using selected animation\n if( this.config.animation === 'fade' ) {\n this.$element.fadeToggle( 'slow' );\n } else {\n this.$element.slideToggle( 'slow' );\n }\n\n // // focus on first input field in box\n // this.$element.find('input').first().focus();\n\n return true;\n};\n\n// show the box\nBox.prototype.show = function() {\n return this.toggle(true);\n};\n\n// hide the box\nBox.prototype.hide = function() {\n return this.toggle(false);\n};\n\n// calculate trigger height\nBox.prototype.calculateTriggerHeight = function() {\n var triggerHeight = 0;\n\n if( this.config.trigger.method === 'element' ) {\n var $triggerElement = $(this.config.trigger.value).first();\n triggerHeight = ( $triggerElement.length > 0 ) ? $triggerElement.offset().top : 0;\n } else if( this.config.trigger.method === 'percentage' ) {\n triggerHeight = ( this.config.trigger.value / 100 * $(document).height() );\n }\n\n return triggerHeight;\n};\n\n// set cookie that disables automatically showing the box\nBox.prototype.setCookie = function() {\n // do nothing if cookieTime evaluates to false\n if(! this.config.cookieTime) {\n return;\n }\n\n var expiryDate = new Date();\n expiryDate.setDate( expiryDate.getDate() + this.config.cookieTime );\n document.cookie = 'boxzilla_box_'+ this.id + '=true; expires='+ expiryDate.toUTCString() +'; path=/';\n};\n\n// checks whether window.location.hash equals the box element ID or that of any element inside the box\nBox.prototype.locationHashRefersBox = function() {\n\n if( ! window.location.hash || 0 === window.location.hash.length ) {\n return false;\n }\n\n var elementId = window.location.hash.substring(1);\n if( elementId === this.element.id ) {\n return true;\n } else if( this.element.querySelector('#' + elementId) ) {\n return true;\n }\n\n return false;\n};\n\nBox.prototype.fits = function() {\n if( this.config.minimumScreenWidth <= 0 ) {\n return true;\n }\n\n return window.innerWidth > this.config.minimumScreenWidth\n};\n\n// is this box enabled?\nBox.prototype.mayAutoShow = function() {\n\n // don't show if box was closed (dismissed) before\n if( this.closed ) {\n return false;\n }\n\n // check if box fits on given minimum screen width\n if( ! this.fits() ) {\n return false;\n }\n\n // if trigger empty or error in calculating triggerHeight, return false\n if( ! this.config.trigger ) {\n return false;\n }\n\n // rely on cookie value (show if not set, don't show if set)\n return ! this.cookieSet;\n};\n\nBox.prototype.mayRehide = function() {\n return this.config.rehide && this.triggered;\n};\n\nBox.prototype.isCookieSet = function() {\n // always show on test mode\n if( this.config.testMode ) {\n return false;\n }\n\n // check for cookie\n if( ! this.config.cookieTime ) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n\n};\n\nBox.prototype.trigger = function() {\n var shown = this.show();\n if( shown ) {\n this.triggered = true;\n }\n};\n\nBox.prototype.dismiss = function() {\n this.hide();\n this.setCookie();\n this.closed = true;\n Boxzilla.trigger('box.dismiss', [ this ]);\n};\n\nmodule.exports = function(_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n};\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery,\n EventEmitter = require('wolfy87-eventemitter'),\n Boxzilla = Object.create(EventEmitter.prototype),\n Box = require('./Box.js')(Boxzilla),\n Timer = require('./Timer.js'),\n boxes = {},\n windowHeight = window.innerHeight,\n overlay = document.createElement('div'),\n exitIntentDelayTimer,\n exitIntentTriggered,\n siteTimer = new Timer(sessionStorage.getItem('boxzilla_timer') || 0),\n pageTimer = new Timer(0),\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n\nfunction each( obj, callback ) {\n for( var key in obj ) {\n if(! obj.hasOwnProperty(key)) continue;\n callback(obj[key]);\n }\n}\n\nfunction throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last,\n deferTimer;\n return function () {\n var context = scope || this;\n\n var now = +new Date,\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n}\n\n// \"keyup\" listener\nfunction onKeyUp(e) {\n if (e.keyCode == 27) {\n Boxzilla.dismiss();\n }\n}\n\n// check \"pageviews\" criteria for each box\nfunction checkPageViewsCriteria() {\n each(boxes, function(box) {\n if( ! box.mayAutoShow() ) {\n return;\n }\n\n if( box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value ) {\n box.trigger();\n }\n });\n}\n\n// check time trigger criteria for each box\nfunction checkTimeCriteria() {\n each(boxes, function(box) {\n if( ! box.mayAutoShow() ) {\n return;\n }\n\n // check \"time on site\" trigger\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n\n // check \"time on page\" trigger\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n}\n\n// check triggerHeight criteria for all boxes\nfunction checkHeightCriteria() {\n var scrollY = window.scrollY;\n var scrollHeight = scrollY + ( windowHeight * 0.667 );\n\n each(boxes, function(box) {\n if( ! box.mayAutoShow() || box.triggerHeight <= 0 ) {\n return;\n }\n\n if( scrollHeight > box.triggerHeight ) {\n box.trigger();\n } else if( box.mayRehide() ) {\n box.hide();\n }\n });\n}\n\n// recalculate heights and variables based on height\nfunction recalculateHeights() {\n windowHeight = window.innerHeight;\n\n each(boxes, function(box) {\n box.setCustomBoxStyling();\n });\n}\n\nfunction onOverlayClick(e) {\n var x = e.offsetX;\n var y = e.offsetY;\n\n // calculate if click was near a box to avoid closing it (click error margin)\n each(boxes, function(box) {\n var rect = box.element.getBoundingClientRect();\n var margin = 100 + ( window.innerWidth * 0.05 );\n\n // if click was not anywhere near box, dismiss it.\n if( x < ( rect.left - margin ) || x > ( rect.right + margin ) || y < ( rect.top - margin ) || y > ( rect.bottom + margin ) ) {\n box.dismiss();\n }\n });\n}\n\nfunction triggerExitIntent() {\n if(exitIntentTriggered) return;\n\n each(boxes, function(box) {\n if(box.mayAutoShow() && box.config.trigger.method === 'exit_intent' ) {\n box.trigger();\n }\n });\n\n exitIntentTriggered = true;\n}\n\nfunction onMouseLeave(e) {\n var delay = 400;\n\n // did mouse leave at top of window?\n if( e.clientY <= 0 ) {\n exitIntentDelayTimer = window.setTimeout(triggerExitIntent, delay);\n }\n}\n\nfunction onMouseEnter() {\n if( exitIntentDelayTimer ) {\n window.clearInterval(exitIntentDelayTimer);\n exitIntentDelayTimer = null;\n }\n}\n\nvar timers = {\n start: function() {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if( sessionTime ) siteTimer.time = sessionTime;\n siteTimer.start();\n pageTimer.start();\n },\n stop: function() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n};\n\n// initialise & add event listeners\nBoxzilla.init = function() {\n var html = document.documentElement;\n\n // add overlay element to dom\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay);\n\n // event binds\n $(window).on('scroll', throttle(checkHeightCriteria));\n $(window).on('resize', throttle(recalculateHeights));\n $(window).on('load', recalculateHeights );\n $(html).on('mouseleave', onMouseLeave);\n $(html).on('mouseenter', onMouseEnter);\n $(html).on('keyup', onKeyUp);\n $(overlay).click(onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000 );\n\n timers.start();\n $(window).on('focus', timers.start);\n $(window).on('beforeunload', function() {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n $(window).on('blur', timers.stop);\n\n Boxzilla.trigger('ready');\n};\n\n/**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\nBoxzilla.create = function(id, opts) {\n boxes[id] = new Box(id, opts);\n return boxes[id];\n};\n\n// dismiss a single box (or all by omitting id param)\nBoxzilla.dismiss = function(id) {\n // if no id given, dismiss all current open boxes\n if( typeof(id) === \"undefined\" ) {\n each(boxes, function(box) { box.dismiss(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].dismiss();\n }\n};\n\nBoxzilla.hide = function(id) {\n if( typeof(id) === \"undefined\" ) {\n each(boxes, function(box) { box.hide(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].hide();\n }\n};\n\nBoxzilla.show = function(id) {\n if( typeof(id) === \"undefined\" ) {\n each(boxes, function(box) { box.show(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].show();\n }\n};\n\nBoxzilla.toggle = function(id) {\n if( typeof(id) === \"undefined\" ) {\n each(boxes, function(box) { box.toggle(); });\n } else if( typeof( boxes[id] ) === \"object\" ) {\n boxes[id].toggle();\n }\n};\n\nwindow.Boxzilla = Boxzilla;\n\nif ( typeof module !== 'undefined' && module.exports ) {\n module.exports = Boxzilla;\n}\n},{\"./Box.js\":2,\"./Timer.js\":4,\"wolfy87-eventemitter\":5}],4:[function(require,module,exports){\n'use strict';\n\nvar Timer = function(start) {\n this.time = start;\n this.interval = 0;\n};\n\nTimer.prototype.tick = function() {\n this.time++;\n};\n\nTimer.prototype.start = function() {\n if( ! this.interval ) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n};\n\nTimer.prototype.stop = function() {\n window.clearInterval(this.interval);\n this.interval = 0;\n};\n\nmodule.exports = Timer;\n},{}],5:[function(require,module,exports){\n/*!\n * EventEmitter v4.2.11 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n;(function () {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var exports = this;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n i = listeners.length;\n\n while (i--) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}.call(this));\n\n},{}]},{},[1]);\n; })();"],"sourceRoot":"/source/"}
|
1 |
+
{"version":3,"sources":["script.js"],"names":["_typeof","Symbol","iterator","obj","constructor","require","undefined","define","e","t","n","r","s","o","u","a","i","f","Error","code","l","exports","call","length","1","module","css","element","styles","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","Boxzilla","options","window","boxzilla_options","isLoggedIn","document","body","className","indexOf","testMode","console","log","init","boxes","boxOpts","location","origin","substring","content","replace","box","create","id","addEventListener","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","querySelector","show","boxzilla","2","property","initObjectProperties","properties","value","newObject","copyObjectProperties","object","animated","getAttribute","toggle","animation","nowVisible","display","offsetLeft","clone","cloneNode","cleanup","removeAttribute","setAttribute","hiddenStyles","visibleStyles","computedStyles","getComputedStyle","overflowY","animate","opacity","targetStyles","fn","last","Date","initialStyles","currentStyles","propSteps","parseFloat","to","current","duration","tick","step","increment","newValue","now","timeSinceLastTick","done","suffix","requestAnimationFrame","setTimeout","3","merge","obj1","obj2","obj3","attrname","defaults","rehide","cookie","icon","minimumScreenWidth","position","trigger","closable","Animator","Box","config","this","overlay","getElementById","visible","dismissed","triggered","triggerHeight","cookieSet","closeIcon","method","calculateTriggerHeight","isCookieSet","dom","events","prototype","dismiss","bind","target","tagName","setCookie","needle","haystack","preventDefault","fits","locationHashRefersBox","wrapper","createElement","appendChild","innerHTML","scripts","querySelectorAll","script","createTextNode","text","parentNode","removeChild","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","clientHeight","newTopMargin","marginTop","firstInput","focus","hide","triggerElement","offset","getBoundingClientRect","top","hash","elementId","innerWidth","mayAutoShow","mayRehide","RegExp","hours","expiryDate","setHours","getHours","toUTCString","shown","_Boxzilla","./animator.js","4","each","callback","key","throttle","threshhold","scope","deferTimer","context","args","arguments","clearTimeout","apply","onKeyUp","keyCode","checkPageViewsCriteria","pageViews","checkTimeCriteria","siteTimer","time","pageTimer","checkHeightCriteria","scrollY","scrollHeight","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","margin","left","right","bottom","triggerExitIntent","exitIntentTriggered","onMouseLeave","delay","clientY","exitIntentDelayTimer","onMouseEnter","clearInterval","EventEmitter","Object","Timer","timers","start","sessionTime","sessionStorage","getItem","stop","setItem","styleElement","head","setInterval","opts","./box.js","./styles.js","./timer.js","wolfy87-eventemitter","5","6","interval","7","indexOfListener","listeners","listener","alias","name","proto","originalGlobalValue","getListeners","evt","response","_getEvents","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","listenerIsWrapped","once","on","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"AAAA,YAEA,IAAIA,SAA4B,kBAAXC,SAAoD,gBAApBA,QAAOC,SAAwB,SAAUC,GAAO,aAAcA,IAAS,SAAUA,GAAO,MAAOA,IAAyB,kBAAXF,SAAyBE,EAAIC,cAAgBH,OAAS,eAAkBE,KAE1O,WACI,GAAIE,GAAUC,OAA6DC,EAASD,QAAU,QAAUE,GAAEC,EAAGC,EAAGC,GAC5G,QAASC,GAAEC,EAAGC,GACV,IAAKJ,EAAEG,GAAI,CACP,IAAKJ,EAAEI,GAAI,CACP,GAAIE,GAAsB,kBAAXV,IAAyBA,CAAQ,KAAKS,GAAKC,EAAG,MAAOA,GAAEF,GAAG,EAAI,IAAIG,EAAG,MAAOA,GAAEH,GAAG,EAAI,IAAII,GAAI,GAAIC,OAAM,uBAAyBL,EAAI,IAAK,MAAMI,GAAEE,KAAO,mBAAoBF,EAC9L,GAAIG,GAAIV,EAAEG,IAAOQ,WAAcZ,GAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAS,SAAUb,GAC9D,GAAI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Q,EAAWD,EAAUhQ,GAEjBiQ,EAASiB,QAAS,GAClBtJ,KAAK4J,eAAejB,EAAKN,EAASA,UAGtCO,EAAWP,EAASA,SAASvD,MAAM9E,KAAM2E,OAErCiE,IAAa5I,KAAK6K,uBAClB7K,KAAK4J,eAAejB,EAAKN,EAASA,SAMlD,OAAOrI,OAMXwI,EAAM7I,QAAU2I,EAAM,aAUtBE,EAAMsC,KAAO,SAAcnC,GACvB,GAAIhE,GAAOwE,MAAMrI,UAAU8J,MAAMlS,KAAKkM,UAAW,EACjD,OAAO5E,MAAK0K,UAAU/B,EAAKhE,IAW/B6D,EAAMuC,mBAAqB,SAA4B5O,GAEnD,MADA6D,MAAKgL,iBAAmB7O,EACjB6D,MAWXwI,EAAMqC,oBAAsB,WACxB,OAAI7K,KAAKrE,eAAe,qBACbqE,KAAKgL,kBAYpBxC,EAAMK,WAAa,WACf,MAAO7I,MAAKwK,UAAYxK,KAAKwK,aAQjC3D,EAAaoE,WAAa,WAEtB,MADAxS,GAAQoO,aAAe4B,EAChB5B,GAIW,kBAAXlP,IAAyBA,EAAOuT,IACvCvT,EAAO,WACH,MAAOkP,KAEgE,YAAjD,mBAAXhO,GAAyB,YAAczB,QAAQyB,KAAyBA,EAAOJ,QAC9FI,EAAOJ,QAAUoO,EAEjBpO,EAAQoO,aAAeA,IAE5BnO,KAAKsH,gBACG","file":"script.min.js","sourcesContent":["\"use strict\";\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\n(function () {\n var require = undefined;var module = undefined;var exports = undefined;var define = undefined;(function e(t, n, r) {\n function s(o, u) {\n if (!n[o]) {\n if (!t[o]) {\n var a = typeof require == \"function\" && require;if (!u && a) return a(o, !0);if (i) return i(o, !0);var f = new Error(\"Cannot find module '\" + o + \"'\");throw f.code = \"MODULE_NOT_FOUND\", f;\n }var l = n[o] = { exports: {} };t[o][0].call(l.exports, function (e) {\n var n = t[o][1][e];return s(n ? n : e);\n }, l, l.exports, e, t, n, r);\n }return n[o].exports;\n }var i = typeof require == \"function\" && require;for (var o = 0; o < r.length; o++) {\n s(r[o]);\n }return s;\n })({ 1: [function (require, module, exports) {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n var options = window.boxzilla_options;\n var isLoggedIn = document.body.className.indexOf('logged-in') > -1;\n\n // print message when test mode is enabled\n if (isLoggedIn && options.testMode) {\n console.log('Boxzilla: Test mode is enabled. Please disable test mode if you\\'re done testing.');\n }\n\n // init boxzilla\n Boxzilla.init();\n\n // create boxes from options\n for (var i = 0; i < options.boxes.length; i++) {\n // get opts\n var boxOpts = options.boxes[i];\n boxOpts.testMode = isLoggedIn && options.testMode;\n\n // fix http:// links in box content....\n if (window.location.origin.substring(0, 5) === \"https\") {\n boxOpts.content = boxOpts.content.replace(window.location.origin.replace(\"https\", \"http\"), window.location.origin);\n }\n\n // create box\n var box = Boxzilla.create(boxOpts.id, boxOpts);\n\n // add custom css to box\n css(box.element, boxOpts.css);\n }\n\n // helper function for setting CSS styles\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n /**\n * If a MailChimp for WordPress form was submitted, open the box containing that form (if any)\n *\n * TODO: Just set location hash from MailChimp for WP?\n */\n window.addEventListener('load', function () {\n if (_typeof(window.mc4wp_forms_config) === \"object\" && window.mc4wp_forms_config.submitted_form) {\n var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;\n var boxes = Boxzilla.boxes;\n for (var boxId in boxes) {\n if (!boxes.hasOwnProperty(boxId)) {\n continue;\n }\n var box = boxes[boxId];\n if (box.element.querySelector(selector)) {\n box.show();\n return;\n }\n }\n }\n });\n\n window.Boxzilla = Boxzilla;\n }, { \"boxzilla\": 4 }], 2: [function (require, module, exports) {\n var duration = 320;\n\n function css(element, styles) {\n for (var property in styles) {\n element.style[property] = styles[property];\n }\n }\n\n function initObjectProperties(properties, value) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = value;\n }\n return newObject;\n }\n\n function copyObjectProperties(properties, object) {\n var newObject = {};\n for (var i = 0; i < properties.length; i++) {\n newObject[properties[i]] = object[properties[i]];\n }\n return newObject;\n }\n\n /**\n * Checks if the given element is currently being animated.\n *\n * @param element\n * @returns {boolean}\n */\n function animated(element) {\n return !!element.getAttribute('data-animated');\n }\n\n /**\n * Toggles the element using the given animation.\n *\n * @param element\n * @param animation Either \"fade\" or \"slide\"\n */\n function toggle(element, animation) {\n var nowVisible = element.style.display != 'none' || element.offsetLeft > 0;\n\n // create clone for reference\n var clone = element.cloneNode(true);\n var cleanup = function cleanup() {\n element.removeAttribute('data-animated');\n element.setAttribute('style', clone.getAttribute('style'));\n element.style.display = nowVisible ? 'none' : '';\n };\n\n // store attribute so everyone knows we're animating this element\n element.setAttribute('data-animated', \"true\");\n\n // toggle element visiblity right away if we're making something visible\n if (!nowVisible) {\n element.style.display = '';\n }\n\n var hiddenStyles, visibleStyles;\n\n // animate properties\n if (animation === 'slide') {\n hiddenStyles = initObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], 0);\n visibleStyles = {};\n\n if (!nowVisible) {\n var computedStyles = window.getComputedStyle(element);\n visibleStyles = copyObjectProperties([\"height\", \"borderTopWidth\", \"borderBottomWidth\", \"paddingTop\", \"paddingBottom\"], computedStyles);\n css(element, hiddenStyles);\n }\n\n // don't show a scrollbar during animation\n element.style.overflowY = 'hidden';\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n } else {\n hiddenStyles = { opacity: 0 };\n visibleStyles = { opacity: 1 };\n if (!nowVisible) {\n css(element, hiddenStyles);\n }\n\n animate(element, nowVisible ? hiddenStyles : visibleStyles, cleanup);\n }\n }\n\n function animate(element, targetStyles, fn) {\n var last = +new Date();\n var initialStyles = window.getComputedStyle(element);\n var currentStyles = {};\n var propSteps = {};\n\n for (var property in targetStyles) {\n // make sure we have an object filled with floats\n targetStyles[property] = parseFloat(targetStyles[property]);\n\n // calculate step size & current value\n var to = targetStyles[property];\n var current = parseFloat(initialStyles[property]);\n\n // is there something to do?\n if (current == to) {\n delete targetStyles[property];\n continue;\n }\n\n propSteps[property] = (to - current) / duration; // points per second\n currentStyles[property] = current;\n }\n\n var tick = function tick() {\n var now = +new Date();\n var timeSinceLastTick = now - last;\n var done = true;\n\n var step, to, increment, newValue;\n for (var property in targetStyles) {\n step = propSteps[property];\n to = targetStyles[property];\n increment = step * timeSinceLastTick;\n newValue = currentStyles[property] + increment;\n\n if (step > 0 && newValue >= to || step < 0 && newValue <= to) {\n newValue = to;\n } else {\n done = false;\n }\n\n // store new value\n currentStyles[property] = newValue;\n\n var suffix = property !== \"opacity\" ? \"px\" : \"\";\n element.style[property] = newValue + suffix;\n }\n\n last = +new Date();\n\n // keep going until we're done for all props\n if (!done) {\n window.requestAnimationFrame && requestAnimationFrame(tick) || setTimeout(tick, 32);\n } else {\n // call callback\n fn && fn();\n }\n };\n\n tick();\n }\n\n module.exports = {\n 'toggle': toggle,\n 'animate': animate,\n 'animated': animated\n };\n }, {}], 3: [function (require, module, exports) {\n 'use strict';\n\n var defaults = {\n 'animation': 'fade',\n 'rehide': false,\n 'content': '',\n 'cookie': null,\n 'icon': '×',\n 'minimumScreenWidth': 0,\n 'position': 'center',\n 'testMode': false,\n 'trigger': false,\n 'closable': true\n },\n Boxzilla,\n Animator = require('./animator.js');\n\n /**\n * Merge 2 objects, values of the latter overwriting the former.\n *\n * @param obj1\n * @param obj2\n * @returns {*}\n */\n function merge(obj1, obj2) {\n var obj3 = {};\n for (var attrname in obj1) {\n obj3[attrname] = obj1[attrname];\n }\n for (var attrname in obj2) {\n obj3[attrname] = obj2[attrname];\n }\n return obj3;\n }\n\n // Box Object\n var Box = function Box(id, config) {\n this.id = id;\n\n // store config values\n this.config = merge(defaults, config);\n\n // store ref to overlay\n this.overlay = document.getElementById('boxzilla-overlay');\n\n // state\n this.visible = false;\n this.dismissed = false;\n this.triggered = false;\n this.triggerHeight = 0;\n this.cookieSet = false;\n this.element = null;\n this.closeIcon = null;\n\n // if a trigger was given, calculate values once and store\n if (this.config.trigger) {\n if (this.config.trigger.method === 'percentage' || this.config.trigger.method === 'element') {\n this.triggerHeight = this.calculateTriggerHeight();\n }\n\n this.cookieSet = this.isCookieSet();\n }\n\n // create dom elements for this box\n this.dom();\n\n // further initialise the box\n this.events();\n };\n\n // initialise the box\n Box.prototype.events = function () {\n var box = this;\n\n // attach event to \"close\" icon inside box\n this.closeIcon && this.closeIcon.addEventListener('click', box.dismiss.bind(this));\n\n this.element.addEventListener('click', function (e) {\n if (e.target.tagName === 'A') {\n Boxzilla.trigger('box.interactions.link', [box, e.target]);\n }\n }, false);\n\n this.element.addEventListener('submit', function (e) {\n box.setCookie();\n Boxzilla.trigger('box.interactions.form', [box, e.target]);\n }, false);\n\n // listen to all \"click\" events\n document.body.addEventListener('click', function (e) {\n\n // only act on links\n if (e.target.tagName !== 'A') {\n return;\n }\n\n // check if link href ends with \"#boxzilla-{box.id}\n var needle = \"#boxzilla-\" + box.id;\n var haystack = e.target.getAttribute(\"href\");\n if (haystack && haystack.substring(-needle.length) === needle) {\n box.toggle();\n e.preventDefault();\n }\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\n Box.prototype.dom = function () {\n var wrapper = document.createElement('div');\n wrapper.className = 'boxzilla-container boxzilla-' + this.config.position + '-container';\n\n var box = document.createElement('div');\n box.setAttribute('id', 'boxzilla-' + this.id);\n box.className = 'boxzilla boxzilla-' + this.id + ' boxzilla-' + this.config.position;\n box.style.display = 'none';\n wrapper.appendChild(box);\n\n var content = document.createElement('div');\n content.className = 'boxzilla-content';\n content.innerHTML = this.config.content;\n box.appendChild(content);\n\n // remove <script> from box content and append them to the document body\n var scripts = content.querySelectorAll('script');\n if (scripts.length) {\n var script = document.createElement('script');\n for (var i = 0; i < scripts.length; i++) {\n script.appendChild(document.createTextNode(scripts[i].text));\n scripts[i].parentNode.removeChild(scripts[i]);\n }\n document.body.appendChild(script);\n }\n\n if (this.config.closable && this.config.icon) {\n var closeIcon = document.createElement('span');\n closeIcon.className = \"boxzilla-close-icon\";\n closeIcon.innerHTML = this.config.icon;\n box.appendChild(closeIcon);\n this.closeIcon = closeIcon;\n }\n\n document.body.appendChild(wrapper);\n this.element = box;\n };\n\n // set (calculate) custom box styling depending on box options\n Box.prototype.setCustomBoxStyling = function () {\n\n // reset element to its initial state\n var origDisplay = this.element.style.display;\n this.element.style.display = '';\n this.element.style.overflowY = 'auto';\n this.element.style.maxHeight = 'none';\n\n // get new dimensions\n var windowHeight = window.innerHeight;\n var boxHeight = this.element.clientHeight;\n\n // add scrollbar to box and limit height\n if (boxHeight > windowHeight) {\n this.element.style.maxHeight = windowHeight + \"px\";\n this.element.style.overflowY = 'scroll';\n }\n\n // set new top margin for boxes which are centered\n if (this.config.position === 'center') {\n var newTopMargin = (windowHeight - boxHeight) / 2;\n newTopMargin = newTopMargin >= 0 ? newTopMargin : 0;\n this.element.style.marginTop = newTopMargin + \"px\";\n }\n\n this.element.style.display = origDisplay;\n };\n\n // toggle visibility of the box\n Box.prototype.toggle = function (show) {\n\n // revert visibility if no explicit argument is given\n if (typeof show === \"undefined\") {\n show = !this.visible;\n }\n\n // is box already at desired visibility?\n if (show === this.visible) {\n return false;\n }\n\n // is box being animated?\n if (Animator.animated(this.element)) {\n return false;\n }\n\n // if box should be hidden but is not closable, bail.\n if (!show && !this.config.closable) {\n return false;\n }\n\n // set new visibility status\n this.visible = show;\n\n // calculate new styling rules\n this.setCustomBoxStyling();\n\n // trigger event\n Boxzilla.trigger('box.' + (show ? 'show' : 'hide'), [this]);\n\n // show or hide box using selected animation\n if (this.config.position === 'center') {\n Animator.toggle(this.overlay, \"fade\");\n }\n\n Animator.toggle(this.element, this.config.animation);\n\n // focus on first input field in box\n var firstInput = this.element.querySelector('input, textarea');\n if (firstInput) {\n firstInput.focus();\n }\n\n return true;\n };\n\n // show the box\n Box.prototype.show = function () {\n return this.toggle(true);\n };\n\n // hide the box\n Box.prototype.hide = function () {\n return this.toggle(false);\n };\n\n // calculate trigger height\n Box.prototype.calculateTriggerHeight = function () {\n var triggerHeight = 0;\n\n if (this.config.trigger.method === 'element') {\n var triggerElement = document.body.querySelector(this.config.trigger.value);\n if (triggerElement) {\n var offset = triggerElement.getBoundingClientRect();\n triggerHeight = offset.top;\n }\n } else if (this.config.trigger.method === 'percentage') {\n triggerHeight = this.config.trigger.value / 100 * document.body.clientHeight;\n }\n\n return triggerHeight;\n };\n\n // checks whether window.location.hash equals the box element ID or that of any element inside the box\n Box.prototype.locationHashRefersBox = function () {\n\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n }\n\n var elementId = window.location.hash.substring(1);\n if (elementId === this.element.id) {\n return true;\n } else if (this.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n };\n\n Box.prototype.fits = function () {\n if (this.config.minimumScreenWidth <= 0) {\n return true;\n }\n\n return window.innerWidth > this.config.minimumScreenWidth;\n };\n\n // is this box enabled?\n Box.prototype.mayAutoShow = function () {\n\n if (this.dismissed) {\n return false;\n }\n\n // check if box fits on given minimum screen width\n if (!this.fits()) {\n return false;\n }\n\n // if trigger empty or error in calculating triggerHeight, return false\n if (!this.config.trigger) {\n return false;\n }\n\n // rely on cookie value (show if not set, don't show if set)\n return !this.cookieSet;\n };\n\n Box.prototype.mayRehide = function () {\n return this.config.rehide && this.triggered;\n };\n\n Box.prototype.isCookieSet = function () {\n // always show on test mode\n if (this.config.testMode) {\n return false;\n }\n\n // if either cookie is null or trigger & dismiss are both falsey, don't bother checking.\n if (!this.config.cookie || !this.config.cookie.triggered && !this.config.cookie.dismissed) {\n return false;\n }\n\n var cookieSet = document.cookie.replace(new RegExp(\"(?:(?:^|.*;)\\\\s*\" + 'boxzilla_box_' + this.id + \"\\\\s*\\\\=\\\\s*([^;]*).*$)|^.*$\"), \"$1\") === \"true\";\n return cookieSet;\n };\n\n // set cookie that disables automatically showing the box\n Box.prototype.setCookie = function (hours) {\n var expiryDate = new Date();\n expiryDate.setHours(expiryDate.getHours() + hours);\n document.cookie = 'boxzilla_box_' + this.id + '=true; expires=' + expiryDate.toUTCString() + '; path=/';\n };\n\n Box.prototype.trigger = function () {\n var shown = this.show();\n if (!shown) {\n return;\n }\n\n this.triggered = true;\n if (this.config.cookie && this.config.cookie.triggered) {\n this.setCookie(this.config.cookie.triggered);\n }\n };\n\n Box.prototype.dismiss = function () {\n this.hide();\n\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 };\n\n module.exports = function (_Boxzilla) {\n Boxzilla = _Boxzilla;\n return Box;\n };\n }, { \"./animator.js\": 2 }], 4: [function (require, module, exports) {\n 'use strict';\n\n var EventEmitter = require('wolfy87-eventemitter'),\n Boxzilla = Object.create(EventEmitter.prototype),\n Box = require('./box.js')(Boxzilla),\n Timer = require('./timer.js'),\n boxes = {},\n windowHeight,\n overlay,\n exitIntentDelayTimer,\n exitIntentTriggered,\n siteTimer,\n pageTimer,\n pageViews;\n\n function each(obj, callback) {\n for (var key in obj) {\n if (!obj.hasOwnProperty(key)) continue;\n callback(obj[key]);\n }\n }\n\n function throttle(fn, threshhold, scope) {\n threshhold || (threshhold = 250);\n var last, deferTimer;\n return function () {\n var context = scope || this;\n\n var now = +new Date(),\n args = arguments;\n if (last && now < last + threshhold) {\n // hold on to it\n clearTimeout(deferTimer);\n deferTimer = setTimeout(function () {\n last = now;\n fn.apply(context, args);\n }, threshhold);\n } else {\n last = now;\n fn.apply(context, args);\n }\n };\n }\n\n // \"keyup\" listener\n function onKeyUp(e) {\n if (e.keyCode == 27) {\n Boxzilla.dismiss();\n }\n }\n\n // check \"pageviews\" criteria for each box\n function checkPageViewsCriteria() {\n each(boxes, function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n if (box.config.trigger.method === 'pageviews' && pageViews >= box.config.trigger.value) {\n box.trigger();\n }\n });\n }\n\n // check time trigger criteria for each box\n function checkTimeCriteria() {\n each(boxes, function (box) {\n if (!box.mayAutoShow()) {\n return;\n }\n\n // check \"time on site\" trigger\n if (box.config.trigger.method === 'time_on_site' && siteTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n\n // check \"time on page\" trigger\n if (box.config.trigger.method === 'time_on_page' && pageTimer.time >= box.config.trigger.value) {\n box.trigger();\n }\n });\n }\n\n // check triggerHeight criteria for all boxes\n function checkHeightCriteria() {\n var scrollY = window.scrollY;\n var scrollHeight = scrollY + windowHeight * 0.667;\n\n each(boxes, function (box) {\n if (!box.mayAutoShow() || box.triggerHeight <= 0) {\n return;\n }\n\n if (scrollHeight > box.triggerHeight) {\n box.trigger();\n } else if (box.mayRehide()) {\n box.hide();\n }\n });\n }\n\n // recalculate heights and variables based on height\n function recalculateHeights() {\n windowHeight = window.innerHeight;\n\n each(boxes, function (box) {\n box.setCustomBoxStyling();\n });\n }\n\n function onOverlayClick(e) {\n var x = e.offsetX;\n var y = e.offsetY;\n\n // calculate if click was near a box to avoid closing it (click error margin)\n each(boxes, function (box) {\n var rect = box.element.getBoundingClientRect();\n var margin = 100 + window.innerWidth * 0.05;\n\n // if click was not anywhere near box, dismiss it.\n if (x < rect.left - margin || x > rect.right + margin || y < rect.top - margin || y > rect.bottom + margin) {\n box.dismiss();\n }\n });\n }\n\n function triggerExitIntent() {\n if (exitIntentTriggered) return;\n\n each(boxes, function (box) {\n if (box.mayAutoShow() && box.config.trigger.method === 'exit_intent') {\n box.trigger();\n }\n });\n\n exitIntentTriggered = true;\n }\n\n function onMouseLeave(e) {\n var delay = 400;\n\n // did mouse leave at top of window?\n if (e.clientY <= 0) {\n exitIntentDelayTimer = window.setTimeout(triggerExitIntent, delay);\n }\n }\n\n function onMouseEnter() {\n if (exitIntentDelayTimer) {\n window.clearInterval(exitIntentDelayTimer);\n exitIntentDelayTimer = null;\n }\n }\n\n var timers = {\n start: function start() {\n var sessionTime = sessionStorage.getItem('boxzilla_timer');\n if (sessionTime) siteTimer.time = sessionTime;\n siteTimer.start();\n pageTimer.start();\n },\n stop: function stop() {\n sessionStorage.setItem('boxzilla_timer', siteTimer.time);\n siteTimer.stop();\n pageTimer.stop();\n }\n };\n\n // initialise & add event listeners\n Boxzilla.init = function () {\n siteTimer = new Timer(sessionStorage.getItem('boxzilla_timer') || 0);\n pageTimer = new Timer(0);\n pageViews = sessionStorage.getItem('boxzilla_pageviews') || 0;\n windowHeight = window.innerHeight;\n\n // insert styles into DOM\n var styles = require('./styles.js');\n var styleElement = document.createElement('style');\n styleElement.setAttribute(\"type\", \"text/css\");\n styleElement.innerHTML = styles;\n document.head.appendChild(styleElement);\n\n // add overlay element to dom\n overlay = document.createElement('div');\n overlay.style.display = 'none';\n overlay.id = 'boxzilla-overlay';\n document.body.appendChild(overlay);\n\n // event binds\n window.addEventListener('scroll', throttle(checkHeightCriteria));\n window.addEventListener('resize', throttle(recalculateHeights));\n window.addEventListener('load', recalculateHeights);\n overlay.addEventListener('click', onOverlayClick);\n window.setInterval(checkTimeCriteria, 1000);\n window.setTimeout(checkPageViewsCriteria, 1000);\n document.addEventListener('mouseleave', onMouseLeave);\n document.addEventListener('mouseenter', onMouseEnter);\n document.addEventListener('keyup', onKeyUp);\n\n timers.start();\n window.addEventListener('focus', timers.start);\n window.addEventListener('beforeunload', function () {\n timers.stop();\n sessionStorage.setItem('boxzilla_pageviews', ++pageViews);\n });\n window.addEventListener('blur', timers.stop);\n\n Boxzilla.trigger('ready');\n };\n\n /**\n * Create a new Box\n *\n * @param string id\n * @param object opts\n *\n * @returns Box\n */\n Boxzilla.create = function (id, opts) {\n boxes[id] = new Box(id, opts);\n return boxes[id];\n };\n\n // dismiss a single box (or all by omitting id param)\n Boxzilla.dismiss = function (id) {\n // if no id given, dismiss all current open boxes\n if (typeof id === \"undefined\") {\n each(boxes, function (box) {\n box.dismiss();\n });\n } else if (_typeof(boxes[id]) === \"object\") {\n boxes[id].dismiss();\n }\n };\n\n Boxzilla.hide = function (id) {\n if (typeof id === \"undefined\") {\n each(boxes, function (box) {\n box.hide();\n });\n } else if (_typeof(boxes[id]) === \"object\") {\n boxes[id].hide();\n }\n };\n\n Boxzilla.show = function (id) {\n if (typeof id === \"undefined\") {\n each(boxes, function (box) {\n box.show();\n });\n } else if (_typeof(boxes[id]) === \"object\") {\n boxes[id].show();\n }\n };\n\n Boxzilla.toggle = function (id) {\n if (typeof id === \"undefined\") {\n each(boxes, function (box) {\n box.toggle();\n });\n } else if (_typeof(boxes[id]) === \"object\") {\n boxes[id].toggle();\n }\n };\n\n window.Boxzilla = Boxzilla;\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Boxzilla;\n }\n }, { \"./box.js\": 3, \"./styles.js\": 5, \"./timer.js\": 6, \"wolfy87-eventemitter\": 7 }], 5: [function (require, module, exports) {\n var styles = \"#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}\";\n module.exports = styles;\n }, {}], 6: [function (require, module, exports) {\n 'use strict';\n\n var Timer = function Timer(start) {\n this.time = start;\n this.interval = 0;\n };\n\n Timer.prototype.tick = function () {\n this.time++;\n };\n\n Timer.prototype.start = function () {\n if (!this.interval) {\n this.interval = window.setInterval(this.tick.bind(this), 1000);\n }\n };\n\n Timer.prototype.stop = function () {\n window.clearInterval(this.interval);\n this.interval = 0;\n };\n\n module.exports = Timer;\n }, {}], 7: [function (require, module, exports) {\n /*!\n * EventEmitter v4.2.11 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - http://oli.me.uk/\n * @preserve\n */\n\n ;(function () {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var exports = this;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n } else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = (typeof listener === \"undefined\" ? \"undefined\" : _typeof(listener)) === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if ((typeof evt === \"undefined\" ? \"undefined\" : _typeof(evt)) === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n } else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n } else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt === \"undefined\" ? \"undefined\" : _typeof(evt);\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n } else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n } else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n i = listeners.length;\n\n while (i--) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n } else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n } else if ((typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) === 'object' && module.exports) {\n module.exports = EventEmitter;\n } else {\n exports.EventEmitter = EventEmitter;\n }\n }).call(this);\n }, {}] }, {}, [1]);\n ;\n})();"],"sourceRoot":"/source/"}
|
assets/scss/admin-styles.scss
ADDED
@@ -0,0 +1,169 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/* first row can't be deleted */
|
2 |
+
.boxzilla-rule-row-0 .boxzilla-close{
|
3 |
+
visibility: hidden;
|
4 |
+
}
|
5 |
+
|
6 |
+
.column-box_id {
|
7 |
+
width: 80px;
|
8 |
+
}
|
9 |
+
|
10 |
+
.boxzilla-sm {
|
11 |
+
width:150px;
|
12 |
+
}
|
13 |
+
|
14 |
+
.boxzilla-xsm {
|
15 |
+
width: 15px;
|
16 |
+
}
|
17 |
+
|
18 |
+
.boxzilla-title{
|
19 |
+
margin-top:2em !important;
|
20 |
+
}
|
21 |
+
|
22 |
+
.boxzilla-label{
|
23 |
+
display:block;
|
24 |
+
font-weight: bold;
|
25 |
+
margin-bottom:6px;
|
26 |
+
}
|
27 |
+
|
28 |
+
.boxzilla-close{
|
29 |
+
padding: 0;
|
30 |
+
cursor: pointer;
|
31 |
+
background: transparent;
|
32 |
+
border: 0;
|
33 |
+
-webkit-appearance: none;
|
34 |
+
font-size: 21px;
|
35 |
+
font-weight: bold;
|
36 |
+
line-height: 26px;
|
37 |
+
text-shadow: 0 1px 0 #fff;
|
38 |
+
opacity: .3;
|
39 |
+
filter: alpha(opacity=30);
|
40 |
+
|
41 |
+
&:hover,
|
42 |
+
&:focus {
|
43 |
+
color: #000;
|
44 |
+
text-decoration: none;
|
45 |
+
cursor: pointer;
|
46 |
+
opacity: .6;
|
47 |
+
filter: alpha(opacity=60);
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
.post-type-boxzilla-box {
|
52 |
+
.form-table{
|
53 |
+
table-layout:fixed;
|
54 |
+
}
|
55 |
+
|
56 |
+
.window-positions {
|
57 |
+
border: 1px solid #EEE;
|
58 |
+
|
59 |
+
td {
|
60 |
+
padding: 3px;
|
61 |
+
margin-bottom: 0;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
.wp-picker-container{
|
66 |
+
white-space: nowrap;
|
67 |
+
}
|
68 |
+
|
69 |
+
.wp-picker-clear,
|
70 |
+
.wp-picker-holder,
|
71 |
+
.wp-picker-input-wrap {
|
72 |
+
background:white;
|
73 |
+
z-index: 999 !important;
|
74 |
+
position: absolute !important;
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
#boxzilla-admin {
|
79 |
+
.status {
|
80 |
+
display: inline-block;
|
81 |
+
padding: 3px 6px;
|
82 |
+
color: white;
|
83 |
+
text-transform: uppercase;
|
84 |
+
font-weight: bold;
|
85 |
+
|
86 |
+
&.positive{
|
87 |
+
background-color: limeGreen;
|
88 |
+
}
|
89 |
+
|
90 |
+
&.negative {
|
91 |
+
background: #c3c3c3;
|
92 |
+
}
|
93 |
+
}
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
/* Radio Switches */
|
98 |
+
.radio-label {
|
99 |
+
font-weight: normal;
|
100 |
+
|
101 |
+
> input {
|
102 |
+
margin-top: 0 !important;
|
103 |
+
}
|
104 |
+
}
|
105 |
+
|
106 |
+
/** Grid */
|
107 |
+
.boxzilla-row{
|
108 |
+
margin: 0 -20px;
|
109 |
+
}
|
110 |
+
|
111 |
+
.boxzilla-col-one-third,
|
112 |
+
.boxzilla-col-two-third {
|
113 |
+
float: left;
|
114 |
+
-webkit-box-sizing: border-box;
|
115 |
+
box-sizing: border-box;
|
116 |
+
padding: 0 20px;
|
117 |
+
}
|
118 |
+
|
119 |
+
.boxzilla-col-two-third {
|
120 |
+
width: 66.66%;
|
121 |
+
}
|
122 |
+
|
123 |
+
.boxzilla-col-one-third{
|
124 |
+
width: 33.33%;
|
125 |
+
}
|
126 |
+
|
127 |
+
|
128 |
+
/* admin sidebar */
|
129 |
+
.boxzilla-sidebar{
|
130 |
+
margin-top: 10px;
|
131 |
+
}
|
132 |
+
|
133 |
+
.boxzilla-box {
|
134 |
+
background: white;
|
135 |
+
padding: 20px;
|
136 |
+
margin-bottom: 20px;
|
137 |
+
border: 1px solid #ccc;
|
138 |
+
|
139 |
+
h3,
|
140 |
+
:first-child {
|
141 |
+
margin-top: 0;
|
142 |
+
}
|
143 |
+
|
144 |
+
:last-child {
|
145 |
+
margin-bottom: 0;
|
146 |
+
}
|
147 |
+
}
|
148 |
+
|
149 |
+
.boxzilla-sidebar form label {
|
150 |
+
display: block;
|
151 |
+
font-weight: bold;
|
152 |
+
margin-bottom: 6px;
|
153 |
+
}
|
154 |
+
|
155 |
+
@media( max-width: 920px ) {
|
156 |
+
.boxzilla-row {
|
157 |
+
margin: 0;
|
158 |
+
}
|
159 |
+
.boxzilla-col-one-third,
|
160 |
+
.boxzilla-col-two-third {
|
161 |
+
float: none;
|
162 |
+
padding: 0;
|
163 |
+
width: auto;
|
164 |
+
}
|
165 |
+
|
166 |
+
.boxzilla-sidebar {
|
167 |
+
margin-top: 40px;
|
168 |
+
}
|
169 |
+
}
|
boxzilla.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Boxzilla
|
4 |
-
Version: 3.
|
5 |
Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
|
6 |
Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
|
7 |
Author: ibericode
|
@@ -48,7 +48,7 @@ function __load_boxzilla() {
|
|
48 |
}
|
49 |
|
50 |
define( 'BOXZILLA_FILE', __FILE__ );
|
51 |
-
define( 'BOXZILLA_VERSION', '3.
|
52 |
|
53 |
require __DIR__ . '/bootstrap.php';
|
54 |
}
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Boxzilla
|
4 |
+
Version: 3.1
|
5 |
Plugin URI: https://boxzillaplugin.com/#utm_source=wp-plugin&utm_medium=boxzilla&utm_campaign=plugins-page
|
6 |
Description: Call-To-Action Boxes that display after visitors scroll down far enough. Unobtrusive, but highly conversing!
|
7 |
Author: ibericode
|
48 |
}
|
49 |
|
50 |
define( 'BOXZILLA_FILE', __FILE__ );
|
51 |
+
define( 'BOXZILLA_VERSION', '3.1' );
|
52 |
|
53 |
require __DIR__ . '/bootstrap.php';
|
54 |
}
|
languages/boxzilla.pot
CHANGED
@@ -162,142 +162,150 @@ msgstr ""
|
|
162 |
msgid "if referer"
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
166 |
-
msgid "Bottom Left"
|
167 |
-
msgstr ""
|
168 |
-
|
169 |
-
#: src/admin/views/metaboxes/box-option-controls.php:57
|
170 |
-
msgid "Bottom Right"
|
171 |
-
msgstr ""
|
172 |
-
|
173 |
-
#: src/admin/views/metaboxes/box-option-controls.php:59
|
174 |
-
msgid "Center"
|
175 |
-
msgstr ""
|
176 |
-
|
177 |
-
#: src/admin/views/metaboxes/box-option-controls.php:61
|
178 |
-
msgid "Top Left"
|
179 |
-
msgstr ""
|
180 |
-
|
181 |
-
#: src/admin/views/metaboxes/box-option-controls.php:63
|
182 |
-
msgid "Top Right"
|
183 |
-
msgstr ""
|
184 |
-
|
185 |
-
#: src/admin/views/metaboxes/box-option-controls.php:91
|
186 |
msgid "Load this box if"
|
187 |
msgstr ""
|
188 |
|
189 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
190 |
msgid "Request matches"
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
194 |
msgid "any"
|
195 |
msgstr ""
|
196 |
|
197 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
198 |
msgid "all"
|
199 |
msgstr ""
|
200 |
|
201 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
202 |
msgid "of the following conditions."
|
203 |
msgstr ""
|
204 |
|
205 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
206 |
msgid "is"
|
207 |
msgstr ""
|
208 |
|
209 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
210 |
msgid "is not"
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
214 |
msgid "Leave empty for any or enter (comma-separated) names or ID's"
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
218 |
msgid "Add rule"
|
219 |
msgstr ""
|
220 |
|
221 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
222 |
msgid "Box Position"
|
223 |
msgstr ""
|
224 |
|
225 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
226 |
msgid "Animation"
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
230 |
msgid "Fade In"
|
231 |
msgstr ""
|
232 |
|
233 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
234 |
msgid "Slide In"
|
235 |
msgstr ""
|
236 |
|
237 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
238 |
msgid "Which animation type should be used to show the box when triggered?"
|
239 |
msgstr ""
|
240 |
|
241 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
242 |
msgid "Auto-show box?"
|
243 |
msgstr ""
|
244 |
|
245 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
246 |
msgid "Never"
|
247 |
msgstr ""
|
248 |
|
249 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
250 |
msgid "Yes, after %s seconds on the page."
|
251 |
msgstr ""
|
252 |
|
253 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
254 |
msgid "Yes, when at %s of page height"
|
255 |
msgstr ""
|
256 |
|
257 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
258 |
msgid "Yes, when at element %s"
|
259 |
msgstr ""
|
260 |
|
261 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
262 |
msgid "Example: #comments"
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
266 |
-
msgid "Cookie expiration
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
270 |
-
msgid "
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
|
|
|
|
|
|
|
|
274 |
msgid "Do not auto-show box on small screens?"
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
278 |
msgid "Do not auto-show on screens smaller than %s."
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
282 |
msgid "Leave empty if you <strong>do</strong> want to auto-show the box on small screens."
|
283 |
msgstr ""
|
284 |
|
285 |
-
#: src/admin/views/metaboxes/box-option-controls.php:
|
286 |
msgid "Auto-hide?"
|
287 |
msgstr ""
|
288 |