Version Description
Download this release
Release Info
Developer | DvanKooten |
Plugin | Boxzilla |
Version | 3.2.15 |
Comparing to | |
See all releases |
Code changes from version 3.2.14 to 3.2.15
- CHANGELOG.md +415 -0
- assets/browserify/admin-script.js +0 -1
- assets/browserify/admin/_admin.js +0 -173
- assets/browserify/admin/_designer.js +0 -111
- assets/browserify/admin/_option.js +0 -56
- assets/browserify/script.js +0 -139
- assets/img/menu-icon.svg +1 -1
- assets/js/admin-script.js +1 -1
- assets/js/admin-script.min.js.map +1 -1
- assets/js/script.js +81 -56
- assets/js/script.min.js +1 -1
- assets/js/script.min.js.map +1 -1
- bootstrap.php +11 -22
- boxzilla.php +2 -2
- languages/boxzilla.pot +27 -23
- readme.txt +15 -4
- src/admin/class-admin.php +30 -9
- src/admin/class-autocomplete.php +1 -1
- src/admin/class-menu.php +9 -15
- src/admin/class-review-notice.php +1 -9
- src/admin/views/metaboxes/our-other-plugins.php +24 -0
- src/admin/views/settings.php +9 -7
- src/class-bootstrapper.php +0 -105
- src/class-boxzilla-service-provider.php +0 -2
- src/class-loader.php +15 -9
- src/default-actions.php +1 -1
- src/licensing/class-license-manager.php +1 -3
- src/licensing/class-poller.php +2 -2
- src/licensing/class-update-manager.php +1 -1
- vendor/composer/autoload_classmap.php +0 -1
- vendor/composer/autoload_static.php +0 -1
- vendor/composer/installed.json +0 -1
CHANGELOG.md
ADDED
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Changelog
|
2 |
+
==========
|
3 |
+
|
4 |
+
#### 3.2.15 - Nov 6, 2019
|
5 |
+
|
6 |
+
**Improvements**
|
7 |
+
|
8 |
+
- Add proper SVG icon with neutral color for admin menu.
|
9 |
+
- Use Page Visibility API for time-based triggers (time on site & time on page).
|
10 |
+
- Stop using `supress_filters` when retrieving boxes for a possible performance improvement.
|
11 |
+
- Minor performance improvement in bootstrapping logic.
|
12 |
+
- Add link to [Koko Analytics](https://wordpress.org/plugins/koko-analytics/)
|
13 |
+
|
14 |
+
|
15 |
+
#### 3.2.14 - Aug 7, 2019
|
16 |
+
|
17 |
+
**Fixes**
|
18 |
+
|
19 |
+
- Issue with incorrect argument count for some sites with custom menu's.
|
20 |
+
|
21 |
+
|
22 |
+
#### 3.2.13 - Aug 5, 2019
|
23 |
+
|
24 |
+
**Improvements**
|
25 |
+
|
26 |
+
- Allow more query hash parameters for opening a box.
|
27 |
+
- Allow bypassing animation for opening or closing boxes.
|
28 |
+
|
29 |
+
**Additions**
|
30 |
+
|
31 |
+
- Easily link to boxes from WP Menu's.
|
32 |
+
|
33 |
+
|
34 |
+
#### 3.2.12 - June 7, 2019
|
35 |
+
|
36 |
+
**Improvements**
|
37 |
+
|
38 |
+
- Allow skipping animations when showing, hiding or dismissing a box.
|
39 |
+
- Check for empty box content after running filter hooks, instead of before.
|
40 |
+
|
41 |
+
|
42 |
+
#### 3.2.11 - May 8, 2019
|
43 |
+
|
44 |
+
**Improvements**
|
45 |
+
|
46 |
+
- Update loading configuration when duplicating a box.
|
47 |
+
- Accept query parameters in URL hash for opening a box through a link click or on loading a page.
|
48 |
+
|
49 |
+
|
50 |
+
#### 3.2.10 - February 15, 2019
|
51 |
+
|
52 |
+
**Improvements**
|
53 |
+
|
54 |
+
- Better [exit intent detection](https://boxzillaplugin.com/add-ons/exit-intent/) for mobile devices.
|
55 |
+
|
56 |
+
**Additions**
|
57 |
+
|
58 |
+
- New bulk action to quickly duplicate a box with all of its settings.
|
59 |
+
|
60 |
+
|
61 |
+
#### 3.2.9 - December 5, 2018
|
62 |
+
|
63 |
+
**Improvements**
|
64 |
+
|
65 |
+
- Make sure preview updates with correct color values when applying box styles.
|
66 |
+
- Use small margin of error to prevent iOS scroll bounce from closing box again.
|
67 |
+
|
68 |
+
|
69 |
+
#### 3.2.7 - July 31, 2018
|
70 |
+
|
71 |
+
**Fixes**
|
72 |
+
|
73 |
+
- Issue with boxes with only an iframe, image or video and no text not being loaded.
|
74 |
+
|
75 |
+
|
76 |
+
#### 3.2.6 - June 27, 2018
|
77 |
+
|
78 |
+
**Improvements**
|
79 |
+
|
80 |
+
- Show and/or between rules to help clarify rule logic.
|
81 |
+
- Consistent line endings in main plugin file.
|
82 |
+
|
83 |
+
|
84 |
+
#### 3.2.5 - June 6, 2018
|
85 |
+
|
86 |
+
**Fixes**
|
87 |
+
|
88 |
+
- Some JSON encoders would print Boxzilla config as object, resulting in no boxes actually being loaded.
|
89 |
+
|
90 |
+
**Additions**
|
91 |
+
|
92 |
+
- Add "does not contain" qualifier in URL and referrer conditions.
|
93 |
+
|
94 |
+
|
95 |
+
|
96 |
+
#### 3.2.4 - May 31, 2018
|
97 |
+
|
98 |
+
**Fixes**
|
99 |
+
|
100 |
+
- Boxzilla content replicating parts of the page if other plugins "incorrectly" use `the_content` filter.
|
101 |
+
|
102 |
+
|
103 |
+
#### 3.2.3 - May 29, 2018
|
104 |
+
|
105 |
+
**Improvements**
|
106 |
+
|
107 |
+
- Allow "contains" qualifier in URL and referrer conditions.
|
108 |
+
- Include query string in URL conditions.
|
109 |
+
- Use SVG for the menu ico. Thanks [Kurt Zenisek](https://github.com/KZeni)
|
110 |
+
- Added Czech translations. Thanks [Zdenek Petrbok](https://petrbok.cz/)
|
111 |
+
- Run the_content filter on Boxzilla post content, to enable plugins like Photon.
|
112 |
+
- Ensure content element exists when initialising Boxzilla.
|
113 |
+
- Improvements to licensing related code for [Boxzilla Premium](https://boxzillaplugin.com/pricing/) users.
|
114 |
+
|
115 |
+
|
116 |
+
#### 3.2.2 - March 12, 2018
|
117 |
+
|
118 |
+
**Improvements**
|
119 |
+
|
120 |
+
- Print box contents at an earlier footer hook, so it works with "smart enqueue" methods in other plugins like Mailchimp for WordPress or Maxbuttons.
|
121 |
+
|
122 |
+
|
123 |
+
#### 3.2.1 - March 5, 2018
|
124 |
+
|
125 |
+
**Fixes**
|
126 |
+
|
127 |
+
- Can't use return value in write context error, introduced in v3.2.
|
128 |
+
|
129 |
+
|
130 |
+
|
131 |
+
#### 3.2 - March 5, 2018
|
132 |
+
|
133 |
+
**Fixes**
|
134 |
+
|
135 |
+
- Compatibility with plugins that use JavaScript rendering.
|
136 |
+
|
137 |
+
**Improvements**
|
138 |
+
|
139 |
+
- Skip boxes with empty content.
|
140 |
+
|
141 |
+
|
142 |
+
#### 3.1.23 - December 13, 2017
|
143 |
+
|
144 |
+
**Fixes**
|
145 |
+
|
146 |
+
- Event listener for hyperlinks referencing `#boxzilla-123`. We recommend using `[boxzilla_link]to generate your links though[/boxzilla_link]`. [Here's how that works](https://kb.boxzillaplugin.com/shortcode-boxzilla-link/).
|
147 |
+
|
148 |
+
|
149 |
+
#### 3.1.22 - November 20, 2017
|
150 |
+
|
151 |
+
**Fixes**
|
152 |
+
|
153 |
+
- Showing box by location hash after page load wasn't working.
|
154 |
+
|
155 |
+
**Improvements**
|
156 |
+
|
157 |
+
- Load `<script>` in box content synchronously so libraries get a chance to load before they're used.
|
158 |
+
|
159 |
+
|
160 |
+
#### 3.1.21 - October 10, 2017
|
161 |
+
|
162 |
+
**Fixes**
|
163 |
+
|
164 |
+
- Ensure that administrators can always edit boxes.
|
165 |
+
|
166 |
+
|
167 |
+
#### 3.1.20 - October 9, 2017
|
168 |
+
|
169 |
+
**Fixes**
|
170 |
+
|
171 |
+
- Screen width condition not working when using WordPress in language other than English.
|
172 |
+
|
173 |
+
**Improvements**
|
174 |
+
|
175 |
+
- Use custom capability type so access to Boxzilla boxes can be modified using a role manager plugin.
|
176 |
+
|
177 |
+
|
178 |
+
#### 3.1.19 - September 20, 2017
|
179 |
+
|
180 |
+
**Improvements**
|
181 |
+
|
182 |
+
- Trigger points based on height (scroll %, element) will now be recalculated when the page height changes.
|
183 |
+
|
184 |
+
|
185 |
+
#### 3.1.18 - September 7, 2017
|
186 |
+
|
187 |
+
**Additions**
|
188 |
+
|
189 |
+
- Added [`[boxzilla_link]` shortcode to generate the correct HTML for a link to show/toggle/hide/dismiss a box](https://kb.boxzillaplugin.com/shortcode-boxzilla-link/).
|
190 |
+
|
191 |
+
|
192 |
+
#### 3.1.17 - August 30, 2017
|
193 |
+
|
194 |
+
**Fixes**
|
195 |
+
|
196 |
+
- IE11 issue with scroll triggered pop-ups never showing up.
|
197 |
+
|
198 |
+
|
199 |
+
#### 3.1.16 - August 2, 2017
|
200 |
+
|
201 |
+
**Fixes**
|
202 |
+
|
203 |
+
- JavaScript error when clicking `<a>` elements without `href` attributes.
|
204 |
+
|
205 |
+
|
206 |
+
#### 3.1.15 - July 26, 2017
|
207 |
+
|
208 |
+
**Additions**
|
209 |
+
|
210 |
+
- Added `[boxzilla-close]text here[/boxzilla-close]` shortcode to insert a link to close the box.
|
211 |
+
- Added setting to hide the close icon.
|
212 |
+
- Added setting to hide or show box for logged-in users.
|
213 |
+
|
214 |
+
|
215 |
+
#### 3.1.14 - July 13, 2017
|
216 |
+
|
217 |
+
**Fixes**
|
218 |
+
|
219 |
+
- IE Edge issue with sliding box animation.
|
220 |
+
|
221 |
+
**Improvements**
|
222 |
+
|
223 |
+
- Don't wait for document.ready event to initialise boxes. Fixes issues with plugins not delegaging AJAX event listeners.
|
224 |
+
|
225 |
+
|
226 |
+
#### 3.1.13 - May 11, 2017
|
227 |
+
|
228 |
+
**Improvements**
|
229 |
+
|
230 |
+
- Allow for script resources in Boxzilla box content (instead of just inline script elements).
|
231 |
+
- Reset box content when box is dismissed, eg to stop YouTube video's from playing.
|
232 |
+
|
233 |
+
|
234 |
+
#### 3.1.12 - April 24, 2017
|
235 |
+
|
236 |
+
**Improvements**
|
237 |
+
|
238 |
+
- Update endpoint URL for license API requests.
|
239 |
+
|
240 |
+
|
241 |
+
#### 3.1.11 - March 22, 2017
|
242 |
+
|
243 |
+
**Fixes**
|
244 |
+
|
245 |
+
- `#boxzilla-321` link not working when link has a nested image element.
|
246 |
+
|
247 |
+
**Improvements**
|
248 |
+
|
249 |
+
- Added the option to show on screens smaller than a certain width.
|
250 |
+
- Improved URL matching for "is url" rule.
|
251 |
+
|
252 |
+
|
253 |
+
#### 3.1.10 - March 8, 2017
|
254 |
+
|
255 |
+
**Fixes**
|
256 |
+
|
257 |
+
- Debugging statement that would log to console on every scroll event.
|
258 |
+
|
259 |
+
**Improvements**
|
260 |
+
|
261 |
+
- Reduced overlay click error margin to 40px (instead of % based).
|
262 |
+
- Minor UX improvements for "edit box" screen.
|
263 |
+
|
264 |
+
|
265 |
+
#### 3.1.9 - February 27, 2017
|
266 |
+
|
267 |
+
**Fixes**
|
268 |
+
|
269 |
+
- Compatibility error with PHP 7.1 because of function name with double underscore prefix.
|
270 |
+
|
271 |
+
**Improvements**
|
272 |
+
|
273 |
+
- Removed autofocus when box shows because of mobile browser issues & popping up keyboard.
|
274 |
+
|
275 |
+
**Additions**
|
276 |
+
|
277 |
+
- Added Romanian language files.
|
278 |
+
|
279 |
+
|
280 |
+
#### 3.1.8 - November 8, 2016
|
281 |
+
|
282 |
+
**Fixes**
|
283 |
+
|
284 |
+
- JS error on sites running HTTPS, introduced by v3.1.7.
|
285 |
+
|
286 |
+
|
287 |
+
#### 3.1.7 - November 8, 2016
|
288 |
+
|
289 |
+
**Fixes**
|
290 |
+
|
291 |
+
- Cookie length value was reset on every plugin update.
|
292 |
+
- Scroll to bottom when closing box in MobileSafari browsers.
|
293 |
+
|
294 |
+
**Improvements**
|
295 |
+
|
296 |
+
- Add CSS class to overlay when box is toggled.
|
297 |
+
- Ask for [plugin review](https://wordpress.org/support/plugin/boxzilla/reviews/#new-post) after 2 weeks of usage.
|
298 |
+
|
299 |
+
|
300 |
+
#### 3.1.6 - October 18, 2016
|
301 |
+
|
302 |
+
**Improvements**
|
303 |
+
|
304 |
+
- Failsafe against including the Boxzilla script twice, to prevent duplicate elements.
|
305 |
+
|
306 |
+
|
307 |
+
#### 3.1.5 - September 6, 2016
|
308 |
+
|
309 |
+
**Fixes**
|
310 |
+
|
311 |
+
- Box cookies were being set for _all_ boxes when dismissing a box using the overlay or ESCAPE key.
|
312 |
+
- Auto-close not working since version 3.1.3
|
313 |
+
|
314 |
+
**Improvements**
|
315 |
+
|
316 |
+
- Prevent default click event action when clicking close icon.
|
317 |
+
- Add helper classes for the [Boxzilla - Theme Pack add-on](https://boxzillaplugin.com/add-ons/theme-pack/).
|
318 |
+
|
319 |
+
|
320 |
+
#### 3.1.4 - August 24, 2016
|
321 |
+
|
322 |
+
**Fixes**
|
323 |
+
|
324 |
+
- `Boxzilla.show(123)` no longer working in previous update.
|
325 |
+
|
326 |
+
|
327 |
+
#### 3.1.3 - August 24, 2016
|
328 |
+
|
329 |
+
**Improvements**
|
330 |
+
|
331 |
+
- Don't trigger any new boxes when a box is currently open.
|
332 |
+
- Fail gracefully when not running PHP 5.3 or higher.
|
333 |
+
|
334 |
+
|
335 |
+
#### 3.1.2 - August 2, 2016
|
336 |
+
|
337 |
+
**Fixes**
|
338 |
+
|
339 |
+
- Exit-Intent not working in Safari & Firefox.
|
340 |
+
|
341 |
+
|
342 |
+
#### 3.1.1 - August 1, 2016
|
343 |
+
|
344 |
+
**Fixes**
|
345 |
+
|
346 |
+
- Scroll triggers not working in IE11.
|
347 |
+
|
348 |
+
**Improvements**
|
349 |
+
|
350 |
+
- Allow `<img>` elements inside links that open boxes.
|
351 |
+
- Better page height detection.
|
352 |
+
|
353 |
+
|
354 |
+
#### 3.1 - July 19, 2016
|
355 |
+
|
356 |
+
**Improvements**
|
357 |
+
|
358 |
+
- Completely removed jQuery dependency, resulting in better performance & smoother animations.
|
359 |
+
- Completely removed CSS file dependency.
|
360 |
+
- Box position is now visually hinted in box settings.
|
361 |
+
- Event binding improvements for [Exit Intent detection](https://boxzillaplugin.com/add-ons/exit-intent/).
|
362 |
+
|
363 |
+
**Additions**
|
364 |
+
|
365 |
+
- You can now set a cookie after the box is triggered, to prevent consecutively showing the box if a visitor does not explicitly dismiss it.
|
366 |
+
|
367 |
+
|
368 |
+
#### 3.0.3 - July 5, 2016
|
369 |
+
|
370 |
+
**Improvements**
|
371 |
+
|
372 |
+
- Add `id` attribute to box element.
|
373 |
+
- Automatically fix links in box content that use HTTP when HTTPS is needed.
|
374 |
+
- Restore global jQuery object after running user scripts, to failsafe errors.
|
375 |
+
|
376 |
+
**Additions**
|
377 |
+
|
378 |
+
- When using [Mailchimp for WordPress](https://wordpress.org/plugins/mailchimp-for-wp/) without AJAX, the box will now automatically re-open after reloading the page.
|
379 |
+
|
380 |
+
|
381 |
+
#### 3.0.2 - June 21, 2016
|
382 |
+
|
383 |
+
**Fixes**
|
384 |
+
|
385 |
+
- Box condition "is post" was not working with an empty value.
|
386 |
+
|
387 |
+
**Improvements**
|
388 |
+
|
389 |
+
- Prevent PHP notice when saving box without changing box rules.
|
390 |
+
|
391 |
+
**Additions**
|
392 |
+
|
393 |
+
- Added French translation files, thanks to Benoit Mercusot.
|
394 |
+
|
395 |
+
|
396 |
+
#### 3.0.1 - May 23, 2016
|
397 |
+
|
398 |
+
**Improvements**
|
399 |
+
|
400 |
+
- You can now use `<script>` tags directly in box content (again).
|
401 |
+
|
402 |
+
**Additions**
|
403 |
+
|
404 |
+
- Add "post tag is / is not" loading condition.
|
405 |
+
- Plugin will now show a notice to deactivate old Scroll Triggered Boxes plugin.
|
406 |
+
- Internal changes to dependency container for use in add-on plugins.
|
407 |
+
- Add-on: [Boxzilla Pageviews Trigger](https://boxzillaplugin.com/add-ons/pageviews/).
|
408 |
+
- Add-on: [Boxzilla WooCommerce](https://boxzillaplugin.com/add-ons/woocommerce/)
|
409 |
+
|
410 |
+
|
411 |
+
#### 3.0 - May 11, 2016
|
412 |
+
|
413 |
+
Initial release of [Boxzilla](https://boxzillaplugin.com/), formerly known as [Scroll Triggered Boxes](https://wordpress.org/plugins/scroll-triggered-boxes/).
|
414 |
+
|
415 |
+
If you're upgrading from the old plugin, please check [updating to Boxzilla from Scroll Triggered Boxes](https://kb.boxzillaplugin.com/updating-from-scroll-triggered-boxes/) for a list of changes you should be aware of.
|
assets/browserify/admin-script.js
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
window.Boxzilla_Admin = require('./admin/_admin.js');
|
|
assets/browserify/admin/_admin.js
DELETED
@@ -1,173 +0,0 @@
|
|
1 |
-
(function () {
|
2 |
-
'use strict';
|
3 |
-
|
4 |
-
var $ = window.jQuery;
|
5 |
-
var Option = require('./_option.js');
|
6 |
-
var optionControls = document.getElementById('boxzilla-box-options-controls');
|
7 |
-
var $optionControls = $(optionControls);
|
8 |
-
var tnLoggedIn = document.createTextNode(' logged in');
|
9 |
-
|
10 |
-
// sanity check, are we on the correct page?
|
11 |
-
if ($optionControls.length === 0) {
|
12 |
-
return;
|
13 |
-
}
|
14 |
-
|
15 |
-
var EventEmitter = require('wolfy87-eventemitter');
|
16 |
-
var events = new EventEmitter();
|
17 |
-
var Designer = require('./_designer.js')($, Option, events);
|
18 |
-
var rowTemplate = wp.template('rule-row-template');
|
19 |
-
var i18n = boxzilla_i18n;
|
20 |
-
var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');
|
21 |
-
var rulesContainerEl = document.getElementById('boxzilla-box-rules');
|
22 |
-
|
23 |
-
// events
|
24 |
-
$optionControls.on('click', ".boxzilla-add-rule", addRuleFields);
|
25 |
-
$optionControls.on('click', ".boxzilla-remove-rule", removeRule);
|
26 |
-
$optionControls.on('change', ".boxzilla-rule-condition", setContextualHelpers);
|
27 |
-
$optionControls.find('.boxzilla-auto-show-trigger').on('change', toggleTriggerOptions);
|
28 |
-
$(ruleComparisonEl).change(toggleAndOrTexts);
|
29 |
-
|
30 |
-
$(window).load(function () {
|
31 |
-
if (typeof(window.tinyMCE) === "undefined") {
|
32 |
-
document.getElementById('notice-notinymce').style.display = '';
|
33 |
-
}
|
34 |
-
});
|
35 |
-
|
36 |
-
// call contextual helper method for each row
|
37 |
-
$('.boxzilla-rule-row').each(setContextualHelpers);
|
38 |
-
|
39 |
-
function toggleAndOrTexts() {
|
40 |
-
var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;
|
41 |
-
$('.boxzilla-andor').text(newText);
|
42 |
-
}
|
43 |
-
|
44 |
-
function toggleTriggerOptions() {
|
45 |
-
$optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');
|
46 |
-
}
|
47 |
-
|
48 |
-
function removeRule() {
|
49 |
-
var row = $(this).parents('tr');
|
50 |
-
|
51 |
-
// delete andor row
|
52 |
-
row.prev().remove();
|
53 |
-
|
54 |
-
// delete rule row
|
55 |
-
row.remove();
|
56 |
-
}
|
57 |
-
|
58 |
-
function setContextualHelpers() {
|
59 |
-
var context = ( this.tagName.toLowerCase() === "tr" ) ? this : $(this).parents('tr').get(0);
|
60 |
-
var condition = context.querySelector('.boxzilla-rule-condition').value;
|
61 |
-
var valueInput = context.querySelector('.boxzilla-rule-value');
|
62 |
-
var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');
|
63 |
-
var betterInput = valueInput.cloneNode(true);
|
64 |
-
var $betterInput = $(betterInput);
|
65 |
-
|
66 |
-
// remove previously added helpers
|
67 |
-
$(context.querySelectorAll('.boxzilla-helper')).remove();
|
68 |
-
|
69 |
-
// prepare better input
|
70 |
-
betterInput.removeAttribute('name');
|
71 |
-
betterInput.className = betterInput.className + ' boxzilla-helper';
|
72 |
-
valueInput.parentNode.insertBefore(betterInput, valueInput.nextSibling);
|
73 |
-
$betterInput.change(function () {
|
74 |
-
valueInput.value = this.value;
|
75 |
-
});
|
76 |
-
|
77 |
-
betterInput.style.display = '';
|
78 |
-
valueInput.style.display = 'none';
|
79 |
-
qualifierInput.style.display = '';
|
80 |
-
qualifierInput.querySelector('option[value="not_contains"]').style.display = 'none';
|
81 |
-
qualifierInput.querySelector('option[value="contains"]').style.display = 'none';
|
82 |
-
if (tnLoggedIn.parentNode) {
|
83 |
-
tnLoggedIn.parentNode.removeChild(tnLoggedIn);
|
84 |
-
}
|
85 |
-
|
86 |
-
// change placeholder for textual help
|
87 |
-
switch (condition) {
|
88 |
-
default:
|
89 |
-
betterInput.placeholder = i18n.enterCommaSeparatedValues;
|
90 |
-
break;
|
91 |
-
|
92 |
-
case '':
|
93 |
-
case 'everywhere':
|
94 |
-
qualifierInput.value = '1';
|
95 |
-
valueInput.value = '';
|
96 |
-
betterInput.style.display = 'none';
|
97 |
-
qualifierInput.style.display = 'none';
|
98 |
-
break;
|
99 |
-
|
100 |
-
case 'is_single':
|
101 |
-
case 'is_post':
|
102 |
-
betterInput.placeholder = i18n.enterCommaSeparatedPosts;
|
103 |
-
$betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=post", {
|
104 |
-
multiple: true,
|
105 |
-
multipleSep: ","
|
106 |
-
});
|
107 |
-
break;
|
108 |
-
|
109 |
-
case 'is_page':
|
110 |
-
betterInput.placeholder = i18n.enterCommaSeparatedPages;
|
111 |
-
$betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=page", {
|
112 |
-
multiple: true,
|
113 |
-
multipleSep: ","
|
114 |
-
});
|
115 |
-
break;
|
116 |
-
|
117 |
-
case 'is_post_type':
|
118 |
-
betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;
|
119 |
-
$betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=post_type", {
|
120 |
-
multiple: true,
|
121 |
-
multipleSep: ","
|
122 |
-
});
|
123 |
-
break;
|
124 |
-
|
125 |
-
case 'is_url':
|
126 |
-
qualifierInput.querySelector('option[value="contains"]').style.display = '';
|
127 |
-
qualifierInput.querySelector('option[value="not_contains"]').style.display = '';
|
128 |
-
betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;
|
129 |
-
break;
|
130 |
-
|
131 |
-
case 'is_post_in_category':
|
132 |
-
$betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=category", {
|
133 |
-
multiple: true,
|
134 |
-
multipleSep: ","
|
135 |
-
});
|
136 |
-
break;
|
137 |
-
|
138 |
-
case 'is_post_with_tag':
|
139 |
-
$betterInput.suggest(ajaxurl + "?action=boxzilla_autocomplete&type=post_tag", {
|
140 |
-
multiple: true,
|
141 |
-
multipleSep: ","
|
142 |
-
});
|
143 |
-
break;
|
144 |
-
|
145 |
-
case 'is_user_logged_in':
|
146 |
-
betterInput.style.display = 'none';
|
147 |
-
valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);
|
148 |
-
break;
|
149 |
-
|
150 |
-
case 'is_referer':
|
151 |
-
qualifierInput.querySelector('option[value="contains"]').style.display = '';
|
152 |
-
qualifierInput.querySelector('option[value="not_contains"]').style.display = '';
|
153 |
-
break;
|
154 |
-
|
155 |
-
}
|
156 |
-
}
|
157 |
-
|
158 |
-
function addRuleFields() {
|
159 |
-
var data = {
|
160 |
-
'key': optionControls.querySelectorAll('.boxzilla-rule-row').length,
|
161 |
-
'andor': ruleComparisonEl.value === 'any' ? i18n.or : i18n.and,
|
162 |
-
};
|
163 |
-
var html = rowTemplate(data);
|
164 |
-
$(rulesContainerEl).append(html);
|
165 |
-
return false;
|
166 |
-
}
|
167 |
-
|
168 |
-
module.exports = {
|
169 |
-
'Designer': Designer,
|
170 |
-
'Option': Option,
|
171 |
-
'events': events
|
172 |
-
};
|
173 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/browserify/admin/_designer.js
DELETED
@@ -1,111 +0,0 @@
|
|
1 |
-
var Designer = function($, Option, events) {
|
2 |
-
|
3 |
-
// vars
|
4 |
-
var boxId = document.getElementById('post_ID').value || 0,
|
5 |
-
$editor, $editorFrame,
|
6 |
-
$innerEditor,
|
7 |
-
options = {},
|
8 |
-
visualEditorInitialised = false;
|
9 |
-
|
10 |
-
var $appearanceControls = $("#boxzilla-box-appearance-controls");
|
11 |
-
|
12 |
-
// create Option objects
|
13 |
-
options.borderColor = new Option('border-color');
|
14 |
-
options.borderWidth = new Option('border-width');
|
15 |
-
options.borderStyle = new Option('border-style');
|
16 |
-
options.backgroundColor = new Option('background-color');
|
17 |
-
options.width = new Option('width');
|
18 |
-
options.color = new Option('color');
|
19 |
-
|
20 |
-
// functions
|
21 |
-
function init() {
|
22 |
-
// Only run if TinyMCE has actually inited
|
23 |
-
if( typeof( window.tinyMCE ) !== "object" || tinyMCE.get('content') === null ) {
|
24 |
-
return;
|
25 |
-
}
|
26 |
-
|
27 |
-
// add classes to TinyMCE <html>
|
28 |
-
$editorFrame = $("#content_ifr");
|
29 |
-
$editor = $editorFrame.contents().find('html');
|
30 |
-
$editor.css({
|
31 |
-
'background': 'white'
|
32 |
-
});
|
33 |
-
|
34 |
-
// add content class and padding to TinyMCE <body>
|
35 |
-
$innerEditor = $editor.find('#tinymce');
|
36 |
-
$innerEditor.addClass('boxzilla boxzilla-' + boxId);
|
37 |
-
$innerEditor.css({
|
38 |
-
'margin': 0,
|
39 |
-
'background': 'white',
|
40 |
-
'display': 'inline-block',
|
41 |
-
'width': 'auto',
|
42 |
-
'min-width': '240px',
|
43 |
-
'position': 'relative'
|
44 |
-
});
|
45 |
-
$innerEditor.get(0).style.cssText += ';padding: 25px !important;';
|
46 |
-
|
47 |
-
visualEditorInitialised = true;
|
48 |
-
|
49 |
-
/* @since 2.0.3 */
|
50 |
-
events.trigger('editor.init');
|
51 |
-
}
|
52 |
-
|
53 |
-
/**
|
54 |
-
* Applies the styles from the options to the TinyMCE Editor
|
55 |
-
*
|
56 |
-
* @return bool
|
57 |
-
*/
|
58 |
-
function applyStyles() {
|
59 |
-
if( ! visualEditorInitialised ) {
|
60 |
-
return false;
|
61 |
-
}
|
62 |
-
|
63 |
-
// Apply styles from CSS editor.
|
64 |
-
// Use short timeout to make sure color values are updated.
|
65 |
-
window.setTimeout(() => {
|
66 |
-
|
67 |
-
$innerEditor.css({
|
68 |
-
'border-color': options.borderColor.getColorValue(), //getColorValue( 'borderColor', '' ),
|
69 |
-
'border-width': options.borderWidth.getPxValue(), //getPxValue( 'borderWidth', '' ),
|
70 |
-
'border-style': options.borderStyle.getValue(), //getValue('borderStyle', '' ),
|
71 |
-
'background-color': options.backgroundColor.getColorValue(), //getColorValue( 'backgroundColor', ''),
|
72 |
-
'width': options.width.getPxValue(), //getPxValue( 'width', 'auto' ),
|
73 |
-
'color': options.color.getColorValue() // getColorValue( 'color', '' )
|
74 |
-
});
|
75 |
-
|
76 |
-
/* @since 2.0.3 */
|
77 |
-
events.trigger('editor.styles.apply');
|
78 |
-
}, 10)
|
79 |
-
|
80 |
-
return true;
|
81 |
-
}
|
82 |
-
|
83 |
-
function resetStyles() {
|
84 |
-
for( var key in options ) {
|
85 |
-
if( key.substring(0,5) === 'theme' ) {
|
86 |
-
continue;
|
87 |
-
}
|
88 |
-
|
89 |
-
options[key].clear();
|
90 |
-
}
|
91 |
-
applyStyles();
|
92 |
-
|
93 |
-
/* @since 2.0.3 */
|
94 |
-
events.trigger('editor.styles.reset');
|
95 |
-
}
|
96 |
-
|
97 |
-
// event binders
|
98 |
-
$appearanceControls.find('input.boxzilla-color-field').wpColorPicker({ change: applyStyles, clear: applyStyles });
|
99 |
-
$appearanceControls.find(":input").not(".boxzilla-color-field").change(applyStyles);
|
100 |
-
events.on('editor.init', applyStyles);
|
101 |
-
|
102 |
-
// public methods
|
103 |
-
return {
|
104 |
-
'init': init,
|
105 |
-
'resetStyles': resetStyles,
|
106 |
-
'options': options
|
107 |
-
};
|
108 |
-
|
109 |
-
};
|
110 |
-
|
111 |
-
module.exports = Designer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/browserify/admin/_option.js
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
'use strict';
|
2 |
-
|
3 |
-
var $ = window.jQuery;
|
4 |
-
|
5 |
-
var Option = function( element ) {
|
6 |
-
|
7 |
-
// find corresponding element
|
8 |
-
if( typeof(element) == "string" ) {
|
9 |
-
element = document.getElementById('boxzilla-' + element);
|
10 |
-
}
|
11 |
-
|
12 |
-
if( ! element ) {
|
13 |
-
console.error("Unable to find option element.");
|
14 |
-
}
|
15 |
-
|
16 |
-
this.element = element;
|
17 |
-
};
|
18 |
-
|
19 |
-
Option.prototype.getColorValue = function() {
|
20 |
-
if( this.element.value.length > 0 ) {
|
21 |
-
if( $(this.element).hasClass('wp-color-field')) {
|
22 |
-
return $(this.element).wpColorPicker('color');
|
23 |
-
} else {
|
24 |
-
return this.element.value;
|
25 |
-
}
|
26 |
-
}
|
27 |
-
|
28 |
-
return '';
|
29 |
-
};
|
30 |
-
|
31 |
-
Option.prototype.getPxValue = function( fallbackValue ) {
|
32 |
-
if( this.element.value.length > 0 ) {
|
33 |
-
return parseInt( this.element.value ) + "px";
|
34 |
-
}
|
35 |
-
|
36 |
-
return fallbackValue || '';
|
37 |
-
};
|
38 |
-
|
39 |
-
Option.prototype.getValue = function( fallbackValue ) {
|
40 |
-
|
41 |
-
if( this.element.value.length > 0 ) {
|
42 |
-
return this.element.value;
|
43 |
-
}
|
44 |
-
|
45 |
-
return fallbackValue || '';
|
46 |
-
};
|
47 |
-
|
48 |
-
Option.prototype.clear = function() {
|
49 |
-
this.element.value = '';
|
50 |
-
};
|
51 |
-
|
52 |
-
Option.prototype.setValue = function(value) {
|
53 |
-
this.element.value = value;
|
54 |
-
};
|
55 |
-
|
56 |
-
module.exports = Option;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/browserify/script.js
DELETED
@@ -1,139 +0,0 @@
|
|
1 |
-
(function() {
|
2 |
-
'use strict';
|
3 |
-
|
4 |
-
var Boxzilla = require('boxzilla');
|
5 |
-
var options = window.boxzilla_options;
|
6 |
-
|
7 |
-
// expose Boxzilla object to window
|
8 |
-
window.Boxzilla = Boxzilla;
|
9 |
-
|
10 |
-
// helper function for setting CSS styles
|
11 |
-
function css(element, styles) {
|
12 |
-
if( styles.background_color ) {
|
13 |
-
element.style.background = styles.background_color;
|
14 |
-
}
|
15 |
-
|
16 |
-
if( styles.color ) {
|
17 |
-
element.style.color = styles.color;
|
18 |
-
}
|
19 |
-
|
20 |
-
if( styles.border_color ) {
|
21 |
-
element.style.borderColor = styles.border_color;
|
22 |
-
}
|
23 |
-
|
24 |
-
if( styles.border_width ) {
|
25 |
-
element.style.borderWidth = parseInt(styles.border_width) + "px";
|
26 |
-
}
|
27 |
-
|
28 |
-
if( styles.border_style ) {
|
29 |
-
element.style.borderStyle = styles.border_style;
|
30 |
-
}
|
31 |
-
|
32 |
-
if( styles.width ) {
|
33 |
-
element.style.maxWidth = parseInt(styles.width) + "px";
|
34 |
-
}
|
35 |
-
}
|
36 |
-
|
37 |
-
function createBoxesFromConfig() {
|
38 |
-
|
39 |
-
// failsafe against including script twice.
|
40 |
-
if( options.inited ) {
|
41 |
-
return;
|
42 |
-
}
|
43 |
-
|
44 |
-
// create boxes from options
|
45 |
-
for(var key in options.boxes) {
|
46 |
-
|
47 |
-
// get opts
|
48 |
-
var boxOpts = options.boxes[key];
|
49 |
-
boxOpts.testMode = isLoggedIn && options.testMode;
|
50 |
-
|
51 |
-
// find box content element, bail if not found
|
52 |
-
var boxContentElement = document.getElementById('boxzilla-box-'+ boxOpts.id +'-content');
|
53 |
-
if( ! boxContentElement) {
|
54 |
-
continue;
|
55 |
-
}
|
56 |
-
|
57 |
-
// use element as content option
|
58 |
-
boxOpts.content = boxContentElement;
|
59 |
-
|
60 |
-
// create box
|
61 |
-
var box = Boxzilla.create(boxOpts.id, boxOpts);
|
62 |
-
|
63 |
-
// add box slug to box element as classname
|
64 |
-
box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug;
|
65 |
-
|
66 |
-
// add custom css to box
|
67 |
-
css(box.element, boxOpts.css);
|
68 |
-
|
69 |
-
try {
|
70 |
-
box.element.firstChild.firstChild.className += " first-child";
|
71 |
-
box.element.firstChild.lastChild.className += " last-child";
|
72 |
-
} catch(e) {}
|
73 |
-
|
74 |
-
// maybe show box right away
|
75 |
-
if( box.fits() && locationHashRefersBox(box) ) {
|
76 |
-
box.show();
|
77 |
-
}
|
78 |
-
}
|
79 |
-
|
80 |
-
// set flag to prevent initialising twice
|
81 |
-
options.inited = true;
|
82 |
-
|
83 |
-
// trigger "done" event.
|
84 |
-
Boxzilla.trigger('done');
|
85 |
-
|
86 |
-
// maybe open box with MC4WP form in it
|
87 |
-
maybeOpenMailChimpForWordPressBox();
|
88 |
-
}
|
89 |
-
|
90 |
-
function locationHashRefersBox(box) {
|
91 |
-
if( ! window.location.hash || 0 === window.location.hash.length ) {
|
92 |
-
return false;
|
93 |
-
}
|
94 |
-
|
95 |
-
// parse "boxzilla-{id}" from location hash
|
96 |
-
const match = window.location.hash.match(/[#&](boxzilla-\d+)/);
|
97 |
-
if (!match || typeof(match) !== "object" || match.length < 2) {
|
98 |
-
return false;
|
99 |
-
}
|
100 |
-
|
101 |
-
const elementId = match[1];
|
102 |
-
if( elementId === box.element.id ) {
|
103 |
-
return true;
|
104 |
-
} else if( box.element.querySelector('#' + elementId) ) {
|
105 |
-
return true;
|
106 |
-
}
|
107 |
-
|
108 |
-
return false;
|
109 |
-
}
|
110 |
-
|
111 |
-
function maybeOpenMailChimpForWordPressBox() {
|
112 |
-
if( typeof(window.mc4wp_forms_config) !== "object" || ! window.mc4wp_forms_config.submitted_form ) {
|
113 |
-
return;
|
114 |
-
}
|
115 |
-
|
116 |
-
var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;
|
117 |
-
var boxes = Boxzilla.boxes;
|
118 |
-
for( var boxId in boxes ) {
|
119 |
-
if(!boxes.hasOwnProperty(boxId)) { continue; }
|
120 |
-
var box = boxes[boxId];
|
121 |
-
if( box.element.querySelector(selector)) {
|
122 |
-
box.show();
|
123 |
-
return;
|
124 |
-
}
|
125 |
-
}
|
126 |
-
}
|
127 |
-
|
128 |
-
// print message when test mode is enabled
|
129 |
-
var isLoggedIn = document.body.className.indexOf('logged-in') > -1;
|
130 |
-
if( isLoggedIn && options.testMode ) {
|
131 |
-
console.log( 'Boxzilla: Test mode is enabled. Please disable test mode if you\'re done testing.' );
|
132 |
-
}
|
133 |
-
|
134 |
-
// init boxzilla
|
135 |
-
Boxzilla.init();
|
136 |
-
|
137 |
-
// on window.load, create DOM elements for boxes
|
138 |
-
window.addEventListener('load', createBoxesFromConfig);
|
139 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assets/img/menu-icon.svg
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3 |
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16" width="16" height="16"><defs><path d="M0 0L16 0L16 16L0 16L0 16L0 0ZM6.72 13.59L6.72 12.47L7.71 13.28L8.94 13.59L10.17 13.28L11.17 12.46L11.85 11.25L12.1 9.76L11.85 8.27L11.17 7.05L10.17 6.23L8.94 5.93L7.71 6.23L6.72 7.04L6.72 2.27L4.16 2.27L4.16 13.59L4.16 13.59L6.72 13.59ZM9.93 9.03L10.06 9.76L9.93 10.49L9.56 11.08L9.01 11.48L8.35 11.63L7.68 11.48L7.13 11.08L6.76 10.49L6.72 10.26L6.72 9.25L6.76 9.03L7.13 8.43L7.68 8.03L8.35 7.88L9.01 8.03L9.56 8.43L9.56 8.43L9.93 9.03Z" id="c1kAiZqIlD"></path></defs><g><g><g><use xlink:href="#c1kAiZqIlD" opacity="1" fill="
|
1 |
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2 |
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3 |
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMidYMid meet" viewBox="0 0 16 16" width="16" height="16"><defs><path d="M0 0L16 0L16 16L0 16L0 16L0 0ZM6.72 13.59L6.72 12.47L7.71 13.28L8.94 13.59L10.17 13.28L11.17 12.46L11.85 11.25L12.1 9.76L11.85 8.27L11.17 7.05L10.17 6.23L8.94 5.93L7.71 6.23L6.72 7.04L6.72 2.27L4.16 2.27L4.16 13.59L4.16 13.59L6.72 13.59ZM9.93 9.03L10.06 9.76L9.93 10.49L9.56 11.08L9.01 11.48L8.35 11.63L7.68 11.48L7.13 11.08L6.76 10.49L6.72 10.26L6.72 9.25L6.76 9.03L7.13 8.43L7.68 8.03L8.35 7.88L9.01 8.03L9.56 8.43L9.56 8.43L9.93 9.03Z" id="c1kAiZqIlD"></path></defs><g><g><g><use xlink:href="#c1kAiZqIlD" opacity="1" fill="#a0a5aa" fill-opacity="1"></use></g></g></g></svg>
|
assets/js/admin-script.js
CHANGED
@@ -353,7 +353,7 @@ module.exports = Option;
|
|
353 |
|
354 |
},{}],5:[function(require,module,exports){
|
355 |
/*!
|
356 |
-
* EventEmitter v5.2.
|
357 |
* Unlicense - http://unlicense.org/
|
358 |
* Oliver Caldwell - https://oli.me.uk/
|
359 |
* @preserve
|
353 |
|
354 |
},{}],5:[function(require,module,exports){
|
355 |
/*!
|
356 |
+
* EventEmitter v5.2.8 - git.io/ee
|
357 |
* Unlicense - http://unlicense.org/
|
358 |
* Oliver Caldwell - https://oli.me.uk/
|
359 |
* @preserve
|
assets/js/admin-script.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["admin-script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","window","Boxzilla_Admin","./admin/_admin.js","2","$","jQuery","Option","optionControls","document","getElementById","$optionControls","tnLoggedIn","createTextNode","events","Designer","rowTemplate","wp","template","i18n","boxzilla_i18n","ruleComparisonEl","rulesContainerEl","on","data","key","querySelectorAll","andor","value","or","and","html","append","row","this","parents","prev","remove","setContextualHelpers","find","toggle","change","newText","text","load","tinyMCE","style","display","each","context","tagName","toLowerCase","get","condition","querySelector","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","removeAttribute","className","parentNode","insertBefore","nextSibling","removeChild","placeholder","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","./_designer.js","./_option.js","wolfy87-eventemitter","3","_typeof","obj","Symbol","iterator","constructor","prototype","$editor","$editorFrame","$innerEditor","boxId","options","visualEditorInitialised","$appearanceControls","applyStyles","setTimeout","css","border-color","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","width","color","trigger","wpColorPicker","clear","not","init","contents","background","addClass","margin","min-width","position","cssText","resetStyles","substring","4","element","console","error","hasClass","fallbackValue","parseInt","setValue","5","EventEmitter","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","apply","arguments","getListeners","evt","response","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IA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nD,OADAM,KAAKoJ,iBAAmB1J,EACjBM,MAWXmG,EAAM8C,oBAAsB,WACxB,OAAIjJ,KAAKiH,eAAe,qBACbjH,KAAKoJ,kBAapBjD,EAAMY,WAAa,WACf,OAAO/G,KAAK2I,UAAY3I,KAAK2I,QAAU,KAQ3CzC,EAAamD,WAAa,WAEtB,OADA5L,EAAQyI,aAAeE,EAChBF,GAIW,mBAAXxJ,GAAyBA,EAAO4M,IACvC5M,EAAO,WACH,OAAOwJ,IAGY,iBAAXpI,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUyI,EAGjBzI,EAAQyI,aAAeA,EA5d9B,CA8dmB,oBAAXnI,OAAyBA,OAASiC,MAAQ,KAEjD,KAAK,GAAG,CAAC,IAz0BX","file":"admin-script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n\"use strict\";\n\n(function () {\n 'use strict';\n\n var $ = window.jQuery;\n\n var Option = require('./_option.js');\n\n var optionControls = document.getElementById('boxzilla-box-options-controls');\n var $optionControls = $(optionControls);\n var tnLoggedIn = document.createTextNode(' logged in'); // sanity check, are we on the correct page?\n\n if ($optionControls.length === 0) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter');\n\n var events = new EventEmitter();\n\n var Designer = require('./_designer.js')($, Option, events);\n\n var rowTemplate = wp.template('rule-row-template');\n var i18n = boxzilla_i18n;\n var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');\n var rulesContainerEl = document.getElementById('boxzilla-box-rules'); // events\n\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 $(ruleComparisonEl).change(toggleAndOrTexts);\n $(window).load(function () {\n if (typeof window.tinyMCE === \"undefined\") {\n document.getElementById('notice-notinymce').style.display = '';\n }\n }); // call contextual helper method for each row\n\n $('.boxzilla-rule-row').each(setContextualHelpers);\n\n function toggleAndOrTexts() {\n var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;\n $('.boxzilla-andor').text(newText);\n }\n\n function toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n }\n\n function removeRule() {\n var row = $(this).parents('tr'); // delete andor row\n\n row.prev().remove(); // delete rule row\n\n row.remove();\n }\n\n function setContextualHelpers() {\n var context = this.tagName.toLowerCase() === \"tr\" ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput); // remove previously added helpers\n\n $(context.querySelectorAll('.boxzilla-helper')).remove(); // prepare better input\n\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 betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = 'none';\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = 'none';\n\n if (tnLoggedIn.parentNode) {\n tnLoggedIn.parentNode.removeChild(tnLoggedIn);\n } // change placeholder for textual help\n\n\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_url':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_user_logged_in':\n betterInput.style.display = 'none';\n valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);\n break;\n\n case 'is_referer':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n break;\n }\n }\n\n function addRuleFields() {\n var data = {\n 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length,\n 'andor': ruleComparisonEl.value === 'any' ? i18n.or : i18n.and\n };\n var html = rowTemplate(data);\n $(rulesContainerEl).append(html);\n return false;\n }\n\n module.exports = {\n 'Designer': Designer,\n 'Option': Option,\n 'events': events\n };\n})();\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Designer = function Designer($, Option, events) {\n // vars\n var boxId = document.getElementById('post_ID').value || 0,\n $editor,\n $editorFrame,\n $innerEditor,\n options = {},\n visualEditorInitialised = false;\n var $appearanceControls = $(\"#boxzilla-box-appearance-controls\"); // create Option objects\n\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'); // functions\n\n function init() {\n // Only run if TinyMCE has actually inited\n if (_typeof(window.tinyMCE) !== \"object\" || tinyMCE.get('content') === null) {\n return;\n } // add classes to TinyMCE <html>\n\n\n $editorFrame = $(\"#content_ifr\");\n $editor = $editorFrame.contents().find('html');\n $editor.css({\n 'background': 'white'\n }); // add content class and padding to TinyMCE <body>\n\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 visualEditorInitialised = true;\n /* @since 2.0.3 */\n\n events.trigger('editor.init');\n }\n /**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n\n\n function applyStyles() {\n if (!visualEditorInitialised) {\n return false;\n } // Apply styles from CSS editor. \n // Use short timeout to make sure color values are updated.\n\n\n window.setTimeout(function () {\n $innerEditor.css({\n 'border-color': options.borderColor.getColorValue(),\n //getColorValue( 'borderColor', '' ),\n 'border-width': options.borderWidth.getPxValue(),\n //getPxValue( 'borderWidth', '' ),\n 'border-style': options.borderStyle.getValue(),\n //getValue('borderStyle', '' ),\n 'background-color': options.backgroundColor.getColorValue(),\n //getColorValue( 'backgroundColor', ''),\n 'width': options.width.getPxValue(),\n //getPxValue( 'width', 'auto' ),\n 'color': options.color.getColorValue() // getColorValue( 'color', '' )\n\n });\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.apply');\n }, 10);\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\n applyStyles();\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.reset');\n } // event binders\n\n\n $appearanceControls.find('input.boxzilla-color-field').wpColorPicker({\n change: applyStyles,\n clear: applyStyles\n });\n $appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n events.on('editor.init', applyStyles); // public methods\n\n return {\n 'init': init,\n 'resetStyles': resetStyles,\n 'options': options\n };\n};\n\nmodule.exports = Designer;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\n\nvar Option = function Option(element) {\n // 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\nOption.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\nOption.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\nOption.prototype.getValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return this.element.value;\n }\n\n return fallbackValue || '';\n};\n\nOption.prototype.clear = function () {\n this.element.value = '';\n};\n\nOption.prototype.setValue = function (value) {\n this.element.value = value;\n};\n\nmodule.exports = Option;\n\n},{}],5:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.6 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n; })();"]}
|
1 |
+
{"version":3,"sources":["admin-script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","window","Boxzilla_Admin","./admin/_admin.js","2","$","jQuery","Option","optionControls","document","getElementById","$optionControls","tnLoggedIn","createTextNode","events","Designer","rowTemplate","wp","template","i18n","boxzilla_i18n","ruleComparisonEl","rulesContainerEl","on","data","key","querySelectorAll","andor","value","or","and","html","append","row","this","parents","prev","remove","setContextualHelpers","find","toggle","change","newText","text","load","tinyMCE","style","display","each","context","tagName","toLowerCase","get","condition","querySelector","valueInput","qualifierInput","betterInput","cloneNode","$betterInput","removeAttribute","className","parentNode","insertBefore","nextSibling","removeChild","placeholder","enterCommaSeparatedValues","enterCommaSeparatedPosts","suggest","ajaxurl","multiple","multipleSep","enterCommaSeparatedPages","enterCommaSeparatedPostTypes","enterCommaSeparatedRelativeUrls","./_designer.js","./_option.js","wolfy87-eventemitter","3","_typeof","obj","Symbol","iterator","constructor","prototype","$editor","$editorFrame","$innerEditor","boxId","options","visualEditorInitialised","$appearanceControls","applyStyles","setTimeout","css","border-color","borderColor","getColorValue","border-width","borderWidth","getPxValue","border-style","borderStyle","getValue","background-color","backgroundColor","width","color","trigger","wpColorPicker","clear","not","init","contents","background","addClass","margin","min-width","position","cssText","resetStyles","substring","4","element","console","error","hasClass","fallbackValue","parseInt","setValue","5","EventEmitter","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","apply","arguments","getListeners","evt","response","_getEvents","RegExp","hasOwnProperty","test","flattenListeners","flatListeners","push","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","single","removeEvent","type","_events","removeAllListeners","emitEvent","args","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,IAAIZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGQ,QAAQ,IAAI,IAAIL,GAAE,EAAoCH,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACY,EAAE,CAAC,SAASC,EAAQC,EAAOL,GACzlB,aAEAM,OAAOC,eAAiBH,EAAQ,sBAE9B,CAACI,oBAAoB,IAAIC,EAAE,CAAC,SAASL,EAAQC,EAAOL,GACtD,cAEA,WAGE,IAAIU,EAAIJ,OAAOK,OAEXC,EAASR,EAAQ,gBAEjBS,EAAiBC,SAASC,eAAe,iCACzCC,EAAkBN,EAAEG,GACpBI,EAAaH,SAASI,eAAe,cAEzC,GAA+B,IAA3BF,EAAgBd,OAApB,CAIA,IAEIiB,EAAS,IAFMf,EAAQ,yBAIvBgB,EAAWhB,EAAQ,iBAARA,CAA0BM,EAAGE,EAAQO,GAEhDE,EAAcC,GAAGC,SAAS,qBAC1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C9I,KAAKiJ,uBAClBjJ,KAAKiI,eAAepB,EAAKN,EAASA,UAMlD,OAAOvG,MAMXmG,EAAMxB,QAAU6B,EAAM,aAUtBL,EAAM+C,KAAO,SAAcrC,GACvB,IAAIiC,EAAOvB,MAAMpE,UAAU6F,MAAMtL,KAAKiJ,UAAW,GACjD,OAAO3G,KAAK6I,UAAUhC,EAAKiC,IAW/B3C,EAAMgD,mBAAqB,SAA4BzJ,GAEnD,OADAM,KAAKoJ,iBAAmB1J,EACjBM,MAWXmG,EAAM8C,oBAAsB,WACxB,OAAIjJ,KAAKiH,eAAe,qBACbjH,KAAKoJ,kBAapBjD,EAAMY,WAAa,WACf,OAAO/G,KAAK2I,UAAY3I,KAAK2I,QAAU,KAQ3CzC,EAAamD,WAAa,WAEtB,OADA5L,EAAQyI,aAAeE,EAChBF,GAIW,mBAAXxJ,GAAyBA,EAAO4M,IACvC5M,EAAO,WACH,OAAOwJ,IAGY,iBAAXpI,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAUyI,EAGjBzI,EAAQyI,aAAeA,EA5d9B,CA8dmB,oBAAXnI,OAAyBA,OAASiC,MAAQ,KAEjD,KAAK,GAAG,CAAC,IAz0BX","file":"admin-script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nwindow.Boxzilla_Admin = require('./admin/_admin.js');\n\n},{\"./admin/_admin.js\":2}],2:[function(require,module,exports){\n\"use strict\";\n\n(function () {\n 'use strict';\n\n var $ = window.jQuery;\n\n var Option = require('./_option.js');\n\n var optionControls = document.getElementById('boxzilla-box-options-controls');\n var $optionControls = $(optionControls);\n var tnLoggedIn = document.createTextNode(' logged in'); // sanity check, are we on the correct page?\n\n if ($optionControls.length === 0) {\n return;\n }\n\n var EventEmitter = require('wolfy87-eventemitter');\n\n var events = new EventEmitter();\n\n var Designer = require('./_designer.js')($, Option, events);\n\n var rowTemplate = wp.template('rule-row-template');\n var i18n = boxzilla_i18n;\n var ruleComparisonEl = document.getElementById('boxzilla-rule-comparison');\n var rulesContainerEl = document.getElementById('boxzilla-box-rules'); // events\n\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 $(ruleComparisonEl).change(toggleAndOrTexts);\n $(window).load(function () {\n if (typeof window.tinyMCE === \"undefined\") {\n document.getElementById('notice-notinymce').style.display = '';\n }\n }); // call contextual helper method for each row\n\n $('.boxzilla-rule-row').each(setContextualHelpers);\n\n function toggleAndOrTexts() {\n var newText = ruleComparisonEl.value === 'any' ? i18n.or : i18n.and;\n $('.boxzilla-andor').text(newText);\n }\n\n function toggleTriggerOptions() {\n $optionControls.find('.boxzilla-trigger-options').toggle(this.value !== '');\n }\n\n function removeRule() {\n var row = $(this).parents('tr'); // delete andor row\n\n row.prev().remove(); // delete rule row\n\n row.remove();\n }\n\n function setContextualHelpers() {\n var context = this.tagName.toLowerCase() === \"tr\" ? this : $(this).parents('tr').get(0);\n var condition = context.querySelector('.boxzilla-rule-condition').value;\n var valueInput = context.querySelector('.boxzilla-rule-value');\n var qualifierInput = context.querySelector('.boxzilla-rule-qualifier');\n var betterInput = valueInput.cloneNode(true);\n var $betterInput = $(betterInput); // remove previously added helpers\n\n $(context.querySelectorAll('.boxzilla-helper')).remove(); // prepare better input\n\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 betterInput.style.display = '';\n valueInput.style.display = 'none';\n qualifierInput.style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = 'none';\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = 'none';\n\n if (tnLoggedIn.parentNode) {\n tnLoggedIn.parentNode.removeChild(tnLoggedIn);\n } // change placeholder for textual help\n\n\n switch (condition) {\n default:\n betterInput.placeholder = i18n.enterCommaSeparatedValues;\n break;\n\n case '':\n case 'everywhere':\n qualifierInput.value = '1';\n valueInput.value = '';\n betterInput.style.display = 'none';\n qualifierInput.style.display = 'none';\n break;\n\n case 'is_single':\n case 'is_post':\n betterInput.placeholder = i18n.enterCommaSeparatedPosts;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_page':\n betterInput.placeholder = i18n.enterCommaSeparatedPages;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=page\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_type':\n betterInput.placeholder = i18n.enterCommaSeparatedPostTypes;\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_type\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_url':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n betterInput.placeholder = i18n.enterCommaSeparatedRelativeUrls;\n break;\n\n case 'is_post_in_category':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=category\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_post_with_tag':\n $betterInput.suggest(ajaxurl + \"?action=boxzilla_autocomplete&type=post_tag\", {\n multiple: true,\n multipleSep: \",\"\n });\n break;\n\n case 'is_user_logged_in':\n betterInput.style.display = 'none';\n valueInput.parentNode.insertBefore(tnLoggedIn, valueInput.nextSibling);\n break;\n\n case 'is_referer':\n qualifierInput.querySelector('option[value=\"contains\"]').style.display = '';\n qualifierInput.querySelector('option[value=\"not_contains\"]').style.display = '';\n break;\n }\n }\n\n function addRuleFields() {\n var data = {\n 'key': optionControls.querySelectorAll('.boxzilla-rule-row').length,\n 'andor': ruleComparisonEl.value === 'any' ? i18n.or : i18n.and\n };\n var html = rowTemplate(data);\n $(rulesContainerEl).append(html);\n return false;\n }\n\n module.exports = {\n 'Designer': Designer,\n 'Option': Option,\n 'events': events\n };\n})();\n\n},{\"./_designer.js\":3,\"./_option.js\":4,\"wolfy87-eventemitter\":5}],3:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nvar Designer = function Designer($, Option, events) {\n // vars\n var boxId = document.getElementById('post_ID').value || 0,\n $editor,\n $editorFrame,\n $innerEditor,\n options = {},\n visualEditorInitialised = false;\n var $appearanceControls = $(\"#boxzilla-box-appearance-controls\"); // create Option objects\n\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'); // functions\n\n function init() {\n // Only run if TinyMCE has actually inited\n if (_typeof(window.tinyMCE) !== \"object\" || tinyMCE.get('content') === null) {\n return;\n } // add classes to TinyMCE <html>\n\n\n $editorFrame = $(\"#content_ifr\");\n $editor = $editorFrame.contents().find('html');\n $editor.css({\n 'background': 'white'\n }); // add content class and padding to TinyMCE <body>\n\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 visualEditorInitialised = true;\n /* @since 2.0.3 */\n\n events.trigger('editor.init');\n }\n /**\n * Applies the styles from the options to the TinyMCE Editor\n *\n * @return bool\n */\n\n\n function applyStyles() {\n if (!visualEditorInitialised) {\n return false;\n } // Apply styles from CSS editor. \n // Use short timeout to make sure color values are updated.\n\n\n window.setTimeout(function () {\n $innerEditor.css({\n 'border-color': options.borderColor.getColorValue(),\n //getColorValue( 'borderColor', '' ),\n 'border-width': options.borderWidth.getPxValue(),\n //getPxValue( 'borderWidth', '' ),\n 'border-style': options.borderStyle.getValue(),\n //getValue('borderStyle', '' ),\n 'background-color': options.backgroundColor.getColorValue(),\n //getColorValue( 'backgroundColor', ''),\n 'width': options.width.getPxValue(),\n //getPxValue( 'width', 'auto' ),\n 'color': options.color.getColorValue() // getColorValue( 'color', '' )\n\n });\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.apply');\n }, 10);\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\n applyStyles();\n /* @since 2.0.3 */\n\n events.trigger('editor.styles.reset');\n } // event binders\n\n\n $appearanceControls.find('input.boxzilla-color-field').wpColorPicker({\n change: applyStyles,\n clear: applyStyles\n });\n $appearanceControls.find(\":input\").not(\".boxzilla-color-field\").change(applyStyles);\n events.on('editor.init', applyStyles); // public methods\n\n return {\n 'init': init,\n 'resetStyles': resetStyles,\n 'options': options\n };\n};\n\nmodule.exports = Designer;\n\n},{}],4:[function(require,module,exports){\n'use strict';\n\nvar $ = window.jQuery;\n\nvar Option = function Option(element) {\n // 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\nOption.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\nOption.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\nOption.prototype.getValue = function (fallbackValue) {\n if (this.element.value.length > 0) {\n return this.element.value;\n }\n\n return fallbackValue || '';\n};\n\nOption.prototype.clear = function () {\n this.element.value = '';\n};\n\nOption.prototype.setValue = function (value) {\n this.element.value = value;\n};\n\nmodule.exports = Option;\n\n},{}],5:[function(require,module,exports){\n/*!\n * EventEmitter v5.2.8 - git.io/ee\n * Unlicense - http://unlicense.org/\n * Oliver Caldwell - https://oli.me.uk/\n * @preserve\n */\n\n;(function (exports) {\n 'use strict';\n\n /**\n * Class for managing events.\n * Can be extended to provide event functionality in other classes.\n *\n * @class EventEmitter Manages event registering and emitting.\n */\n function EventEmitter() {}\n\n // Shortcuts to improve speed and size\n var proto = EventEmitter.prototype;\n var originalGlobalValue = exports.EventEmitter;\n\n /**\n * Finds the index of the listener for the event in its storage array.\n *\n * @param {Function[]} listeners Array of listeners to search through.\n * @param {Function} listener Method to look for.\n * @return {Number} Index of the specified listener, -1 if not found\n * @api private\n */\n function indexOfListener(listeners, listener) {\n var i = listeners.length;\n while (i--) {\n if (listeners[i].listener === listener) {\n return i;\n }\n }\n\n return -1;\n }\n\n /**\n * Alias a method while keeping the context correct, to allow for overwriting of target method.\n *\n * @param {String} name The name of the target method.\n * @return {Function} The aliased method\n * @api private\n */\n function alias(name) {\n return function aliasClosure() {\n return this[name].apply(this, arguments);\n };\n }\n\n /**\n * Returns the listener array for the specified event.\n * Will initialise the event object and listener arrays if required.\n * Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.\n * Each property in the object response is an array of listener functions.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Function[]|Object} All listener functions for the event.\n */\n proto.getListeners = function getListeners(evt) {\n var events = this._getEvents();\n var response;\n var key;\n\n // Return a concatenated array of all matching events if\n // the selector is a regular expression.\n if (evt instanceof RegExp) {\n response = {};\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n response[key] = events[key];\n }\n }\n }\n else {\n response = events[evt] || (events[evt] = []);\n }\n\n return response;\n };\n\n /**\n * Takes a list of listener objects and flattens it into a list of listener functions.\n *\n * @param {Object[]} listeners Raw listener objects.\n * @return {Function[]} Just the listener functions.\n */\n proto.flattenListeners = function flattenListeners(listeners) {\n var flatListeners = [];\n var i;\n\n for (i = 0; i < listeners.length; i += 1) {\n flatListeners.push(listeners[i].listener);\n }\n\n return flatListeners;\n };\n\n /**\n * Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.\n *\n * @param {String|RegExp} evt Name of the event to return the listeners from.\n * @return {Object} All listener functions for an event in an object.\n */\n proto.getListenersAsObject = function getListenersAsObject(evt) {\n var listeners = this.getListeners(evt);\n var response;\n\n if (listeners instanceof Array) {\n response = {};\n response[evt] = listeners;\n }\n\n return response || listeners;\n };\n\n function isValidListener (listener) {\n if (typeof listener === 'function' || listener instanceof RegExp) {\n return true\n } else if (listener && typeof listener === 'object') {\n return isValidListener(listener.listener)\n } else {\n return false\n }\n }\n\n /**\n * Adds a listener function to the specified event.\n * The listener will not be added if it is a duplicate.\n * If the listener returns true then it will be removed after it is called.\n * If you pass a regular expression as the event name then the listener will be added to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListener = function addListener(evt, listener) {\n if (!isValidListener(listener)) {\n throw new TypeError('listener must be a function');\n }\n\n var listeners = this.getListenersAsObject(evt);\n var listenerIsWrapped = typeof listener === 'object';\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {\n listeners[key].push(listenerIsWrapped ? listener : {\n listener: listener,\n once: false\n });\n }\n }\n\n return this;\n };\n\n /**\n * Alias of addListener\n */\n proto.on = alias('addListener');\n\n /**\n * Semi-alias of addListener. It will add a listener that will be\n * automatically removed after its first execution.\n *\n * @param {String|RegExp} evt Name of the event to attach the listener to.\n * @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addOnceListener = function addOnceListener(evt, listener) {\n return this.addListener(evt, {\n listener: listener,\n once: true\n });\n };\n\n /**\n * Alias of addOnceListener.\n */\n proto.once = alias('addOnceListener');\n\n /**\n * Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.\n * You need to tell it what event names should be matched by a regex.\n *\n * @param {String} evt Name of the event to create.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvent = function defineEvent(evt) {\n this.getListeners(evt);\n return this;\n };\n\n /**\n * Uses defineEvent to define multiple events.\n *\n * @param {String[]} evts An array of event names to define.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.defineEvents = function defineEvents(evts) {\n for (var i = 0; i < evts.length; i += 1) {\n this.defineEvent(evts[i]);\n }\n return this;\n };\n\n /**\n * Removes a listener function from the specified event.\n * When passed a regular expression as the event name, it will remove the listener from all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to remove the listener from.\n * @param {Function} listener Method to remove from the event.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListener = function removeListener(evt, listener) {\n var listeners = this.getListenersAsObject(evt);\n var index;\n var key;\n\n for (key in listeners) {\n if (listeners.hasOwnProperty(key)) {\n index = indexOfListener(listeners[key], listener);\n\n if (index !== -1) {\n listeners[key].splice(index, 1);\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of removeListener\n */\n proto.off = alias('removeListener');\n\n /**\n * Adds listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.\n * You can also pass it a regular expression to add the array of listeners to all events that match it.\n * Yeah, this function does quite a bit. That's probably a bad thing.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.addListeners = function addListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(false, evt, listeners);\n };\n\n /**\n * Removes listeners in bulk using the manipulateListeners method.\n * If you pass an object as the first argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be removed.\n * You can also pass it a regular expression to remove the listeners from all events that match it.\n *\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeListeners = function removeListeners(evt, listeners) {\n // Pass through to manipulateListeners\n return this.manipulateListeners(true, evt, listeners);\n };\n\n /**\n * Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.\n * The first argument will determine if the listeners are removed (true) or added (false).\n * If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.\n * You can also pass it an event name and an array of listeners to be added/removed.\n * You can also pass it a regular expression to manipulate the listeners of all events that match it.\n *\n * @param {Boolean} remove True if you want to remove listeners, false if you want to add.\n * @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.\n * @param {Function[]} [listeners] An optional array of listener functions to add/remove.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {\n var i;\n var value;\n var single = remove ? this.removeListener : this.addListener;\n var multiple = remove ? this.removeListeners : this.addListeners;\n\n // If evt is an object then pass each of its properties to this method\n if (typeof evt === 'object' && !(evt instanceof RegExp)) {\n for (i in evt) {\n if (evt.hasOwnProperty(i) && (value = evt[i])) {\n // Pass the single listener straight through to the singular method\n if (typeof value === 'function') {\n single.call(this, i, value);\n }\n else {\n // Otherwise pass back to the multiple function\n multiple.call(this, i, value);\n }\n }\n }\n }\n else {\n // So evt must be a string\n // And listeners must be an array of listeners\n // Loop over it and pass each one to the multiple method\n i = listeners.length;\n while (i--) {\n single.call(this, evt, listeners[i]);\n }\n }\n\n return this;\n };\n\n /**\n * Removes all listeners from a specified event.\n * If you do not specify an event then all listeners will be removed.\n * That means every event will be emptied.\n * You can also pass a regex to remove all events that match it.\n *\n * @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.removeEvent = function removeEvent(evt) {\n var type = typeof evt;\n var events = this._getEvents();\n var key;\n\n // Remove different things depending on the state of evt\n if (type === 'string') {\n // Remove all listeners for the specified event\n delete events[evt];\n }\n else if (evt instanceof RegExp) {\n // Remove all events matching the regex.\n for (key in events) {\n if (events.hasOwnProperty(key) && evt.test(key)) {\n delete events[key];\n }\n }\n }\n else {\n // Remove all listeners in all events\n delete this._events;\n }\n\n return this;\n };\n\n /**\n * Alias of removeEvent.\n *\n * Added to mirror the node API.\n */\n proto.removeAllListeners = alias('removeEvent');\n\n /**\n * Emits an event of your choice.\n * When emitted, every listener attached to that event will be executed.\n * If you pass the optional argument array then those arguments will be passed to every listener upon execution.\n * Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.\n * So they will not arrive within the array on the other side, they will be separate.\n * You can also pass a regular expression to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {Array} [args] Optional array of arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emitEvent = function emitEvent(evt, args) {\n var listenersMap = this.getListenersAsObject(evt);\n var listeners;\n var listener;\n var i;\n var key;\n var response;\n\n for (key in listenersMap) {\n if (listenersMap.hasOwnProperty(key)) {\n listeners = listenersMap[key].slice(0);\n\n for (i = 0; i < listeners.length; i++) {\n // If the listener returns true then it shall be removed from the event\n // The function is executed either with a basic call or an apply if there is an args array\n listener = listeners[i];\n\n if (listener.once === true) {\n this.removeListener(evt, listener.listener);\n }\n\n response = listener.listener.apply(this, args || []);\n\n if (response === this._getOnceReturnValue()) {\n this.removeListener(evt, listener.listener);\n }\n }\n }\n }\n\n return this;\n };\n\n /**\n * Alias of emitEvent\n */\n proto.trigger = alias('emitEvent');\n\n /**\n * Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.\n * As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.\n *\n * @param {String|RegExp} evt Name of the event to emit and execute listeners for.\n * @param {...*} Optional additional arguments to be passed to each listener.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.emit = function emit(evt) {\n var args = Array.prototype.slice.call(arguments, 1);\n return this.emitEvent(evt, args);\n };\n\n /**\n * Sets the current value to check against when executing listeners. If a\n * listeners return value matches the one set here then it will be removed\n * after execution. This value defaults to true.\n *\n * @param {*} value The new value to check for when executing listeners.\n * @return {Object} Current instance of EventEmitter for chaining.\n */\n proto.setOnceReturnValue = function setOnceReturnValue(value) {\n this._onceReturnValue = value;\n return this;\n };\n\n /**\n * Fetches the current value to check against when executing listeners. If\n * the listeners return value matches this one then it should be removed\n * automatically. It will return true by default.\n *\n * @return {*|Boolean} The current value to check for or the default, true.\n * @api private\n */\n proto._getOnceReturnValue = function _getOnceReturnValue() {\n if (this.hasOwnProperty('_onceReturnValue')) {\n return this._onceReturnValue;\n }\n else {\n return true;\n }\n };\n\n /**\n * Fetches the events object and creates one if required.\n *\n * @return {Object} The events storage object.\n * @api private\n */\n proto._getEvents = function _getEvents() {\n return this._events || (this._events = {});\n };\n\n /**\n * Reverts the global {@link EventEmitter} to its previous value and returns a reference to this version.\n *\n * @return {Function} Non conflicting EventEmitter class.\n */\n EventEmitter.noConflict = function noConflict() {\n exports.EventEmitter = originalGlobalValue;\n return EventEmitter;\n };\n\n // Expose the class either via AMD, CommonJS or the global object\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return EventEmitter;\n });\n }\n else if (typeof module === 'object' && module.exports){\n module.exports = EventEmitter;\n }\n else {\n exports.EventEmitter = EventEmitter;\n }\n}(typeof window !== 'undefined' ? window : this || {}));\n\n},{}]},{},[1]);\n; })();"]}
|
assets/js/script.js
CHANGED
@@ -143,12 +143,16 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
|
|
143 |
})();
|
144 |
|
145 |
},{"boxzilla":4}],2:[function(require,module,exports){
|
146 |
-
|
147 |
|
148 |
var duration = 320;
|
149 |
|
150 |
function css(element, styles) {
|
151 |
for (var property in styles) {
|
|
|
|
|
|
|
|
|
152 |
element.style[property] = styles[property];
|
153 |
}
|
154 |
}
|
@@ -188,11 +192,12 @@ function animated(element) {
|
|
188 |
*
|
189 |
* @param element
|
190 |
* @param animation Either "fade" or "slide"
|
|
|
191 |
*/
|
192 |
|
193 |
|
194 |
function toggle(element, animation, callbackFn) {
|
195 |
-
var nowVisible = element.style.display
|
196 |
|
197 |
var clone = element.cloneNode(true);
|
198 |
|
@@ -213,7 +218,8 @@ function toggle(element, animation, callbackFn) {
|
|
213 |
element.style.display = '';
|
214 |
}
|
215 |
|
216 |
-
var hiddenStyles
|
|
|
217 |
|
218 |
if (animation === 'slide') {
|
219 |
hiddenStyles = initObjectProperties(["height", "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], 0);
|
@@ -257,7 +263,11 @@ function animate(element, targetStyles, fn) {
|
|
257 |
var propSteps = {};
|
258 |
|
259 |
for (var property in targetStyles) {
|
260 |
-
|
|
|
|
|
|
|
|
|
261 |
targetStyles[property] = parseFloat(targetStyles[property]); // calculate step size & current value
|
262 |
|
263 |
var to = targetStyles[property];
|
@@ -279,11 +289,15 @@ function animate(element, targetStyles, fn) {
|
|
279 |
var done = true;
|
280 |
var step, to, increment, newValue;
|
281 |
|
282 |
-
for (var
|
283 |
-
|
284 |
-
|
|
|
|
|
|
|
|
|
285 |
increment = step * timeSinceLastTick;
|
286 |
-
newValue = currentStyles[
|
287 |
|
288 |
if (step > 0 && newValue >= to || step < 0 && newValue <= to) {
|
289 |
newValue = to;
|
@@ -292,9 +306,9 @@ function animate(element, targetStyles, fn) {
|
|
292 |
} // store new value
|
293 |
|
294 |
|
295 |
-
currentStyles[
|
296 |
-
var suffix =
|
297 |
-
element.style[
|
298 |
}
|
299 |
|
300 |
last = +new Date(); // keep going until we're done for all props
|
@@ -330,9 +344,11 @@ var defaults = {
|
|
330 |
'testMode': false,
|
331 |
'trigger': false,
|
332 |
'closable': true
|
333 |
-
}
|
334 |
-
|
335 |
-
|
|
|
|
|
336 |
/**
|
337 |
* Merge 2 objects, values of the latter overwriting the former.
|
338 |
*
|
@@ -343,14 +359,19 @@ var defaults = {
|
|
343 |
|
344 |
|
345 |
function merge(obj1, obj2) {
|
346 |
-
var obj3 = {};
|
347 |
|
348 |
for (var attrname in obj1) {
|
349 |
-
|
350 |
-
|
|
|
|
|
|
|
351 |
|
352 |
-
for (var
|
353 |
-
|
|
|
|
|
354 |
}
|
355 |
|
356 |
return obj3;
|
@@ -362,14 +383,13 @@ function merge(obj1, obj2) {
|
|
362 |
|
363 |
|
364 |
function getDocumentHeight() {
|
365 |
-
var body = document.body
|
366 |
-
|
367 |
-
|
368 |
-
return height;
|
369 |
} // Box Object
|
370 |
|
371 |
|
372 |
-
|
373 |
this.id = id; // store config values
|
374 |
|
375 |
this.config = merge(defaults, config); // store ref to overlay
|
@@ -388,27 +408,28 @@ var Box = function Box(id, config) {
|
|
388 |
this.dom(); // further initialise the box
|
389 |
|
390 |
this.events();
|
391 |
-
}
|
392 |
|
|
|
393 |
|
394 |
Box.prototype.events = function () {
|
395 |
var box = this; // attach event to "close" icon inside box
|
396 |
|
397 |
if (this.closeIcon) {
|
398 |
-
this.closeIcon.addEventListener('click', function (
|
399 |
-
|
400 |
box.dismiss();
|
401 |
});
|
402 |
}
|
403 |
|
404 |
-
this.element.addEventListener('click', function (
|
405 |
-
if (
|
406 |
-
|
407 |
}
|
408 |
}, false);
|
409 |
-
this.element.addEventListener('submit', function (
|
410 |
box.setCookie();
|
411 |
-
|
412 |
}, false);
|
413 |
}; // generate dom elements for this box
|
414 |
|
@@ -498,7 +519,7 @@ Box.prototype.toggle = function (show, animate) {
|
|
498 |
|
499 |
this.setCustomBoxStyling(); // trigger event
|
500 |
|
501 |
-
|
502 |
|
503 |
if (this.config.position === 'center') {
|
504 |
this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');
|
@@ -638,8 +659,7 @@ Box.prototype.trigger = function () {
|
|
638 |
};
|
639 |
/**
|
640 |
* Dismisses the box and optionally sets a cookie.
|
641 |
-
*
|
642 |
-
* @param e The event that triggered this dismissal.
|
643 |
* @returns {boolean}
|
644 |
*/
|
645 |
|
@@ -658,25 +678,20 @@ Box.prototype.dismiss = function (animate) {
|
|
658 |
}
|
659 |
|
660 |
this.dismissed = true;
|
661 |
-
|
662 |
return true;
|
663 |
};
|
664 |
|
665 |
-
module.exports =
|
666 |
-
Boxzilla = _Boxzilla;
|
667 |
-
return Box;
|
668 |
-
};
|
669 |
|
670 |
-
},{"./animator.js":2}],4:[function(require,module,exports){
|
671 |
'use strict';
|
672 |
|
673 |
-
var EventEmitter = require('wolfy87-eventemitter');
|
674 |
-
|
675 |
var Timer = require('./timer.js');
|
676 |
|
677 |
-
var Boxzilla =
|
678 |
|
679 |
-
var Box = require('./box.js')
|
680 |
|
681 |
var boxes = [];
|
682 |
var overlay;
|
@@ -896,7 +911,9 @@ Boxzilla.init = function () {
|
|
896 |
overlay.id = 'boxzilla-overlay';
|
897 |
document.body.appendChild(overlay); // init exit intent trigger
|
898 |
|
899 |
-
new ExitIntent(showBoxesWithExitIntentTrigger);
|
|
|
|
|
900 |
scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true);
|
901 |
scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true);
|
902 |
window.addEventListener('resize', throttle(recalculateHeights));
|
@@ -904,14 +921,15 @@ Boxzilla.init = function () {
|
|
904 |
overlay.addEventListener('click', onOverlayClick);
|
905 |
window.setInterval(checkTimeCriteria, 1000);
|
906 |
window.setTimeout(checkPageViewsCriteria, 1000);
|
907 |
-
document.addEventListener('keyup', onKeyUp);
|
908 |
-
|
909 |
-
|
|
|
|
|
910 |
window.addEventListener('beforeunload', function () {
|
911 |
timers.stop();
|
912 |
sessionStorage.setItem('boxzilla_pageviews', ++pageViews);
|
913 |
});
|
914 |
-
window.addEventListener('blur', timers.stop);
|
915 |
Boxzilla.trigger('ready');
|
916 |
initialised = true; // ensure this function doesn't run again
|
917 |
};
|
@@ -1002,13 +1020,20 @@ if (typeof module !== 'undefined' && module.exports) {
|
|
1002 |
module.exports = Boxzilla;
|
1003 |
}
|
1004 |
|
1005 |
-
},{"./box.js":3,"./
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1006 |
"use strict";
|
1007 |
|
1008 |
-
var styles = "#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:
|
1009 |
module.exports = styles;
|
1010 |
|
1011 |
-
},{}],
|
1012 |
'use strict';
|
1013 |
|
1014 |
var Timer = function Timer(start) {
|
@@ -1035,7 +1060,7 @@ Timer.prototype.stop = function () {
|
|
1035 |
|
1036 |
module.exports = Timer;
|
1037 |
|
1038 |
-
},{}],
|
1039 |
'use strict';
|
1040 |
|
1041 |
module.exports = function (callback) {
|
@@ -1120,9 +1145,9 @@ module.exports = function (callback) {
|
|
1120 |
document.documentElement.addEventListener('click', clearTimeout);
|
1121 |
};
|
1122 |
|
1123 |
-
},{}],
|
1124 |
/*!
|
1125 |
-
* EventEmitter v5.2.
|
1126 |
* Unlicense - http://unlicense.org/
|
1127 |
* Oliver Caldwell - https://oli.me.uk/
|
1128 |
* @preserve
|
143 |
})();
|
144 |
|
145 |
},{"boxzilla":4}],2:[function(require,module,exports){
|
146 |
+
'use strict';
|
147 |
|
148 |
var duration = 320;
|
149 |
|
150 |
function css(element, styles) {
|
151 |
for (var property in styles) {
|
152 |
+
if (!styles.hasOwnProperty(property)) {
|
153 |
+
continue;
|
154 |
+
}
|
155 |
+
|
156 |
element.style[property] = styles[property];
|
157 |
}
|
158 |
}
|
192 |
*
|
193 |
* @param element
|
194 |
* @param animation Either "fade" or "slide"
|
195 |
+
* @param callbackFn
|
196 |
*/
|
197 |
|
198 |
|
199 |
function toggle(element, animation, callbackFn) {
|
200 |
+
var nowVisible = element.style.display !== 'none' || element.offsetLeft > 0; // create clone for reference
|
201 |
|
202 |
var clone = element.cloneNode(true);
|
203 |
|
218 |
element.style.display = '';
|
219 |
}
|
220 |
|
221 |
+
var hiddenStyles;
|
222 |
+
var visibleStyles; // animate properties
|
223 |
|
224 |
if (animation === 'slide') {
|
225 |
hiddenStyles = initObjectProperties(["height", "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom"], 0);
|
263 |
var propSteps = {};
|
264 |
|
265 |
for (var property in targetStyles) {
|
266 |
+
if (!targetStyles.hasOwnProperty(property)) {
|
267 |
+
continue;
|
268 |
+
} // make sure we have an object filled with floats
|
269 |
+
|
270 |
+
|
271 |
targetStyles[property] = parseFloat(targetStyles[property]); // calculate step size & current value
|
272 |
|
273 |
var to = targetStyles[property];
|
289 |
var done = true;
|
290 |
var step, to, increment, newValue;
|
291 |
|
292 |
+
for (var _property in targetStyles) {
|
293 |
+
if (!targetStyles.hasOwnProperty(_property)) {
|
294 |
+
continue;
|
295 |
+
}
|
296 |
+
|
297 |
+
step = propSteps[_property];
|
298 |
+
to = targetStyles[_property];
|
299 |
increment = step * timeSinceLastTick;
|
300 |
+
newValue = currentStyles[_property] + increment;
|
301 |
|
302 |
if (step > 0 && newValue >= to || step < 0 && newValue <= to) {
|
303 |
newValue = to;
|
306 |
} // store new value
|
307 |
|
308 |
|
309 |
+
currentStyles[_property] = newValue;
|
310 |
+
var suffix = _property !== "opacity" ? "px" : "";
|
311 |
+
element.style[_property] = newValue + suffix;
|
312 |
}
|
313 |
|
314 |
last = +new Date(); // keep going until we're done for all props
|
344 |
'testMode': false,
|
345 |
'trigger': false,
|
346 |
'closable': true
|
347 |
+
};
|
348 |
+
|
349 |
+
var events = require('./events.js');
|
350 |
+
|
351 |
+
var Animator = require('./animator.js');
|
352 |
/**
|
353 |
* Merge 2 objects, values of the latter overwriting the former.
|
354 |
*
|
359 |
|
360 |
|
361 |
function merge(obj1, obj2) {
|
362 |
+
var obj3 = {}; // add obj1 to obj3
|
363 |
|
364 |
for (var attrname in obj1) {
|
365 |
+
if (obj1.hasOwnProperty(attrname)) {
|
366 |
+
obj3[attrname] = obj1[attrname];
|
367 |
+
}
|
368 |
+
} // add obj2 to obj3
|
369 |
+
|
370 |
|
371 |
+
for (var _attrname in obj2) {
|
372 |
+
if (obj2.hasOwnProperty(_attrname)) {
|
373 |
+
obj3[_attrname] = obj2[_attrname];
|
374 |
+
}
|
375 |
}
|
376 |
|
377 |
return obj3;
|
383 |
|
384 |
|
385 |
function getDocumentHeight() {
|
386 |
+
var body = document.body;
|
387 |
+
var html = document.documentElement;
|
388 |
+
return Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
|
|
|
389 |
} // Box Object
|
390 |
|
391 |
|
392 |
+
function Box(id, config) {
|
393 |
this.id = id; // store config values
|
394 |
|
395 |
this.config = merge(defaults, config); // store ref to overlay
|
408 |
this.dom(); // further initialise the box
|
409 |
|
410 |
this.events();
|
411 |
+
}
|
412 |
|
413 |
+
; // initialise the box
|
414 |
|
415 |
Box.prototype.events = function () {
|
416 |
var box = this; // attach event to "close" icon inside box
|
417 |
|
418 |
if (this.closeIcon) {
|
419 |
+
this.closeIcon.addEventListener('click', function (evt) {
|
420 |
+
evt.preventDefault();
|
421 |
box.dismiss();
|
422 |
});
|
423 |
}
|
424 |
|
425 |
+
this.element.addEventListener('click', function (evt) {
|
426 |
+
if (evt.target.tagName === 'A') {
|
427 |
+
events.trigger('box.interactions.link', [box, evt.target]);
|
428 |
}
|
429 |
}, false);
|
430 |
+
this.element.addEventListener('submit', function (evt) {
|
431 |
box.setCookie();
|
432 |
+
events.trigger('box.interactions.form', [box, evt.target]);
|
433 |
}, false);
|
434 |
}; // generate dom elements for this box
|
435 |
|
519 |
|
520 |
this.setCustomBoxStyling(); // trigger event
|
521 |
|
522 |
+
events.trigger('box.' + (show ? 'show' : 'hide'), [this]); // show or hide box using selected animation
|
523 |
|
524 |
if (this.config.position === 'center') {
|
525 |
this.overlay.classList.toggle('boxzilla-' + this.id + '-overlay');
|
659 |
};
|
660 |
/**
|
661 |
* Dismisses the box and optionally sets a cookie.
|
662 |
+
* @param animate
|
|
|
663 |
* @returns {boolean}
|
664 |
*/
|
665 |
|
678 |
}
|
679 |
|
680 |
this.dismissed = true;
|
681 |
+
events.trigger('box.dismiss', [this]);
|
682 |
return true;
|
683 |
};
|
684 |
|
685 |
+
module.exports = Box;
|
|
|
|
|
|
|
686 |
|
687 |
+
},{"./animator.js":2,"./events.js":5}],4:[function(require,module,exports){
|
688 |
'use strict';
|
689 |
|
|
|
|
|
690 |
var Timer = require('./timer.js');
|
691 |
|
692 |
+
var Boxzilla = require('./events.js');
|
693 |
|
694 |
+
var Box = require('./box.js');
|
695 |
|
696 |
var boxes = [];
|
697 |
var overlay;
|
911 |
overlay.id = 'boxzilla-overlay';
|
912 |
document.body.appendChild(overlay); // init exit intent trigger
|
913 |
|
914 |
+
new ExitIntent(showBoxesWithExitIntentTrigger); // start timers
|
915 |
+
|
916 |
+
timers.start();
|
917 |
scrollElement.addEventListener('touchstart', throttle(checkHeightCriteria), true);
|
918 |
scrollElement.addEventListener('scroll', throttle(checkHeightCriteria), true);
|
919 |
window.addEventListener('resize', throttle(recalculateHeights));
|
921 |
overlay.addEventListener('click', onOverlayClick);
|
922 |
window.setInterval(checkTimeCriteria, 1000);
|
923 |
window.setTimeout(checkPageViewsCriteria, 1000);
|
924 |
+
document.addEventListener('keyup', onKeyUp); // stop timers when leaving page or switching to other tab
|
925 |
+
|
926 |
+
document.addEventListener("visibilitychange", function () {
|
927 |
+
document.hidden ? timers.stop() : timers.start();
|
928 |
+
});
|
929 |
window.addEventListener('beforeunload', function () {
|
930 |
timers.stop();
|
931 |
sessionStorage.setItem('boxzilla_pageviews', ++pageViews);
|
932 |
});
|
|
|
933 |
Boxzilla.trigger('ready');
|
934 |
initialised = true; // ensure this function doesn't run again
|
935 |
};
|
1020 |
module.exports = Boxzilla;
|
1021 |
}
|
1022 |
|
1023 |
+
},{"./box.js":3,"./events.js":5,"./styles.js":6,"./timer.js":7,"./triggers/exit-intent.js":8}],5:[function(require,module,exports){
|
1024 |
+
'use strict';
|
1025 |
+
|
1026 |
+
var EventEmitter = require('wolfy87-eventemitter');
|
1027 |
+
|
1028 |
+
module.exports = Object.create(EventEmitter.prototype);
|
1029 |
+
|
1030 |
+
},{"wolfy87-eventemitter":9}],6:[function(require,module,exports){
|
1031 |
"use strict";
|
1032 |
|
1033 |
+
var styles = "#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-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}";
|
1034 |
module.exports = styles;
|
1035 |
|
1036 |
+
},{}],7:[function(require,module,exports){
|
1037 |
'use strict';
|
1038 |
|
1039 |
var Timer = function Timer(start) {
|
1060 |
|
1061 |
module.exports = Timer;
|
1062 |
|
1063 |
+
},{}],8:[function(require,module,exports){
|
1064 |
'use strict';
|
1065 |
|
1066 |
module.exports = function (callback) {
|
1145 |
document.documentElement.addEventListener('click', clearTimeout);
|
1146 |
};
|
1147 |
|
1148 |
+
},{}],9:[function(require,module,exports){
|
1149 |
/*!
|
1150 |
+
* EventEmitter v5.2.8 - git.io/ee
|
1151 |
* Unlicense - http://unlicense.org/
|
1152 |
* Oliver Caldwell - https://oli.me.uk/
|
1153 |
* @preserve
|
assets/js/script.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
!function(){var l=void 0;!function r(s,l,c){function a(e,t){if(!l[e]){if(!s[e]){var i=!1;if(!t&&i)return i(e,!0);if(d)return d(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var o=l[e]={exports:{}};s[e][0].call(o.exports,function(t){return a(s[e][1][t]||t)},o,o.exports,r,s,l,c)}return l[e].exports}for(var d=!1,t=0;t<c.length;t++)a(c[t]);return a}({1:[function(t,e,i){"use strict";function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var s=t("boxzilla"),l=window.boxzilla_options;function c(t){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.match(/[#&](boxzilla-\d+)/);if(!e||"object"!==d(e)||e.length<2)return!1;var i=e[1];return i===t.element.id||!!t.element.querySelector("#"+i)}window.Boxzilla=s;var a=-1<document.body.className.indexOf("logged-in");a&&l.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),s.init(),window.addEventListener("load",function(){if(!l.inited){for(var t in l.boxes){var e=l.boxes[t];e.testMode=a&&l.testMode;var i=document.getElementById("boxzilla-box-"+e.id+"-content");if(i){e.content=i;var n=s.create(e.id,e);n.element.className=n.element.className+" boxzilla-"+e.post.slug,o=n.element,(r=e.css).background_color&&(o.style.background=r.background_color),r.color&&(o.style.color=r.color),r.border_color&&(o.style.borderColor=r.border_color),r.border_width&&(o.style.borderWidth=parseInt(r.border_width)+"px"),r.border_style&&(o.style.borderStyle=r.border_style),r.width&&(o.style.maxWidth=parseInt(r.width)+"px");try{n.element.firstChild.firstChild.className+=" first-child",n.element.firstChild.lastChild.className+=" last-child"}catch(t){}n.fits()&&c(n)&&n.show()}}var o,r;l.inited=!0,s.trigger("done"),function(){if("object"!==d(window.mc4wp_forms_config)||!window.mc4wp_forms_config.submitted_form)return;var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=s.boxes;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n.element.querySelector(t))return n.show()}}()}})}()},{boxzilla:4}],2:[function(t,e,i){"use strict";var o=320;function a(t,e){for(var i in e)t.style[i]=e[i]}function d(a,d,u){var h=+new Date,t=window.getComputedStyle(a),f={},g={};for(var e in d){d[e]=parseFloat(d[e]);var i=d[e],n=parseFloat(t[e]);n!=i?(g[e]=(i-n)/o,f[e]=n):delete d[e]}!function t(){var e,i,n,o,r=+new Date-h,s=!0;for(var l in d){e=g[l],i=d[l],n=e*r,o=f[l]+n,0<e&&i<=o||e<0&&o<=i?o=i:s=!1,f[l]=o;var c="opacity"!==l?"px":"";a.style[l]=o+c}h=+new Date,s?u&&u():window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,32)}()}e.exports={toggle:function(t,e,i){function n(){t.removeAttribute("data-animated"),t.setAttribute("style",l.getAttribute("style")),t.style.display=s?"none":"",i&&i()}var o,r,s="none"!=t.style.display||0<t.offsetLeft,l=t.cloneNode(!0);if(t.setAttribute("data-animated","true"),s||(t.style.display=""),"slide"===e){if(o=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),r={},!s){if(r=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],window.getComputedStyle(t)),!isFinite(r.height)){var c=t.getBoundingClientRect();r.height=c.height}a(t,o)}t.style.overflowY="hidden",d(t,s?o:r,n)}else o={opacity:0},r={opacity:1},s||a(t,o),d(t,s?o:r,n)},animate:d,animated:function(t){return!!t.getAttribute("data-animated")}}},{}],3:[function(t,e,i){"use strict";var n,o={animation:"fade",rehide:!1,content:"",cookie:null,icon:"×",screenWidthCondition:null,position:"center",testMode:!1,trigger:!1,closable:!0},r=t("./animator.js");function s(t,e){this.id=t,this.config=function(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i}(o,e),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()}s.prototype.events=function(){var e=this;this.closeIcon&&this.closeIcon.addEventListener("click",function(t){t.preventDefault(),e.dismiss()}),this.element.addEventListener("click",function(t){"A"===t.target.tagName&&n.trigger("box.interactions.link",[e,t.target])},!1),this.element.addEventListener("submit",function(t){e.setCookie(),n.trigger("box.interactions.form",[e,t.target])},!1)},s.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e,i=document.createElement("div");if(i.setAttribute("id","boxzilla-"+this.id),i.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,i.style.display="none",t.appendChild(i),"string"==typeof this.config.content?(e=document.createElement("div")).innerHTML=this.config.content:(e=this.config.content).style.display="",e.className="boxzilla-content",i.appendChild(e),this.config.closable&&this.config.icon){var n=document.createElement("span");n.className="boxzilla-close-icon",n.innerHTML=this.config.icon,i.appendChild(n),this.closeIcon=n}document.body.appendChild(t),this.contentElement=e,this.element=i},s.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="auto",this.element.style.maxHeight="none";var e=window.innerHeight,i=this.element.clientHeight;if(e<i&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(e-i)/2;n=0<=n?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=t},s.prototype.toggle=function(t,e){return e=void 0===e||e,(t=void 0===t?!this.visible:t)!==this.visible&&(!r.animated(this.element)&&(!(!t&&!this.config.closable)&&(this.visible=t,this.setCustomBoxStyling(),n.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),e?r.toggle(this.overlay,"fade"):this.overlay.style.display=t?"":"none"),e?r.toggle(this.element,this.config.animation,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)):this.element.style.display=t?"":"none",!0)))},s.prototype.show=function(t){return this.toggle(!0,t)},s.prototype.hide=function(t){return this.toggle(!1,t)},s.prototype.calculateTriggerHeight=function(){var t=0;if(this.config.trigger)if("element"===this.config.trigger.method){var e=document.body.querySelector(this.config.trigger.value);if(e)t=e.getBoundingClientRect().top}else"percentage"===this.config.trigger.method&&(t=this.config.trigger.value/100*function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}());return t},s.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},s.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},s.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},s.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},s.prototype.isCookieSet=function(){return!(this.config.testMode||!this.config.trigger)&&(!(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)&&"true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))},s.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},s.prototype.trigger=function(){this.show()&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},s.prototype.dismiss=function(t){return!!this.visible&&(this.hide(t),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,n.trigger("box.dismiss",[this]),!0)},e.exports=function(t){return n=t,s}},{"./animator.js":2}],4:[function(t,e,i){"use strict";var n,o,r,s,l=t("wolfy87-eventemitter"),c=t("./timer.js"),a=Object.create(l.prototype),d=t("./box.js")(a),u=[],h=window,f=!1,g=t("./styles.js"),m=t("./triggers/exit-intent.js");function p(n,o,r){var s,l;return o=o||250,function(){var t=r||this,e=+new Date,i=arguments;s&&e<s+o?(clearTimeout(l),l=setTimeout(function(){s=e,n.apply(t,i)},o)):(s=e,n.apply(t,i))}}function v(t){27===t.keyCode&&a.dismiss()}function y(){z()||u.forEach(function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&s>=t.config.trigger.value&&t.trigger()})}function b(){z()||u.forEach(function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&o.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&r.time>=t.config.trigger.value&&t.trigger())})}function w(){var e=h.hasOwnProperty("pageYOffset")?h.pageYOffset:h.scrollTop;e+=.9*window.innerHeight,u.forEach(function(t){if(t.mayAutoShow()&&!(t.triggerHeight<=0)){if(e>t.triggerHeight){if(z())return;t.trigger()}t.mayRehide()&&e<t.triggerHeight-5&&t.hide()}})}function x(){u.forEach(function(t){t.onResize()})}function E(t){var i=t.offsetX,n=t.offsetY;u.forEach(function(t){var e=t.element.getBoundingClientRect();(i<e.left-40||i>e.right+40||n<e.top-40||n>e.bottom+40)&&t.dismiss()})}function L(){z()||u.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()})}function z(){return 0<u.filter(function(t){return t.visible}).length}function _(t){for(var e=t.target||t.srcElement,i=0;i<=3&&(e&&"A"!==e.tagName);i++)e=e.parentElement;if(e&&"A"===e.tagName&&e.getAttribute("href")){var n=e.getAttribute("href").toLowerCase().match(/[#&]boxzilla-(\d+)/);if(n&&1<n.length){var o=n[1];a.toggle(o)}}}var k=function(){try{var t=sessionStorage.getItem("boxzilla_timer");t&&(o.time=t)}catch(t){}o.start(),r.start()},C=function(){sessionStorage.setItem("boxzilla_timer",o.time),o.stop(),r.stop()};a.init=function(){if(!f){document.body.addEventListener("click",_,!0);try{s=sessionStorage.getItem("boxzilla_pageviews")||0}catch(t){s=0}o=new c(0),r=new c(0);var t=document.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=g,document.head.appendChild(t),(n=document.createElement("div")).style.display="none",n.id="boxzilla-overlay",document.body.appendChild(n),new m(L),h.addEventListener("touchstart",p(w),!0),h.addEventListener("scroll",p(w),!0),window.addEventListener("resize",p(x)),window.addEventListener("load",x),n.addEventListener("click",E),window.setInterval(b,1e3),window.setTimeout(y,1e3),document.addEventListener("keyup",v),k(),window.addEventListener("focus",k),window.addEventListener("beforeunload",function(){C(),sessionStorage.setItem("boxzilla_pageviews",++s)}),window.addEventListener("blur",C),a.trigger("ready"),f=!0}},a.create=function(t,e){void 0!==e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new d(t,e);return u.push(i),i},a.get=function(t){for(var e=0;e<u.length;e++){var i=u[e];if(i.id==t)return i}throw new Error("No box exists with ID "+t)},a.dismiss=function(t,e){t?a.get(t).dismiss(e):u.forEach(function(t){t.dismiss(e)})},a.hide=function(t,e){t?a.get(t).hide(e):u.forEach(function(t){t.hide(e)})},a.show=function(t,e){t?a.get(t).show(e):u.forEach(function(t){t.show(e)})},a.toggle=function(t,e){t?a.get(t).toggle(e):u.forEach(function(t){t.toggle(e)})},a.boxes=u,window.Boxzilla=a,void 0!==e&&e.exports&&(e.exports=a)},{"./box.js":3,"./styles.js":5,"./timer.js":6,"./triggers/exit-intent.js":7,"wolfy87-eventemitter":8}],5:[function(t,e,i){"use strict";e.exports="#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:99999}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:999999;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:999999;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"},{}],6:[function(t,e,i){"use strict";function n(t){this.time=t,this.interval=0}n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}],7:[function(t,e,i){"use strict";e.exports=function(t){var e=null,i={};function n(){document.documentElement.removeEventListener("mouseleave",s),document.documentElement.removeEventListener("mouseenter",r),document.documentElement.removeEventListener("click",o),window.removeEventListener("touchstart",l),window.removeEventListener("touchend",c),t()}function o(){null!==e&&(window.clearTimeout(e),e=null)}function r(t){o()}function s(t){o(),t.clientY<=(document.documentMode||/Edge\//.test(navigator.userAgent)?5:0)&&t.clientX<.8*window.innerWidth&&(e=window.setTimeout(n,400))}function l(t){o(),i={timestamp:performance.now(),scrollY:window.scrollY,windowHeight:window.innerHeight}}function c(t){o(),window.innerHeight>i.windowHeight||window.scrollY+20>=i.scrollY||300<performance.now()-i.timestamp||-1<["A","INPUT","BUTTON"].indexOf(t.target.tagName)||(e=window.setTimeout(n,800))}window.addEventListener("touchstart",l),window.addEventListener("touchend",c),document.documentElement.addEventListener("mouseenter",r),document.documentElement.addEventListener("mouseleave",s),document.documentElement.addEventListener("click",o)}},{}],8:[function(t,s,e){!function(t){"use strict";function e(){}var i=e.prototype,n=t.EventEmitter;function r(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)}}i.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp)for(i in e={},n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i]);else e=n[t]||(n[t]=[]);return e},i.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},i.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},i.addListener=function(t,e){if(!function t(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&t(e.listener)}(e))throw new TypeError("listener must be a function");var i,n=this.getListenersAsObject(t),o="object"==typeof e;for(i in n)n.hasOwnProperty(i)&&-1===r(n[i],e)&&n[i].push(o?e:{listener:e,once:!1});return this},i.on=o("addListener"),i.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},i.once=o("addOnceListener"),i.defineEvent=function(t){return this.getListeners(t),this},i.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},i.removeListener=function(t,e){var i,n,o=this.getListenersAsObject(t);for(n in o)o.hasOwnProperty(n)&&-1!==(i=r(o[n],e))&&o[n].splice(i,1);return this},i.off=o("removeListener"),i.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},i.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},i.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},i.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"==i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},i.removeAllListeners=o("removeEvent"),i.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].slice(0),o=0;o<i.length;o++)!0===(n=i[o]).once&&this.removeListener(t,n.listener),n.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},i.trigger=o("emitEvent"),i.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},i.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return t.EventEmitter=n,e},"function"==typeof l&&l.amd?l(function(){return e}):"object"==typeof s&&s.exports?s.exports=e:t.EventEmitter=e}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
|
2 |
//# sourceMappingURL=script.min.js.map
|
1 |
+
!function(){var l=void 0;!function r(s,l,c){function a(e,t){if(!l[e]){if(!s[e]){var i=!1;if(!t&&i)return i(e,!0);if(d)return d(e,!0);var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}var o=l[e]={exports:{}};s[e][0].call(o.exports,function(t){return a(s[e][1][t]||t)},o,o.exports,r,s,l,c)}return l[e].exports}for(var d=!1,t=0;t<c.length;t++)a(c[t]);return a}({1:[function(t,e,i){"use strict";function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var s=t("boxzilla"),l=window.boxzilla_options;function c(t){if(!window.location.hash||0===window.location.hash.length)return!1;var e=window.location.hash.match(/[#&](boxzilla-\d+)/);if(!e||"object"!==d(e)||e.length<2)return!1;var i=e[1];return i===t.element.id||!!t.element.querySelector("#"+i)}window.Boxzilla=s;var a=-1<document.body.className.indexOf("logged-in");a&&l.testMode&&console.log("Boxzilla: Test mode is enabled. Please disable test mode if you're done testing."),s.init(),window.addEventListener("load",function(){if(!l.inited){for(var t in l.boxes){var e=l.boxes[t];e.testMode=a&&l.testMode;var i=document.getElementById("boxzilla-box-"+e.id+"-content");if(i){e.content=i;var n=s.create(e.id,e);n.element.className=n.element.className+" boxzilla-"+e.post.slug,o=n.element,(r=e.css).background_color&&(o.style.background=r.background_color),r.color&&(o.style.color=r.color),r.border_color&&(o.style.borderColor=r.border_color),r.border_width&&(o.style.borderWidth=parseInt(r.border_width)+"px"),r.border_style&&(o.style.borderStyle=r.border_style),r.width&&(o.style.maxWidth=parseInt(r.width)+"px");try{n.element.firstChild.firstChild.className+=" first-child",n.element.firstChild.lastChild.className+=" last-child"}catch(t){}n.fits()&&c(n)&&n.show()}}var o,r;l.inited=!0,s.trigger("done"),function(){if("object"!==d(window.mc4wp_forms_config)||!window.mc4wp_forms_config.submitted_form)return;var t="#"+window.mc4wp_forms_config.submitted_form.element_id,e=s.boxes;for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];if(n.element.querySelector(t))return n.show()}}()}})}()},{boxzilla:4}],2:[function(t,e,i){"use strict";var o=320;function a(t,e){for(var i in e)e.hasOwnProperty(i)&&(t.style[i]=e[i])}function d(a,d,h){var u=+new Date,t=window.getComputedStyle(a),f={},g={};for(var e in d)if(d.hasOwnProperty(e)){d[e]=parseFloat(d[e]);var i=d[e],n=parseFloat(t[e]);n!=i?(g[e]=(i-n)/o,f[e]=n):delete d[e]}!function t(){var e,i,n,o,r=+new Date-u,s=!0;for(var l in d)if(d.hasOwnProperty(l)){e=g[l],i=d[l],n=e*r,o=f[l]+n,0<e&&i<=o||e<0&&o<=i?o=i:s=!1,f[l]=o;var c="opacity"!==l?"px":"";a.style[l]=o+c}u=+new Date,s?h&&h():window.requestAnimationFrame&&requestAnimationFrame(t)||setTimeout(t,32)}()}e.exports={toggle:function(t,e,i){function n(){t.removeAttribute("data-animated"),t.setAttribute("style",l.getAttribute("style")),t.style.display=s?"none":"",i&&i()}var o,r,s="none"!==t.style.display||0<t.offsetLeft,l=t.cloneNode(!0);if(t.setAttribute("data-animated","true"),s||(t.style.display=""),"slide"===e){if(o=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e;return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],0),r={},!s){if(r=function(t,e){for(var i={},n=0;n<t.length;n++)i[t[n]]=e[t[n]];return i}(["height","borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],window.getComputedStyle(t)),!isFinite(r.height)){var c=t.getBoundingClientRect();r.height=c.height}a(t,o)}t.style.overflowY="hidden",d(t,s?o:r,n)}else o={opacity:0},r={opacity:1},s||a(t,o),d(t,s?o:r,n)},animate:d,animated:function(t){return!!t.getAttribute("data-animated")}}},{}],3:[function(t,e,i){"use strict";var n={animation:"fade",rehide:!1,content:"",cookie:null,icon:"×",screenWidthCondition:null,position:"center",testMode:!1,trigger:!1,closable:!0},o=t("./events.js"),r=t("./animator.js");function s(t,e){this.id=t,this.config=function(t,e){var i={};for(var n in t)t.hasOwnProperty(n)&&(i[n]=t[n]);for(var o in e)e.hasOwnProperty(o)&&(i[o]=e[o]);return i}(n,e),this.overlay=document.getElementById("boxzilla-overlay"),this.visible=!1,this.dismissed=!1,this.triggered=!1,this.triggerHeight=this.calculateTriggerHeight(),this.cookieSet=this.isCookieSet(),this.element=null,this.contentElement=null,this.closeIcon=null,this.dom(),this.events()}s.prototype.events=function(){var e=this;this.closeIcon&&this.closeIcon.addEventListener("click",function(t){t.preventDefault(),e.dismiss()}),this.element.addEventListener("click",function(t){"A"===t.target.tagName&&o.trigger("box.interactions.link",[e,t.target])},!1),this.element.addEventListener("submit",function(t){e.setCookie(),o.trigger("box.interactions.form",[e,t.target])},!1)},s.prototype.dom=function(){var t=document.createElement("div");t.className="boxzilla-container boxzilla-"+this.config.position+"-container";var e,i=document.createElement("div");if(i.setAttribute("id","boxzilla-"+this.id),i.className="boxzilla boxzilla-"+this.id+" boxzilla-"+this.config.position,i.style.display="none",t.appendChild(i),"string"==typeof this.config.content?(e=document.createElement("div")).innerHTML=this.config.content:(e=this.config.content).style.display="",e.className="boxzilla-content",i.appendChild(e),this.config.closable&&this.config.icon){var n=document.createElement("span");n.className="boxzilla-close-icon",n.innerHTML=this.config.icon,i.appendChild(n),this.closeIcon=n}document.body.appendChild(t),this.contentElement=e,this.element=i},s.prototype.setCustomBoxStyling=function(){var t=this.element.style.display;this.element.style.display="",this.element.style.overflowY="auto",this.element.style.maxHeight="none";var e=window.innerHeight,i=this.element.clientHeight;if(e<i&&(this.element.style.maxHeight=e+"px",this.element.style.overflowY="scroll"),"center"===this.config.position){var n=(e-i)/2;n=0<=n?n:0,this.element.style.marginTop=n+"px"}this.element.style.display=t},s.prototype.toggle=function(t,e){return e=void 0===e||e,(t=void 0===t?!this.visible:t)!==this.visible&&(!r.animated(this.element)&&(!(!t&&!this.config.closable)&&(this.visible=t,this.setCustomBoxStyling(),o.trigger("box."+(t?"show":"hide"),[this]),"center"===this.config.position&&(this.overlay.classList.toggle("boxzilla-"+this.id+"-overlay"),e?r.toggle(this.overlay,"fade"):this.overlay.style.display=t?"":"none"),e?r.toggle(this.element,this.config.animation,function(){this.visible||(this.contentElement.innerHTML=this.contentElement.innerHTML)}.bind(this)):this.element.style.display=t?"":"none",!0)))},s.prototype.show=function(t){return this.toggle(!0,t)},s.prototype.hide=function(t){return this.toggle(!1,t)},s.prototype.calculateTriggerHeight=function(){var t=0;if(this.config.trigger)if("element"===this.config.trigger.method){var e=document.body.querySelector(this.config.trigger.value);if(e)t=e.getBoundingClientRect().top}else"percentage"===this.config.trigger.method&&(t=this.config.trigger.value/100*function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}());return t},s.prototype.fits=function(){if(!this.config.screenWidthCondition||!this.config.screenWidthCondition.value)return!0;switch(this.config.screenWidthCondition.condition){case"larger":return window.innerWidth>this.config.screenWidthCondition.value;case"smaller":return window.innerWidth<this.config.screenWidthCondition.value}return!0},s.prototype.onResize=function(){this.triggerHeight=this.calculateTriggerHeight(),this.setCustomBoxStyling()},s.prototype.mayAutoShow=function(){return!this.dismissed&&(!!this.fits()&&(!!this.config.trigger&&!this.cookieSet))},s.prototype.mayRehide=function(){return this.config.rehide&&this.triggered},s.prototype.isCookieSet=function(){return!(this.config.testMode||!this.config.trigger)&&(!(!this.config.cookie||!this.config.cookie.triggered&&!this.config.cookie.dismissed)&&"true"===document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*boxzilla_box_"+this.id+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))},s.prototype.setCookie=function(t){var e=new Date;e.setHours(e.getHours()+t),document.cookie="boxzilla_box_"+this.id+"=true; expires="+e.toUTCString()+"; path=/"},s.prototype.trigger=function(){this.show()&&(this.triggered=!0,this.config.cookie&&this.config.cookie.triggered&&this.setCookie(this.config.cookie.triggered))},s.prototype.dismiss=function(t){return!!this.visible&&(this.hide(t),this.config.cookie&&this.config.cookie.dismissed&&this.setCookie(this.config.cookie.dismissed),this.dismissed=!0,o.trigger("box.dismiss",[this]),!0)},e.exports=s},{"./animator.js":2,"./events.js":5}],4:[function(t,e,i){"use strict";var n,o,r,s,l=t("./timer.js"),c=t("./events.js"),a=t("./box.js"),d=[],h=window,u=!1,f=t("./styles.js"),g=t("./triggers/exit-intent.js");function m(n,o,r){var s,l;return o=o||250,function(){var t=r||this,e=+new Date,i=arguments;s&&e<s+o?(clearTimeout(l),l=setTimeout(function(){s=e,n.apply(t,i)},o)):(s=e,n.apply(t,i))}}function p(t){27===t.keyCode&&c.dismiss()}function v(){L()||d.forEach(function(t){t.mayAutoShow()&&"pageviews"===t.config.trigger.method&&s>=t.config.trigger.value&&t.trigger()})}function y(){L()||d.forEach(function(t){t.mayAutoShow()&&("time_on_site"===t.config.trigger.method&&o.time>=t.config.trigger.value&&t.trigger(),"time_on_page"===t.config.trigger.method&&r.time>=t.config.trigger.value&&t.trigger())})}function w(){var e=h.hasOwnProperty("pageYOffset")?h.pageYOffset:h.scrollTop;e+=.9*window.innerHeight,d.forEach(function(t){if(t.mayAutoShow()&&!(t.triggerHeight<=0)){if(e>t.triggerHeight){if(L())return;t.trigger()}t.mayRehide()&&e<t.triggerHeight-5&&t.hide()}})}function b(){d.forEach(function(t){t.onResize()})}function x(t){var i=t.offsetX,n=t.offsetY;d.forEach(function(t){var e=t.element.getBoundingClientRect();(i<e.left-40||i>e.right+40||n<e.top-40||n>e.bottom+40)&&t.dismiss()})}function E(){L()||d.forEach(function(t){t.mayAutoShow()&&"exit_intent"===t.config.trigger.method&&t.trigger()})}function L(){return 0<d.filter(function(t){return t.visible}).length}function z(t){for(var e=t.target||t.srcElement,i=0;i<=3&&(e&&"A"!==e.tagName);i++)e=e.parentElement;if(e&&"A"===e.tagName&&e.getAttribute("href")){var n=e.getAttribute("href").toLowerCase().match(/[#&]boxzilla-(\d+)/);if(n&&1<n.length){var o=n[1];c.toggle(o)}}}var _=function(){try{var t=sessionStorage.getItem("boxzilla_timer");t&&(o.time=t)}catch(t){}o.start(),r.start()},k=function(){sessionStorage.setItem("boxzilla_timer",o.time),o.stop(),r.stop()};c.init=function(){if(!u){document.body.addEventListener("click",z,!0);try{s=sessionStorage.getItem("boxzilla_pageviews")||0}catch(t){s=0}o=new l(0),r=new l(0);var t=document.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=f,document.head.appendChild(t),(n=document.createElement("div")).style.display="none",n.id="boxzilla-overlay",document.body.appendChild(n),new g(E),_(),h.addEventListener("touchstart",m(w),!0),h.addEventListener("scroll",m(w),!0),window.addEventListener("resize",m(b)),window.addEventListener("load",b),n.addEventListener("click",x),window.setInterval(y,1e3),window.setTimeout(v,1e3),document.addEventListener("keyup",p),document.addEventListener("visibilitychange",function(){document.hidden?k():_()}),window.addEventListener("beforeunload",function(){k(),sessionStorage.setItem("boxzilla_pageviews",++s)}),c.trigger("ready"),u=!0}},c.create=function(t,e){void 0!==e.minimumScreenWidth&&(e.screenWidthCondition={condition:"larger",value:e.minimumScreenWidth});var i=new a(t,e);return d.push(i),i},c.get=function(t){for(var e=0;e<d.length;e++){var i=d[e];if(i.id==t)return i}throw new Error("No box exists with ID "+t)},c.dismiss=function(t,e){t?c.get(t).dismiss(e):d.forEach(function(t){t.dismiss(e)})},c.hide=function(t,e){t?c.get(t).hide(e):d.forEach(function(t){t.hide(e)})},c.show=function(t,e){t?c.get(t).show(e):d.forEach(function(t){t.show(e)})},c.toggle=function(t,e){t?c.get(t).toggle(e):d.forEach(function(t){t.toggle(e)})},c.boxes=d,window.Boxzilla=c,void 0!==e&&e.exports&&(e.exports=c)},{"./box.js":3,"./events.js":5,"./styles.js":6,"./timer.js":7,"./triggers/exit-intent.js":8}],5:[function(t,e,i){"use strict";var n=t("wolfy87-eventemitter");e.exports=Object.create(n.prototype)},{"wolfy87-eventemitter":9}],6:[function(t,e,i){"use strict";e.exports="#boxzilla-overlay{position:fixed;background:rgba(0,0,0,.65);width:100%;height:100%;left:0;top:0;z-index:10000}.boxzilla-center-container{position:fixed;top:0;left:0;right:0;height:0;text-align:center;z-index:11000;line-height:0}.boxzilla-center-container .boxzilla{display:inline-block;text-align:left;position:relative;line-height:normal}.boxzilla{position:fixed;z-index:12000;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;background:#fff;padding:25px}.boxzilla.boxzilla-top-left{top:0;left:0}.boxzilla.boxzilla-top-right{top:0;right:0}.boxzilla.boxzilla-bottom-left{bottom:0;left:0}.boxzilla.boxzilla-bottom-right{bottom:0;right:0}.boxzilla-content>:first-child{margin-top:0;padding-top:0}.boxzilla-content>:last-child{margin-bottom:0;padding-bottom:0}.boxzilla-close-icon{position:absolute;right:0;top:0;text-align:center;padding:6px;cursor:pointer;-webkit-appearance:none;font-size:28px;font-weight:700;line-height:20px;color:#000;opacity:.5}.boxzilla-close-icon:focus,.boxzilla-close-icon:hover{opacity:.8}"},{}],7:[function(t,e,i){"use strict";function n(t){this.time=t,this.interval=0}n.prototype.tick=function(){this.time++},n.prototype.start=function(){this.interval||(this.interval=window.setInterval(this.tick.bind(this),1e3))},n.prototype.stop=function(){this.interval&&(window.clearInterval(this.interval),this.interval=0)},e.exports=n},{}],8:[function(t,e,i){"use strict";e.exports=function(t){var e=null,i={};function n(){document.documentElement.removeEventListener("mouseleave",s),document.documentElement.removeEventListener("mouseenter",r),document.documentElement.removeEventListener("click",o),window.removeEventListener("touchstart",l),window.removeEventListener("touchend",c),t()}function o(){null!==e&&(window.clearTimeout(e),e=null)}function r(t){o()}function s(t){o(),t.clientY<=(document.documentMode||/Edge\//.test(navigator.userAgent)?5:0)&&t.clientX<.8*window.innerWidth&&(e=window.setTimeout(n,400))}function l(t){o(),i={timestamp:performance.now(),scrollY:window.scrollY,windowHeight:window.innerHeight}}function c(t){o(),window.innerHeight>i.windowHeight||window.scrollY+20>=i.scrollY||300<performance.now()-i.timestamp||-1<["A","INPUT","BUTTON"].indexOf(t.target.tagName)||(e=window.setTimeout(n,800))}window.addEventListener("touchstart",l),window.addEventListener("touchend",c),document.documentElement.addEventListener("mouseenter",r),document.documentElement.addEventListener("mouseleave",s),document.documentElement.addEventListener("click",o)}},{}],9:[function(t,s,e){!function(t){"use strict";function e(){}var i=e.prototype,n=t.EventEmitter;function r(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)}}i.getListeners=function(t){var e,i,n=this._getEvents();if(t instanceof RegExp)for(i in e={},n)n.hasOwnProperty(i)&&t.test(i)&&(e[i]=n[i]);else e=n[t]||(n[t]=[]);return e},i.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},i.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&((e={})[t]=i),e||i},i.addListener=function(t,e){if(!function t(e){return"function"==typeof e||e instanceof RegExp||!(!e||"object"!=typeof e)&&t(e.listener)}(e))throw new TypeError("listener must be a function");var i,n=this.getListenersAsObject(t),o="object"==typeof e;for(i in n)n.hasOwnProperty(i)&&-1===r(n[i],e)&&n[i].push(o?e:{listener:e,once:!1});return this},i.on=o("addListener"),i.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},i.once=o("addOnceListener"),i.defineEvent=function(t){return this.getListeners(t),this},i.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},i.removeListener=function(t,e){var i,n,o=this.getListenersAsObject(t);for(n in o)o.hasOwnProperty(n)&&-1!==(i=r(o[n],e))&&o[n].splice(i,1);return this},i.off=o("removeListener"),i.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},i.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},i.manipulateListeners=function(t,e,i){var n,o,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(n=i.length;n--;)r.call(this,e,i[n]);else for(n in e)e.hasOwnProperty(n)&&(o=e[n])&&("function"==typeof o?r.call(this,n,o):s.call(this,n,o));return this},i.removeEvent=function(t){var e,i=typeof t,n=this._getEvents();if("string"==i)delete n[t];else if(t instanceof RegExp)for(e in n)n.hasOwnProperty(e)&&t.test(e)&&delete n[e];else delete this._events;return this},i.removeAllListeners=o("removeEvent"),i.emitEvent=function(t,e){var i,n,o,r,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].slice(0),o=0;o<i.length;o++)!0===(n=i[o]).once&&this.removeListener(t,n.listener),n.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,n.listener);return this},i.trigger=o("emitEvent"),i.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},i.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},i._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return t.EventEmitter=n,e},"function"==typeof l&&l.amd?l(function(){return e}):"object"==typeof s&&s.exports?s.exports=e:t.EventEmitter=e}("undefined"!=typeof window?window:this||{})},{}]},{},[1])}();
|
2 |
//# sourceMappingURL=script.min.js.map
|
assets/js/script.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"sources":["script.js"],"names":["define","undefined","r","e","n","t","o","i","f","c","u","a","Error","code","p","exports","call","length","1","require","module","_typeof","obj","Symbol","iterator","constructor","prototype","Boxzilla","options","window","boxzilla_options","locationHashRefersBox","box","location","hash","match","elementId","element","id","querySelector","isLoggedIn","document","body","className","indexOf","testMode","console","log","init","addEventListener","inited","key","boxes","boxOpts","boxContentElement","getElementById","content","create","post","slug","styles","css","background_color","style","background","color","border_color","borderColor","border_width","borderWidth","parseInt","border_style","borderStyle","width","maxWidth","firstChild","lastChild","fits","show","trigger","mc4wp_forms_config","submitted_form","selector","element_id","boxId","hasOwnProperty","maybeOpenMailChimpForWordPressBox","boxzilla","2","duration","property","animate","targetStyles","fn","last","Date","initialStyles","getComputedStyle","currentStyles","propSteps","parseFloat","to","current","tick","step","increment","newValue","timeSinceLastTick","done","suffix","requestAnimationFrame","setTimeout","toggle","animation","callbackFn","cleanup","removeAttribute","setAttribute","clone","getAttribute","display","nowVisible","hiddenStyles","visibleStyles","offsetLeft","cloneNode","properties","value","newObject","initObjectProperties","object","copyObjectProperties","isFinite","height","clientRect","getBoundingClientRect","overflowY","opacity","animated","3","defaults","rehide","cookie","icon","screenWidthCondition","position","closable","Animator","Box","config","this","obj1","obj2","obj3","attrname","merge","overlay","visible","dismissed","triggered","triggerHeight","calculateTriggerHeight","cookieSet","isCookieSet","contentElement","closeIcon","dom","events","preventDefault","dismiss","target","tagName","setCookie","wrapper","createElement","appendChild","innerHTML","setCustomBoxStyling","origDisplay","maxHeight","windowHeight","innerHeight","boxHeight","clientHeight","newTopMargin","marginTop","classList","bind","hide","method","triggerElement","top","html","documentElement","Math","max","scrollHeight","offsetHeight","getDocumentHeight","condition","innerWidth","onResize","mayAutoShow","mayRehide","replace","RegExp","hours","expiryDate","setHours","getHours","toUTCString","_Boxzilla","./animator.js","4","siteTimer","pageTimer","pageViews","EventEmitter","Timer","Object","scrollElement","initialised","ExitIntent","throttle","threshhold","scope","deferTimer","context","now","args","arguments","clearTimeout","apply","onKeyUp","keyCode","checkPageViewsCriteria","isAnyBoxVisible","forEach","checkTimeCriteria","time","checkHeightCriteria","scrollY","pageYOffset","scrollTop","recalculateHeights","onOverlayClick","x","offsetX","y","offsetY","rect","left","right","bottom","showBoxesWithExitIntentTrigger","filter","b","onElementClick","el","srcElement","parentElement","toLowerCase","timers","sessionTime","sessionStorage","getItem","start","setItem","stop","styleElement","head","setInterval","opts","minimumScreenWidth","push","get","./box.js","./styles.js","./timer.js","./triggers/exit-intent.js","wolfy87-eventemitter","5","6","interval","clearInterval","7","callback","timeout","touchStart","triggerCallback","removeEventListener","onMouseLeave","onMouseEnter","onTouchStart","onTouchEnd","evt","clientY","documentMode","test","navigator","userAgent","clientX","timestamp","performance","8","proto","originalGlobalValue","indexOfListener","listeners","listener","alias","name","getListeners","response","_getEvents","flattenListeners","flatListeners","getListenersAsObject","Array","addListener","isValidListener","TypeError","listenerIsWrapped","once","on","addOnceListener","defineEvent","defineEvents","evts","removeListener","index","splice","off","addListeners","manipulateListeners","removeListeners","remove","single","multiple","removeEvent","type","_events","removeAllListeners","emitEvent","listenersMap","slice","_getOnceReturnValue","emit","setOnceReturnValue","_onceReturnValue","noConflict","amd"],"mappings":"CAAA,WAAe,IAA8EA,OAASC,GAAuB,SAASC,EAAEC,EAAEC,EAAEC,GAAG,SAASC,EAAEC,EAAEC,GAAG,IAAIJ,EAAEG,GAAG,CAAC,IAAIJ,EAAEI,GAAG,CAAC,IAAIE,GAAE,EAAoC,IAAID,GAAGC,EAAE,OAAOA,EAAEF,GAAE,GAAI,GAAGG,EAAE,OAAOA,EAAEH,GAAE,GAAI,IAAII,EAAE,IAAIC,MAAM,uBAAuBL,EAAE,KAAK,MAAMI,EAAEE,KAAK,mBAAmBF,EAAE,IAAIG,EAAEV,EAAEG,GAAG,CAACQ,QAAQ,IAAIZ,EAAEI,GAAG,GAAGS,KAAKF,EAAEC,QAAQ,SAASb,GAAoB,OAAOI,EAAlBH,EAAEI,GAAG,GAAGL,IAAeA,IAAIY,EAAEA,EAAEC,QAAQb,EAAEC,EAAEC,EAAEC,GAAG,OAAOD,EAAEG,GAAGQ,QAAQ,IAAI,IAAIL,GAAE,EAAoCH,EAAE,EAAEA,EAAEF,EAAEY,OAAOV,IAAID,EAAED,EAAEE,IAAI,OAAOD,EAA7b,CAA4c,CAACY,EAAE,CAAC,SAASC,EAAQC,EAAOL,GACzlB,aAEA,SAASM,EAAQC,GAAwT,OAAtOD,EAAr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AUnS,OAAQV,KAKR,KAFtB8S,EAAWD,EAAU7S,IAER4T,MACT7K,KAAKmL,eAAelC,EAAKc,EAASA,UAG3BA,EAASA,SAAS7E,MAAMlF,KAAM+E,GAAQ,MAEhC/E,KAAKoM,uBAClBpM,KAAKmL,eAAelC,EAAKc,EAASA,UAMlD,OAAO/J,MAMX2J,EAAMlO,QAAUuO,EAAM,aAUtBL,EAAM0C,KAAO,SAAcpD,GACvB,IAAIlE,EAAOyF,MAAMpS,UAAU+T,MAAMzU,KAAKsN,UAAW,GACjD,OAAOhF,KAAKiM,UAAUhD,EAAKlE,IAW/B4E,EAAM2C,mBAAqB,SAA4B7N,GAEnD,OADAuB,KAAKuM,iBAAmB9N,EACjBuB,MAWX2J,EAAMyC,oBAAsB,WACxB,OAAIpM,KAAKjE,eAAe,qBACbiE,KAAKuM,kBAapB5C,EAAMS,WAAa,WACf,OAAOpK,KAAK+L,UAAY/L,KAAK+L,QAAU,KAQ3C5H,EAAaqI,WAAa,WAEtB,OADA/U,EAAQ0M,aAAeyF,EAChBzF,GAIW,mBAAXzN,GAAyBA,EAAO+V,IACvC/V,EAAO,WACH,OAAOyN,IAGY,iBAAXrM,GAAuBA,EAAOL,QAC1CK,EAAOL,QAAU0M,EAGjB1M,EAAQ0M,aAAeA,EA5d9B,CA8dmB,oBAAX5L,OAAyBA,OAASyH,MAAQ,KAEjD,KAAK,GAAG,CAAC,IA1kDX","file":"script.min.js","sourcesContent":["(function () { var require = undefined; var module = undefined; var exports = undefined; var define = undefined; (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){\n\"use strict\";\n\nfunction _typeof(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\n(function () {\n 'use strict';\n\n var Boxzilla = require('boxzilla');\n\n var options = window.boxzilla_options; // expose Boxzilla object to window\n\n window.Boxzilla = Boxzilla; // helper function for setting CSS styles\n\n function css(element, styles) {\n if (styles.background_color) {\n element.style.background = styles.background_color;\n }\n\n if (styles.color) {\n element.style.color = styles.color;\n }\n\n if (styles.border_color) {\n element.style.borderColor = styles.border_color;\n }\n\n if (styles.border_width) {\n element.style.borderWidth = parseInt(styles.border_width) + \"px\";\n }\n\n if (styles.border_style) {\n element.style.borderStyle = styles.border_style;\n }\n\n if (styles.width) {\n element.style.maxWidth = parseInt(styles.width) + \"px\";\n }\n }\n\n function createBoxesFromConfig() {\n // failsafe against including script twice.\n if (options.inited) {\n return;\n } // create boxes from options\n\n\n for (var key in options.boxes) {\n // get opts\n var boxOpts = options.boxes[key];\n boxOpts.testMode = isLoggedIn && options.testMode; // find box content element, bail if not found\n\n var boxContentElement = document.getElementById('boxzilla-box-' + boxOpts.id + '-content');\n\n if (!boxContentElement) {\n continue;\n } // use element as content option\n\n\n boxOpts.content = boxContentElement; // create box\n\n var box = Boxzilla.create(boxOpts.id, boxOpts); // add box slug to box element as classname\n\n box.element.className = box.element.className + ' boxzilla-' + boxOpts.post.slug; // add custom css to box\n\n css(box.element, boxOpts.css);\n\n try {\n box.element.firstChild.firstChild.className += \" first-child\";\n box.element.firstChild.lastChild.className += \" last-child\";\n } catch (e) {} // maybe show box right away\n\n\n if (box.fits() && locationHashRefersBox(box)) {\n box.show();\n }\n } // set flag to prevent initialising twice\n\n\n options.inited = true; // trigger \"done\" event.\n\n Boxzilla.trigger('done'); // maybe open box with MC4WP form in it\n\n maybeOpenMailChimpForWordPressBox();\n }\n\n function locationHashRefersBox(box) {\n if (!window.location.hash || 0 === window.location.hash.length) {\n return false;\n } // parse \"boxzilla-{id}\" from location hash\n\n\n var match = window.location.hash.match(/[#&](boxzilla-\\d+)/);\n\n if (!match || _typeof(match) !== \"object\" || match.length < 2) {\n return false;\n }\n\n var elementId = match[1];\n\n if (elementId === box.element.id) {\n return true;\n } else if (box.element.querySelector('#' + elementId)) {\n return true;\n }\n\n return false;\n }\n\n function maybeOpenMailChimpForWordPressBox() {\n if (_typeof(window.mc4wp_forms_config) !== \"object\" || !window.mc4wp_forms_config.submitted_form) {\n return;\n }\n\n var selector = '#' + window.mc4wp_forms_config.submitted_form.element_id;\n var boxes = Boxzilla.boxes;\n\n for (var boxId in boxes) {\n if (!boxes.hasOwn |