Version Description
Download this release
Release Info
Developer | yuvalo |
Plugin | WP Google Analytics Events |
Version | 2.6.3 |
Comparing to | |
See all releases |
Code changes from version 2.6.2 to 2.6.3
- css/style.css +166 -4
- ga-scroll-event.php +6 -6
- include/Settings.php +54 -37
- js/admin.js +4 -4
- js/ajax-settings.js +5 -6
- js/dist/admin-scripts-min.js +1 -1
- js/dist/admin-scripts.js +9 -21
- js/dist/frontend-scripts-min.js +1 -1
- js/dist/frontend-scripts.js +5 -3
- js/main.js +7 -5
- readme.txt +7 -2
- templates/click-elements-input-table.php +8 -3
- templates/scroll-elements-input-table.php +8 -2
css/style.css
CHANGED
@@ -8,6 +8,76 @@
|
|
8 |
padding: 0;
|
9 |
/* width: 100%; */
|
10 |
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
}
|
12 |
|
13 |
/* Remove blue outline around update button when new row added*/
|
@@ -16,6 +86,31 @@
|
|
16 |
color: #0073aa;
|
17 |
}
|
18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
.ga_main .form-table .ga-events-table{
|
20 |
|
21 |
width: 100%;
|
@@ -32,6 +127,16 @@
|
|
32 |
text-align: center;
|
33 |
}
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
.ga-events-table .fa{
|
36 |
font-size: 20px;
|
37 |
}
|
@@ -273,12 +378,16 @@ div.tagsinput div { display:block; float: left; }
|
|
273 |
float: right;
|
274 |
}
|
275 |
|
|
|
|
|
|
|
276 |
|
277 |
.ga_events_sidebar {
|
278 |
float:right;
|
279 |
width: 250px;
|
|
|
280 |
margin-top:52px;
|
281 |
-
margin-right:
|
282 |
}
|
283 |
|
284 |
.wpcta {
|
@@ -333,11 +442,15 @@ div.tagsinput div { display:block; float: left; }
|
|
333 |
margin: auto;
|
334 |
}
|
335 |
|
|
|
336 |
#ga_events_options {
|
337 |
-
float: left
|
338 |
-
width: 560px
|
|
|
|
|
|
|
|
|
339 |
}
|
340 |
-
|
341 |
.plugin-title a[href^="https://wpflow.com/upgrade"]{
|
342 |
color: #F7691D !important;
|
343 |
}
|
@@ -476,3 +589,52 @@ a[href="admin.php?page=wp-google-analytics-events-upgrade"]:hover {
|
|
476 |
background-image: -o-linear-gradient(top, #E94D3D, #E94D3D);
|
477 |
background-image: linear-gradient(to bottom, #E94D3D, #E94D3D);
|
478 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
padding: 0;
|
9 |
/* width: 100%; */
|
10 |
display: block;
|
11 |
+
margin-bottom: 1.4em;
|
12 |
+
}
|
13 |
+
|
14 |
+
.wpgae-gs-form {
|
15 |
+
/*padding-left: 5px;*/
|
16 |
+
padding-top: 5px;
|
17 |
+
background-color: white;
|
18 |
+
margin-top: 4px;
|
19 |
+
max-width: 560px;
|
20 |
+
float: left;
|
21 |
+
display: inline-block;
|
22 |
+
}
|
23 |
+
|
24 |
+
.wpgae-gs-form-tabs {
|
25 |
+
/*padding-left: 5px;*/
|
26 |
+
padding-top: 5px;
|
27 |
+
background-color: white;
|
28 |
+
margin-top: 4px;
|
29 |
+
float: left;
|
30 |
+
display: inline-block;
|
31 |
+
padding-left: 10px;
|
32 |
+
padding-right: 10px;
|
33 |
+
}
|
34 |
+
|
35 |
+
/*.wpgae-gs-form-tabs .bulkactions {*/
|
36 |
+
/*margin-left: 10px;*/
|
37 |
+
/*}*/
|
38 |
+
.wpgae-gs-form-tabs .wpgae-gs-internal {
|
39 |
+
margin-left: 0px;
|
40 |
+
}
|
41 |
+
|
42 |
+
.ga_main #submit {
|
43 |
+
margin-left:30px;
|
44 |
+
}
|
45 |
+
|
46 |
+
.wpgae-gs-internal {
|
47 |
+
margin-left: 30px;
|
48 |
+
}
|
49 |
+
.wpgae-gs-form .nav-tab-wrapper{
|
50 |
+
border-bottom: 4px solid #2271b1 !important;
|
51 |
+
}
|
52 |
+
|
53 |
+
.wpgae-gs-form select {
|
54 |
+
margin-left: -3px;
|
55 |
+
}
|
56 |
+
.wpgae-gs-form .nav-tab {
|
57 |
+
background-color: white;
|
58 |
+
min-width: 300px;
|
59 |
+
font-size: 24px;
|
60 |
+
margin-left: 0.2em;
|
61 |
+
text-align: center;
|
62 |
+
}
|
63 |
+
.wpgae-gs-form .nav-tab-active {
|
64 |
+
background-color: #2271b1;
|
65 |
+
color: white;
|
66 |
+
border-bottom: 0px #2271b1;
|
67 |
+
}
|
68 |
+
|
69 |
+
|
70 |
+
|
71 |
+
/* The switch - the box around the slider */
|
72 |
+
.wpgae-gs-form .switch {
|
73 |
+
position: relative;
|
74 |
+
display: inline-block;
|
75 |
+
width: 60px;
|
76 |
+
height: 34px;
|
77 |
+
}
|
78 |
+
|
79 |
+
.wpgae-gs-form .toggle-control {
|
80 |
+
margin-left: 2px;
|
81 |
}
|
82 |
|
83 |
/* Remove blue outline around update button when new row added*/
|
86 |
color: #0073aa;
|
87 |
}
|
88 |
|
89 |
+
.ga_main .form-table {
|
90 |
+
margin-left: 30px;
|
91 |
+
margin-top: 20px;
|
92 |
+
}
|
93 |
+
|
94 |
+
.ga_main ga-file-action {
|
95 |
+
display: block;
|
96 |
+
float: left;
|
97 |
+
margin-right: 10px;
|
98 |
+
}
|
99 |
+
|
100 |
+
.ga_main #nofollow_tags_tagsinput{
|
101 |
+
width: 269px;
|
102 |
+
margin-top: 5px;
|
103 |
+
}
|
104 |
+
|
105 |
+
.ga_main #wpgae-dl-type {
|
106 |
+
vertical-align: middle;
|
107 |
+
margin-left: 10px;
|
108 |
+
}
|
109 |
+
|
110 |
+
.ga_main .form-table .ga-gs-input {
|
111 |
+
width: 235px;
|
112 |
+
}
|
113 |
+
|
114 |
.ga_main .form-table .ga-events-table{
|
115 |
|
116 |
width: 100%;
|
127 |
text-align: center;
|
128 |
}
|
129 |
|
130 |
+
|
131 |
+
.wpgae-gs-internal .page-title-action {
|
132 |
+
top: 20px;
|
133 |
+
margin-left: 0px;
|
134 |
+
}
|
135 |
+
.wpgae-gs-internal .page-title-action:active {
|
136 |
+
top: 20px;
|
137 |
+
margin-left: 0px;
|
138 |
+
}
|
139 |
+
|
140 |
.ga-events-table .fa{
|
141 |
font-size: 20px;
|
142 |
}
|
378 |
float: right;
|
379 |
}
|
380 |
|
381 |
+
.wpgae-inner-label {
|
382 |
+
min-width: 30px !important;
|
383 |
+
}
|
384 |
|
385 |
.ga_events_sidebar {
|
386 |
float:right;
|
387 |
width: 250px;
|
388 |
+
display: inline-block;
|
389 |
margin-top:52px;
|
390 |
+
margin-right: 40px;
|
391 |
}
|
392 |
|
393 |
.wpcta {
|
442 |
margin: auto;
|
443 |
}
|
444 |
|
445 |
+
|
446 |
#ga_events_options {
|
447 |
+
/*float: left;*/
|
448 |
+
/*width: 560px;*/
|
449 |
+
}
|
450 |
+
.ga-main-wrapper {
|
451 |
+
background: white;
|
452 |
+
overflow: hidden;
|
453 |
}
|
|
|
454 |
.plugin-title a[href^="https://wpflow.com/upgrade"]{
|
455 |
color: #F7691D !important;
|
456 |
}
|
589 |
background-image: -o-linear-gradient(top, #E94D3D, #E94D3D);
|
590 |
background-image: linear-gradient(to bottom, #E94D3D, #E94D3D);
|
591 |
}
|
592 |
+
|
593 |
+
|
594 |
+
.toggle-control {
|
595 |
+
display: block;
|
596 |
+
position: relative;
|
597 |
+
padding-left: 35px;
|
598 |
+
margin-bottom: 18px;
|
599 |
+
cursor: pointer;
|
600 |
+
font-size: 12px;
|
601 |
+
-webkit-user-select: none;
|
602 |
+
-moz-user-select: none;
|
603 |
+
-ms-user-select: none;
|
604 |
+
user-select: none;
|
605 |
+
min-width: 0px !important;
|
606 |
+
}
|
607 |
+
.toggle-control input {
|
608 |
+
position: absolute;
|
609 |
+
opacity: 0;
|
610 |
+
cursor: pointer;
|
611 |
+
height: 0;
|
612 |
+
width: 0;
|
613 |
+
}
|
614 |
+
.toggle-control input:checked ~ .control {
|
615 |
+
background-color: #2271b1;
|
616 |
+
}
|
617 |
+
.toggle-control input:checked ~ .control:after {
|
618 |
+
left: 17px;
|
619 |
+
}
|
620 |
+
.toggle-control .control {
|
621 |
+
position: absolute;
|
622 |
+
top: 0;
|
623 |
+
left: 0;
|
624 |
+
height: 20px;
|
625 |
+
width: 32px;
|
626 |
+
border-radius: 10px;
|
627 |
+
background-color: darkgray;
|
628 |
+
transition: background-color 0.15s ease-in;
|
629 |
+
}
|
630 |
+
.toggle-control .control:after {
|
631 |
+
content: "";
|
632 |
+
position: absolute;
|
633 |
+
left: 3px;
|
634 |
+
top: 3px;
|
635 |
+
width: 14px;
|
636 |
+
height: 14px;
|
637 |
+
border-radius: 10px;
|
638 |
+
background: white;
|
639 |
+
transition: left 0.15s ease-in;
|
640 |
+
}
|
ga-scroll-event.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: WP Google Analytics Events
|
5 |
Plugin URI: http://wpflow.com
|
6 |
Description: Adds the Google Analytics code to your website and enables you to send events on scroll or click.
|
7 |
-
Version: 2.6.
|
8 |
Author: PineWise
|
9 |
Author URI: http://wpflow.com
|
10 |
License: GPLv2
|
@@ -29,7 +29,7 @@ plugin_dir_url(__FILE__));
|
|
29 |
// Current version number
|
30 |
if (!defined('GA_EVENTS_VERSION'))
|
31 |
define('GA_EVENTS_VERSION',
|
32 |
-
'2.6.
|
33 |
|
34 |
// Dependencies
|
35 |
|
@@ -321,10 +321,10 @@ if (!class_exists('GaEvents')) {
|
|
321 |
array('jquery'),
|
322 |
false);
|
323 |
|
324 |
-
wp_enqueue_script('jquery_form_validator',
|
325 |
-
GAE_PLUGIN_URL . 'js/third-party/jquery.form-validator.min.js',
|
326 |
-
array('jquery'),
|
327 |
-
false);
|
328 |
|
329 |
// Admin JS
|
330 |
wp_enqueue_script('admin_js',
|
4 |
Plugin Name: WP Google Analytics Events
|
5 |
Plugin URI: http://wpflow.com
|
6 |
Description: Adds the Google Analytics code to your website and enables you to send events on scroll or click.
|
7 |
+
Version: 2.6.3
|
8 |
Author: PineWise
|
9 |
Author URI: http://wpflow.com
|
10 |
License: GPLv2
|
29 |
// Current version number
|
30 |
if (!defined('GA_EVENTS_VERSION'))
|
31 |
define('GA_EVENTS_VERSION',
|
32 |
+
'2.6.3');
|
33 |
|
34 |
// Dependencies
|
35 |
|
321 |
array('jquery'),
|
322 |
false);
|
323 |
|
324 |
+
// wp_enqueue_script('jquery_form_validator',
|
325 |
+
// GAE_PLUGIN_URL . 'js/third-party/jquery.form-validator.min.js',
|
326 |
+
// array('jquery'),
|
327 |
+
// false);
|
328 |
|
329 |
// Admin JS
|
330 |
wp_enqueue_script('admin_js',
|
include/Settings.php
CHANGED
@@ -127,24 +127,12 @@ class GAESettings {
|
|
127 |
}
|
128 |
?>
|
129 |
|
130 |
-
<?php echo $active_page == 'wp-google-analytics-events' ? "</form>" : '';
|
131 |
// Save button on Genral Settings tab
|
132 |
if ( $active_page == 'wp-google-analytics-events' ) {
|
133 |
?>
|
134 |
-
<div class="settings_content">
|
135 |
-
<form action="" method="post" enctype="multipart/form-data">
|
136 |
-
<a href="#" class="btn_close"><img src="<?php echo GAE_PLUGIN_URL ?>images/close.png"></a>
|
137 |
-
<input type="file" name="ga_settings_import">
|
138 |
-
<input type="hidden" name="ga_events_action" value="import_settings" />
|
139 |
-
<?php
|
140 |
-
wp_nonce_field( 'ga_events_import_nonce',
|
141 |
-
'ga_events_import_nonce' );
|
142 |
-
?>
|
143 |
-
<input type="submit" name="set_settings">
|
144 |
-
</form>
|
145 |
-
</div>
|
146 |
|
147 |
-
|
148 |
<!-- <div class="wrap ga_events_sidebar">-->
|
149 |
<table class="form-table widefat" >
|
150 |
<thead>
|
@@ -180,6 +168,19 @@ class GAESettings {
|
|
180 |
</table>
|
181 |
|
182 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
<?php } ?>
|
184 |
<?php
|
185 |
}
|
@@ -200,7 +201,7 @@ class GAESettings {
|
|
200 |
* ------------------------------------------------------------------------ */
|
201 |
|
202 |
add_settings_section( 'ga_events_main',
|
203 |
-
'
|
204 |
array( $this, 'ga_events_section_text' ),
|
205 |
'ga_events_options_group' );
|
206 |
|
@@ -399,10 +400,17 @@ class GAESettings {
|
|
399 |
|
400 |
function ga_events_section_text() {
|
401 |
?>
|
402 |
-
<
|
403 |
-
|
404 |
-
|
405 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
<?php
|
407 |
}
|
408 |
|
@@ -445,7 +453,8 @@ class GAESettings {
|
|
445 |
|
446 |
// Output HTML
|
447 |
?>
|
448 |
-
<
|
|
|
449 |
<?php
|
450 |
}
|
451 |
|
@@ -454,17 +463,19 @@ class GAESettings {
|
|
454 |
$domain = isset( $options[ 'domain' ] ) ? $options[ 'domain' ] : '';
|
455 |
echo "<label>Domain (optional)</label>";
|
456 |
|
457 |
-
echo "<input id='domain' name='ga_events_options[domain]' type='text' value='$domain' />";
|
458 |
}
|
459 |
|
460 |
function ga_events_setting_anon_input() {
|
461 |
$options = get_option( 'ga_events_options' );
|
462 |
$value = isset( $options[ 'anonymizeip' ] ) ? $options[ 'anonymizeip' ] : '0';
|
463 |
echo "<label>IP Anonymization </i>" . $this->ga_tooltip( 'Tell Google Analytics not to log IP Addresses. Requires code snippet to be selected (but not GTM container).' ) . "</label>";
|
464 |
-
|
465 |
echo "<input id='anonymizeip' name='ga_events_options[anonymizeip]' type='checkbox' value='1' " . checked( $value,
|
466 |
1,
|
467 |
false ) . " />";
|
|
|
|
|
468 |
}
|
469 |
|
470 |
function ga_events_setting_snippet_type_input() {
|
@@ -478,7 +489,7 @@ class GAESettings {
|
|
478 |
$defaultOption = isset( $options[ 'snippet_type' ] ) ? $options[ 'snippet_type' ] : 'none';
|
479 |
echo "<label>Snippet type to add: " . $this->ga_tooltip( 'The Google Analytics snippet to add if any.' ) . "</label>";
|
480 |
?>
|
481 |
-
<select id="snippet_type" name='ga_events_options[snippet_type]'>
|
482 |
<option value="gtm" <?php selected($defaultOption, 'gtm') ?>>Google Tag Manager Container</option>
|
483 |
<option value="gst" <?php selected($defaultOption, 'gst') ?>>Global Site Tag (gtag.js)</option>
|
484 |
<option value="universal" <?php selected($defaultOption, 'universal') ?>>Universal (analytics.js)</option>
|
@@ -492,42 +503,45 @@ class GAESettings {
|
|
492 |
$options = get_option( 'ga_events_options' );
|
493 |
$gtm_id = isset( $options[ 'gtm_id' ] ) ? $options[ 'gtm_id' ] : '';
|
494 |
echo "<label>Google Tag Manager Container ID" . $this->ga_tooltip( 'Your GTM container ID, which you can get from your GTM account' ) . "</label>";
|
495 |
-
echo "<input id='gtm_id' name='ga_events_options[gtm_id]' type='text' value='$gtm_id' />";
|
496 |
}
|
497 |
|
498 |
function ga_events_setting_download_tracking_input() {
|
499 |
$options = get_option( 'ga_events_options' );
|
500 |
$value = isset( $options[ 'download_tracking' ] ) ? $options[ 'download_tracking' ] : '0';
|
|
|
501 |
echo "<label>Track Downloads (PDF, MP3, PPTX, DOCX): </label>";
|
|
|
502 |
echo "<input id='download_tracking' name='ga_events_options[download_tracking]' type='checkbox' value='1'" . checked( $value,
|
503 |
'1',
|
504 |
false ) . " />";
|
|
|
|
|
505 |
}
|
506 |
-
|
507 |
-
// function ga_events_setting_tel_link_tracking_input() {
|
508 |
-
// $options = get_option( 'ga_events_options' );
|
509 |
-
// $value = isset( $options[ 'tel_link_tracking' ] ) ? $options[ 'tel_link_tracking' ] : '0';
|
510 |
-
// echo "<label>Track Telephone Number Links (tel:): </label>";
|
511 |
-
// echo "<input id='tel_link_tracking' name='ga_events_options[tel_link_tracking]' type='checkbox' value='1'" . checked( $value,
|
512 |
-
// '1',
|
513 |
-
// false ) . " />";
|
514 |
-
// }
|
515 |
function ga_events_setting_email_link_tracking_input() {
|
516 |
$options = get_option( 'ga_events_options' );
|
517 |
$value = isset( $options[ 'email_link_tracking' ] ) ? $options[ 'email_link_tracking' ] : '0';
|
518 |
echo "<label>Track Email Links (mailto:): </label>";
|
|
|
519 |
echo "<input id='email_link_tracking' name='ga_events_options[email_link_tracking]' type='checkbox' value='1'" . checked( $value,
|
520 |
'1',
|
521 |
false ) . " />";
|
|
|
|
|
522 |
}
|
523 |
|
524 |
function ga_events_setting_adv_input() {
|
525 |
$options = get_option( 'ga_events_options' );
|
526 |
$value = isset( $options[ 'advanced' ] ) ? $options[ 'advanced' ] : '0';
|
527 |
-
echo "<
|
|
|
|
|
528 |
echo "<input id='advanced' name='ga_events_options[advanced]' type='checkbox' value='1' " . checked( $value,
|
529 |
'1',
|
530 |
false ) . " />";
|
|
|
|
|
531 |
}
|
532 |
|
533 |
|
@@ -543,7 +557,7 @@ class GAESettings {
|
|
543 |
$defaultOption = isset( $options[ 'force_snippet' ] ) ? $options[ 'force_snippet' ] : 'none';
|
544 |
echo $track ? "<div id='forcesnopperwrap'>" : "<div style='display:none;' id='forcesnopperwrap'>";
|
545 |
|
546 |
-
echo "<label>Force plugin to use this code snippet: " . $this->ga_tooltip( 'Please see docs for help with deciding this option' ) . "</label>";
|
547 |
?>
|
548 |
<select id="force_snippet" name='ga_events_options[force_snippet]'>
|
549 |
<option value="gtm" <?php selected($defaultOption, 'gtm') ?>>Google Tag Manager Container</option>
|
@@ -561,17 +575,20 @@ class GAESettings {
|
|
561 |
$options = get_option( 'ga_events_options' );
|
562 |
$value = isset( $options[ 'script_debug_mode' ] ) ? $options[ 'script_debug_mode' ] : '0';
|
563 |
echo "<label>Support Friendly Scripts " . $this->ga_tooltip( 'Uncheck for script minimization' ) . "</label>";
|
|
|
564 |
echo "<input id='script_debug_mode' name='ga_events_options[script_debug_mode]' type='checkbox' value='1' " . checked( $value,
|
565 |
'1',
|
566 |
false ) . " />";
|
|
|
|
|
567 |
}
|
568 |
|
569 |
function ga_events_settings_download() {
|
570 |
-
echo '<a class="button" href="http://' . $_SERVER[ "HTTP_HOST" ] . $_SERVER[ "REQUEST_URI" ] . '&download=1">Export settings</a>';
|
571 |
}
|
572 |
|
573 |
function ga_events_settings_upload() {
|
574 |
-
echo '
|
575 |
}
|
576 |
|
577 |
function ga_events_settings_confirm_general_settings_page() {
|
127 |
}
|
128 |
?>
|
129 |
|
130 |
+
<?php echo $active_page == 'wp-google-analytics-events' ? "</form></div>" : '';
|
131 |
// Save button on Genral Settings tab
|
132 |
if ( $active_page == 'wp-google-analytics-events' ) {
|
133 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
+
<div class="wrap ga_events_banner ga_events_sidebar">
|
136 |
<!-- <div class="wrap ga_events_sidebar">-->
|
137 |
<table class="form-table widefat" >
|
138 |
<thead>
|
168 |
</table>
|
169 |
|
170 |
</div>
|
171 |
+
</div>
|
172 |
+
<div class="settings_content">
|
173 |
+
<form action="" method="post" enctype="multipart/form-data">
|
174 |
+
<a href="#" class="btn_close"><img src="<?php echo GAE_PLUGIN_URL ?>images/close.png"></a>
|
175 |
+
<input type="file" name="ga_settings_import">
|
176 |
+
<input type="hidden" name="ga_events_action" value="import_settings" />
|
177 |
+
<?php
|
178 |
+
wp_nonce_field( 'ga_events_import_nonce',
|
179 |
+
'ga_events_import_nonce' );
|
180 |
+
?>
|
181 |
+
<input type="submit" name="set_settings">
|
182 |
+
</form>
|
183 |
+
</div>
|
184 |
<?php } ?>
|
185 |
<?php
|
186 |
}
|
201 |
* ------------------------------------------------------------------------ */
|
202 |
|
203 |
add_settings_section( 'ga_events_main',
|
204 |
+
'',
|
205 |
array( $this, 'ga_events_section_text' ),
|
206 |
'ga_events_options_group' );
|
207 |
|
400 |
|
401 |
function ga_events_section_text() {
|
402 |
?>
|
403 |
+
<div class="ga-main-wrapper">
|
404 |
+
|
405 |
+
<div class='wpgae-gs-form'>
|
406 |
+
<div class="wpgae-gs-internal">
|
407 |
+
<h2>Settings</h2>
|
408 |
+
<a href='http://wpflow.com/documentation/'>Need Help?</a>
|
409 |
+
<span style='margin-left:8px;'>
|
410 |
+
<a href='https://wordpress.org/support/plugin/wp-google-analytics-events/'>Support</a>
|
411 |
+
</span>
|
412 |
+
</div>
|
413 |
+
|
414 |
<?php
|
415 |
}
|
416 |
|
453 |
|
454 |
// Output HTML
|
455 |
?>
|
456 |
+
<h4>Google Analytics</h4>
|
457 |
+
<label>Google Analytics Tracking ID</label><input class='ga-gs-input' name='ga_events_options[tracking_id]' type='text' value="<?php echo $id; ?>" />
|
458 |
<?php
|
459 |
}
|
460 |
|
463 |
$domain = isset( $options[ 'domain' ] ) ? $options[ 'domain' ] : '';
|
464 |
echo "<label>Domain (optional)</label>";
|
465 |
|
466 |
+
echo "<input id='domain' class='ga-gs-input' name='ga_events_options[domain]' type='text' value='$domain' />";
|
467 |
}
|
468 |
|
469 |
function ga_events_setting_anon_input() {
|
470 |
$options = get_option( 'ga_events_options' );
|
471 |
$value = isset( $options[ 'anonymizeip' ] ) ? $options[ 'anonymizeip' ] : '0';
|
472 |
echo "<label>IP Anonymization </i>" . $this->ga_tooltip( 'Tell Google Analytics not to log IP Addresses. Requires code snippet to be selected (but not GTM container).' ) . "</label>";
|
473 |
+
echo "<label class='toggle-control'>";
|
474 |
echo "<input id='anonymizeip' name='ga_events_options[anonymizeip]' type='checkbox' value='1' " . checked( $value,
|
475 |
1,
|
476 |
false ) . " />";
|
477 |
+
echo "<span class='control'></span>";
|
478 |
+
echo "</label>";
|
479 |
}
|
480 |
|
481 |
function ga_events_setting_snippet_type_input() {
|
489 |
$defaultOption = isset( $options[ 'snippet_type' ] ) ? $options[ 'snippet_type' ] : 'none';
|
490 |
echo "<label>Snippet type to add: " . $this->ga_tooltip( 'The Google Analytics snippet to add if any.' ) . "</label>";
|
491 |
?>
|
492 |
+
<select id="snippet_type" class='ga-gs-input' name='ga_events_options[snippet_type]'>
|
493 |
<option value="gtm" <?php selected($defaultOption, 'gtm') ?>>Google Tag Manager Container</option>
|
494 |
<option value="gst" <?php selected($defaultOption, 'gst') ?>>Global Site Tag (gtag.js)</option>
|
495 |
<option value="universal" <?php selected($defaultOption, 'universal') ?>>Universal (analytics.js)</option>
|
503 |
$options = get_option( 'ga_events_options' );
|
504 |
$gtm_id = isset( $options[ 'gtm_id' ] ) ? $options[ 'gtm_id' ] : '';
|
505 |
echo "<label>Google Tag Manager Container ID" . $this->ga_tooltip( 'Your GTM container ID, which you can get from your GTM account' ) . "</label>";
|
506 |
+
echo "<input id='gtm_id' class='ga-gs-input' name='ga_events_options[gtm_id]' type='text' value='$gtm_id' />";
|
507 |
}
|
508 |
|
509 |
function ga_events_setting_download_tracking_input() {
|
510 |
$options = get_option( 'ga_events_options' );
|
511 |
$value = isset( $options[ 'download_tracking' ] ) ? $options[ 'download_tracking' ] : '0';
|
512 |
+
echo "<br /><hr /><br /><h4>Download and Email Tracking</h4>";
|
513 |
echo "<label>Track Downloads (PDF, MP3, PPTX, DOCX): </label>";
|
514 |
+
echo "<label class='toggle-control'>";
|
515 |
echo "<input id='download_tracking' name='ga_events_options[download_tracking]' type='checkbox' value='1'" . checked( $value,
|
516 |
'1',
|
517 |
false ) . " />";
|
518 |
+
echo "<span class='control'></span>";
|
519 |
+
echo "</label>";
|
520 |
}
|
521 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
function ga_events_setting_email_link_tracking_input() {
|
523 |
$options = get_option( 'ga_events_options' );
|
524 |
$value = isset( $options[ 'email_link_tracking' ] ) ? $options[ 'email_link_tracking' ] : '0';
|
525 |
echo "<label>Track Email Links (mailto:): </label>";
|
526 |
+
echo "<label class='toggle-control'>";
|
527 |
echo "<input id='email_link_tracking' name='ga_events_options[email_link_tracking]' type='checkbox' value='1'" . checked( $value,
|
528 |
'1',
|
529 |
false ) . " />";
|
530 |
+
echo "<span class='control'></span>";
|
531 |
+
echo "</label>";
|
532 |
}
|
533 |
|
534 |
function ga_events_setting_adv_input() {
|
535 |
$options = get_option( 'ga_events_options' );
|
536 |
$value = isset( $options[ 'advanced' ] ) ? $options[ 'advanced' ] : '0';
|
537 |
+
echo "<br /><hr /><br /><h4>Advanced Settings</h4>";
|
538 |
+
echo "<label>Advanced Mode " . $this->ga_tooltip( 'Enable Advanced Selectors' ) . "</label>";
|
539 |
+
echo "<label class='toggle-control'>";
|
540 |
echo "<input id='advanced' name='ga_events_options[advanced]' type='checkbox' value='1' " . checked( $value,
|
541 |
'1',
|
542 |
false ) . " />";
|
543 |
+
echo "<span class='control'></span>";
|
544 |
+
echo "</label>";
|
545 |
}
|
546 |
|
547 |
|
557 |
$defaultOption = isset( $options[ 'force_snippet' ] ) ? $options[ 'force_snippet' ] : 'none';
|
558 |
echo $track ? "<div id='forcesnopperwrap'>" : "<div style='display:none;' id='forcesnopperwrap'>";
|
559 |
|
560 |
+
echo "<label>Force the plugin to use this code snippet: " . $this->ga_tooltip( 'Please see docs for help with deciding this option' ) . "</label>";
|
561 |
?>
|
562 |
<select id="force_snippet" name='ga_events_options[force_snippet]'>
|
563 |
<option value="gtm" <?php selected($defaultOption, 'gtm') ?>>Google Tag Manager Container</option>
|
575 |
$options = get_option( 'ga_events_options' );
|
576 |
$value = isset( $options[ 'script_debug_mode' ] ) ? $options[ 'script_debug_mode' ] : '0';
|
577 |
echo "<label>Support Friendly Scripts " . $this->ga_tooltip( 'Uncheck for script minimization' ) . "</label>";
|
578 |
+
echo "<label class='toggle-control'>";
|
579 |
echo "<input id='script_debug_mode' name='ga_events_options[script_debug_mode]' type='checkbox' value='1' " . checked( $value,
|
580 |
'1',
|
581 |
false ) . " />";
|
582 |
+
echo "<span class='control'></span>";
|
583 |
+
echo "</label>";
|
584 |
}
|
585 |
|
586 |
function ga_events_settings_download() {
|
587 |
+
echo '<br /><hr /><br /><a class="button" style="margin-right: 20px;" href="http://' . $_SERVER[ "HTTP_HOST" ] . $_SERVER[ "REQUEST_URI" ] . '&download=1">Export settings</a> <a href="#" class="button btn_upload">Import settings</a>';
|
588 |
}
|
589 |
|
590 |
function ga_events_settings_upload() {
|
591 |
+
echo '';
|
592 |
}
|
593 |
|
594 |
function ga_events_settings_confirm_general_settings_page() {
|
js/admin.js
CHANGED
@@ -37,7 +37,7 @@ jQuery(document).ready(function($){
|
|
37 |
}
|
38 |
})
|
39 |
|
40 |
-
$('#advanced:checkbox').change
|
41 |
var checked = $(this).is(':checked');
|
42 |
if (checked){
|
43 |
$('#forcesnopperwrap').show();
|
@@ -80,7 +80,7 @@ jQuery(document).ready(function($){
|
|
80 |
}
|
81 |
|
82 |
// When the snippet type option is changed
|
83 |
-
snippet_type.change
|
84 |
// Store current value
|
85 |
var val = $(this).val();
|
86 |
|
@@ -125,7 +125,7 @@ jQuery(document).ready(function($){
|
|
125 |
$('input[name="ga_events_options[permitted_roles][]"][value="administrator"]').css({'pointer-events': 'none',
|
126 |
'opacity': 0.5}).prop('checked', true);
|
127 |
|
128 |
-
$('.divs-istracktime:checkbox').change
|
129 |
var checkbox = $(this);
|
130 |
var checked = checkbox.is(':checked');
|
131 |
var index = checkbox.data('track');
|
@@ -141,7 +141,7 @@ jQuery(document).ready(function($){
|
|
141 |
|
142 |
});
|
143 |
|
144 |
-
$('#empty-istracktime:checkbox').change
|
145 |
var checkbox = $(this);
|
146 |
var checked = checkbox.is(':checked');
|
147 |
var trackValue = "#empty-trackelem";
|
37 |
}
|
38 |
})
|
39 |
|
40 |
+
$('#advanced:checkbox').on('change', function (){
|
41 |
var checked = $(this).is(':checked');
|
42 |
if (checked){
|
43 |
$('#forcesnopperwrap').show();
|
80 |
}
|
81 |
|
82 |
// When the snippet type option is changed
|
83 |
+
snippet_type.on('change', function (){
|
84 |
// Store current value
|
85 |
var val = $(this).val();
|
86 |
|
125 |
$('input[name="ga_events_options[permitted_roles][]"][value="administrator"]').css({'pointer-events': 'none',
|
126 |
'opacity': 0.5}).prop('checked', true);
|
127 |
|
128 |
+
$('.divs-istracktime:checkbox').on('change', function (){
|
129 |
var checkbox = $(this);
|
130 |
var checked = checkbox.is(':checked');
|
131 |
var index = checkbox.data('track');
|
141 |
|
142 |
});
|
143 |
|
144 |
+
$('#empty-istracktime:checkbox').on('change', function (){
|
145 |
var checkbox = $(this);
|
146 |
var checked = checkbox.is(':checked');
|
147 |
var trackValue = "#empty-trackelem";
|
js/ajax-settings.js
CHANGED
@@ -11,21 +11,20 @@ var gaeAjax = ( function ( $ ) {
|
|
11 |
}
|
12 |
|
13 |
// Form Submit
|
14 |
-
|
15 |
-
$(".wpgae-event-form").on('submit', submitEventForm);
|
16 |
// Populate and Show the edit event modal
|
17 |
-
$(".ga_main .edit a").click
|
18 |
// Populate and Show the Delete event modal
|
19 |
-
$(".ga_main .delete a").click
|
20 |
|
21 |
|
22 |
-
$('.deactivate a[href*="wp-google-analytics-events"], #wpgae-modal-cancel a').click
|
23 |
e.preventDefault();
|
24 |
$("#wpgae-modal-content, #wpgae-modal-background").toggleClass("active");
|
25 |
$("#wpgae-just-deactivate").attr("href", this.href);
|
26 |
});
|
27 |
|
28 |
-
$('#wpgae-feedback-form').submit
|
29 |
e.preventDefault(); // avoid to execute the actual submit of the form.
|
30 |
var form = $(this);
|
31 |
|
11 |
}
|
12 |
|
13 |
// Form Submit
|
14 |
+
$(".wpgae-event-form").on('submit', submitEventForm);
|
|
|
15 |
// Populate and Show the edit event modal
|
16 |
+
$(".ga_main .edit a").on('click', openAndPoplulateEventModal);
|
17 |
// Populate and Show the Delete event modal
|
18 |
+
$(".ga_main .delete a").on('click', openAndPoplulateEventModal);
|
19 |
|
20 |
|
21 |
+
$('.deactivate a[href*="wp-google-analytics-events"], #wpgae-modal-cancel a').on('click', function(e) {
|
22 |
e.preventDefault();
|
23 |
$("#wpgae-modal-content, #wpgae-modal-background").toggleClass("active");
|
24 |
$("#wpgae-just-deactivate").attr("href", this.href);
|
25 |
});
|
26 |
|
27 |
+
$('#wpgae-feedback-form').on('submit', function (e) {
|
28 |
e.preventDefault(); // avoid to execute the actual submit of the form.
|
29 |
var form = $(this);
|
30 |
|
js/dist/admin-scripts-min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){!function(e,t,a){function i(e,t){this.$form=e,this.$input=t,this.reset(),t.on("change paste",this.reset.bind(this))}var n=function(){return!1},o=null,r={numHalted:0,haltValidation:function(t){this.numHalted++,e.formUtils.haltValidation=!0,t.unbind("submit",n).bind("submit",n).find('*[type="submit"]').addClass("disabled").attr("disabled","disabled")},unHaltValidation:function(t){this.numHalted--,0===this.numHalted&&(e.formUtils.haltValidation=!1,t.unbind("submit",n).find('*[type="submit"]').removeClass("disabled").removeAttr("disabled","disabled"))}};i.prototype.reset=function(){this.haltedFormValidation=!1,this.hasRun=!1,this.isRunning=!1,this.result=void 0},i.prototype.run=function(e,t){return"keyup"===e?null:this.isRunning?(o=e,this.haltedFormValidation||(r.haltValidation(),this.haltedFormValidation=!0),null):this.hasRun?this.result:(o=e,r.haltValidation(this.$form),this.haltedFormValidation=!0,this.isRunning=!0,this.$input.attr("disabled","disabled").addClass("async-validation"),this.$form.addClass("async-validation"),t(function(e){this.done(e)}.bind(this)),null)},i.prototype.done=function(e){this.result=e,this.hasRun=!0,this.isRunning=!1,this.$input.removeAttr("disabled").removeClass("async-validation"),this.$form.removeClass("async-validation"),this.haltedFormValidation&&(r.unHaltValidation(this.$form),"submit"===o?this.$form.trigger("submit"):this.$input.trigger("validation.revalidate"))},i.loadInstance=function(e,t,a){var n,o=t.get(0);return o.asyncValidators||(o.asyncValidators={}),o.asyncValidators[e]?n=o.asyncValidators[e]:(n=new i(a,t),o.asyncValidators[e]=n),n},e.formUtils=e.extend(e.formUtils||{},{asyncValidation:function(e,t,a){return this.warn("Use of deprecated function $.formUtils.asyncValidation, use $.formUtils.addAsyncValidator() instead"),i.loadInstance(e,t,a)},addAsyncValidator:function(t){var a=e.extend({},t),n=a.validatorFunction;a.async=!0,a.validatorFunction=function(e,t,o,r,s,l){return i.loadInstance(this.name,t,s).run(l,function(i){n.apply(a,[i,e,t,o,r,s,l])})},this.addValidator(a)}}),e(t).bind("validatorsLoaded formValidationSetup",function(t,a){a||(a=e("form")),a.find("[data-validation]").each(function(){var t=e(this);t.valAttr("async",!1),e.each(e.split(t.attr("data-validation")),function(a,i){var n=e.formUtils.validators["validate_"+i];n&&n.async&&t.valAttr("async","yes")})})})}(e,window),function(e,t){"use strict";function a(t){t&&"custom"===t.errorMessagePosition&&"function"==typeof t.errorMessageCustom&&(e.formUtils.warn("Use of deprecated function errorMessageCustom, use config.submitErrorMessageCallback instead"),t.submitErrorMessageCallback=function(e,a){t.errorMessageCustom(e,t.language.errorTitle,a,t)})}function i(t){if(t.errorMessagePosition&&"object"==typeof t.errorMessagePosition){e.formUtils.warn("Deprecated use of config parameter errorMessagePosition, use config.submitErrorMessageCallback instead");var a=t.errorMessagePosition;t.errorMessagePosition="top",t.submitErrorMessageCallback=function(){return a}}}function n(t){var a={se:"sv",cz:"cs",dk:"da"};if(t.lang in a){var i=a[t.lang];e.formUtils.warn('Deprecated use of lang code "'+t.lang+'" use "'+i+'" instead'),t.lang=i}}e.fn.validateForm=function(t,a){return e.formUtils.warn("Use of deprecated function $.validateForm, use $.isValid instead"),this.isValid(t,a,!0)},e(window).on("formValidationPluginInit",function(e,t){n(t),a(t),i(t)}).on("validatorsLoaded formValidationSetup",function(t,a){a||(a=e("form")),function(t){var a=t.find("[data-validation-if-checked]");a.length&&e.formUtils.warn('Detected use of attribute "data-validation-if-checked" which is deprecated. Use "data-validation-depends-on" provided by module "logic"'),a.on("beforeValidation",function(){var a=e(this),i=a.valAttr("if-checked"),n=e('input[name="'+i+'"]',t),o=n.is(":checked"),r=(e.formUtils.getValue(n)||"").toString(),s=a.valAttr("if-checked-value");(!o||s&&s!==r)&&a.valAttr("skipped",!0)})}(a)})}(e),function(e){"use strict";var t={resolveErrorMessage:function(e,t,a,i,n){var o=i.validationErrorMsgAttribute+"-"+a.replace("validate_",""),r=e.attr(o);return r||((r=e.attr(i.validationErrorMsgAttribute))||((r="function"!=typeof t.errorMessageKey?n[t.errorMessageKey]:n[t.errorMessageKey(i)])||(r=t.errorMessage))),r},getParentContainer:function(t){if(t.valAttr("error-msg-container"))return e(t.valAttr("error-msg-container"));var a=t.parent();return"checkbox"===t.attr("type")&&t.closest(".checkbox").length?a=t.closest(".checkbox").parent():"radio"===t.attr("type")&&t.closest(".radio").length&&(a=t.closest(".radio").parent()),a.closest(".input-group").length&&(a=a.closest(".input-group").parent()),a},applyInputErrorStyling:function(e,t){e.addClass(t.errorElementClass).removeClass(t.successElementClass),this.getParentContainer(e).addClass(t.inputParentClassOnError).removeClass(t.inputParentClassOnSuccess),""!==t.borderColorOnError&&e.css("border-color",t.borderColorOnError)},applyInputSuccessStyling:function(e,t){e.addClass(t.successElementClass),this.getParentContainer(e).addClass(t.inputParentClassOnSuccess)},removeInputStylingAndMessage:function(e,a){e.removeClass(a.successElementClass).removeClass(a.errorElementClass).css("border-color","");var i=t.getParentContainer(e);if(i.removeClass(a.inputParentClassOnError).removeClass(a.inputParentClassOnSuccess),"function"==typeof a.inlineErrorMessageCallback){var n=a.inlineErrorMessageCallback(e,!1,a);n&&n.html("")}else i.find("."+a.errorMessageClass).remove()},removeAllMessagesAndStyling:function(a,i){if("function"==typeof i.submitErrorMessageCallback){var n=i.submitErrorMessageCallback(a,!1,i);n&&n.html("")}else a.find("."+i.errorMessageClass+".alert").remove();a.find("."+i.errorElementClass+",."+i.successElementClass).each(function(){t.removeInputStylingAndMessage(e(this),i)})},setInlineMessage:function(t,a,i){this.applyInputErrorStyling(t,i);var n,o=document.getElementById(t.attr("name")+"_err_msg"),r=!1,s=function(i){e.formUtils.$win.trigger("validationErrorDisplay",[t,i]),i.html(a)},l=function(){var o=!1;r.find("."+i.errorMessageClass).each(function(){if(this.inputReferer===t[0])return o=e(this),!1}),o?a?s(o):o.remove():""!==a&&(n=e('<div class="'+i.errorMessageClass+' alert"></div>'),s(n),n[0].inputReferer=t[0],r.prepend(n))};if(o)e.formUtils.warn("Using deprecated element reference "+o.id),r=e(o),l();else if("function"==typeof i.inlineErrorMessageCallback){if(!(r=i.inlineErrorMessageCallback(t,a,i)))return;l()}else{var d=this.getParentContainer(t);0===(n=d.find("."+i.errorMessageClass+".help-block")).length&&(n=e("<span></span>").addClass("help-block").addClass(i.errorMessageClass)).appendTo(d),s(n)}},setMessageInTopOfForm:function(t,a,i,n){var o='<div class="{errorMessageClass} alert alert-danger"><strong>{errorTitle}</strong><ul>{fields}</ul></div>',r=!1;if("function"!=typeof i.submitErrorMessageCallback||(r=i.submitErrorMessageCallback(t,a,i))){var s={errorTitle:n.errorTitle,fields:"",errorMessageClass:i.errorMessageClass};e.each(a,function(e,t){s.fields+="<li>"+t+"</li>"}),e.each(s,function(e,t){o=o.replace("{"+e+"}",t)}),r?r.html(o):t.children().eq(0).before(e(o))}}};e.formUtils=e.extend(e.formUtils||{},{dialogs:t})}(e),function(e,t,a){"use strict";var i=0;e.fn.validateOnBlur=function(t,a){var i=this,n=this.find("*[data-validation]");return n.each(function(){var n=e(this);if(n.is("[type=radio]")){var o=i.find('[type=radio][name="'+n.attr("name")+'"]');o.bind("blur.validation",function(){n.validateInputOnBlur(t,a,!0,"blur")}),a.validateCheckboxRadioOnClick&&o.bind("click.validation",function(){n.validateInputOnBlur(t,a,!0,"click")})}}),n.bind("blur.validation",function(){e(this).validateInputOnBlur(t,a,!0,"blur")}),a.validateCheckboxRadioOnClick&&this.find("input[type=checkbox][data-validation],input[type=radio][data-validation]").bind("click.validation",function(){e(this).validateInputOnBlur(t,a,!0,"click")}),this},e.fn.validateOnEvent=function(t,a){if(0!==this.length)return("FORM"===this[0].nodeName?this.find("*[data-validation-event]"):this).each(function(){var i=e(this),n=i.valAttr("event");n&&i.unbind(n+".validation").bind(n+".validation",function(i){9!==(i||{}).keyCode&&e(this).validateInputOnBlur(t,a,!0,n)})}),this},e.fn.showHelpOnFocus=function(t){return t||(t="data-validation-help"),this.find("textarea,input").each(function(){var a=e(this),n="jquery_form_help_"+ ++i,o=a.attr(t);a.removeClass("has-help-text").unbind("focus.help").unbind("blur.help"),o&&a.addClass("has-help-txt").bind("focus.help",function(){var t=a.parent().find("."+n);0===t.length&&(t=e("<span />").addClass(n).addClass("help").addClass("help-block").text(o).hide(),a.after(t)),t.fadeIn()}).bind("blur.help",function(){e(this).parent().find("."+n).fadeOut("slow")})}),this},e.fn.validate=function(t,a,i){var n=e.extend({},e.formUtils.LANG,i||{});this.each(function(){var i=e(this),o=(i.closest("form").get(0)||{}).validationConfig||e.formUtils.defaultConfig();i.one("validation",function(e,a){"function"==typeof t&&t(a,this,e)}),i.validateInputOnBlur(n,e.extend({},o,a||{}),!0)})},e.fn.willPostponeValidation=function(){return(this.valAttr("suggestion-nr")||this.valAttr("postpone")||this.hasClass("hasDatepicker"))&&!t.postponedValidation},e.fn.validateInputOnBlur=function(a,i,n,o){if(e.formUtils.eventType=o,this.willPostponeValidation()){var r=this,s=this.valAttr("postpone")||200;return t.postponedValidation=function(){r.validateInputOnBlur(a,i,n,o),t.postponedValidation=!1},setTimeout(function(){t.postponedValidation&&t.postponedValidation()},s),this}a=e.extend({},e.formUtils.LANG,a||{}),e.formUtils.dialogs.removeInputStylingAndMessage(this,i);var l=this,d=l.closest("form"),u=e.formUtils.validateInput(l,a,i,d,o),c=function(){l.validateInputOnBlur(a,i,!1,"blur.revalidated")};return"blur"===o&&l.unbind("validation.revalidate",c).one("validation.revalidate",c),n&&l.removeKeyUpValidation(),u.shouldChangeDisplay&&(u.isValid?e.formUtils.dialogs.applyInputSuccessStyling(l,i):e.formUtils.dialogs.setInlineMessage(l,u.errorMsg,i)),!u.isValid&&n&&l.validateOnKeyUp(a,i),this},e.fn.validateOnKeyUp=function(t,a){return this.each(function(){var i=e(this);i.valAttr("has-keyup-event")||i.valAttr("has-keyup-event","true").bind("keyup.validation",function(e){9!==e.keyCode&&i.validateInputOnBlur(t,a,!1,"keyup")})}),this},e.fn.removeKeyUpValidation=function(){return this.each(function(){e(this).valAttr("has-keyup-event",!1).unbind("keyup.validation")}),this},e.fn.valAttr=function(e,t){return void 0===t?this.attr("data-validation-"+e):!1===t||null===t?this.removeAttr("data-validation-"+e):(e=e.length>0?"-"+e:"",this.attr("data-validation"+e,t))},e.fn.isValid=function(t,a,i){if(e.formUtils.isLoadingModules){var n=this;return setTimeout(function(){n.isValid(t,a,i)},200),null}a=e.extend({},e.formUtils.defaultConfig(),a||{}),t=e.extend({},e.formUtils.LANG,t||{}),i=!1!==i,e.formUtils.errorDisplayPreventedWhenHalted&&(delete e.formUtils.errorDisplayPreventedWhenHalted,i=!1);var o=function(t,n){e.inArray(t,s)<0&&s.push(t),l.push(n),n.valAttr("current-error",t),i&&e.formUtils.dialogs.applyInputErrorStyling(n,a)},r=[],s=[],l=[],d=this;if(i&&e.formUtils.dialogs.removeAllMessagesAndStyling(d,a),d.find("input,textarea,select").filter(':not([type="submit"],[type="button"])').each(function(){var i=e(this),n=i.attr("type"),s="radio"===n||"checkbox"===n,l=i.attr("name");if(!function(t,i){return"submit"===i||"button"===i||"reset"===i||e.inArray(t,a.ignore||[])>-1}(l,n)&&(!s||e.inArray(l,r)<0)){s&&r.push(l);var u=e.formUtils.validateInput(i,t,a,d,"submit");u.isValid?u.isValid&&u.shouldChangeDisplay&&(i.valAttr("current-error",!1),e.formUtils.dialogs.applyInputSuccessStyling(i,a)):o(u.errorMsg,i)}}),"function"==typeof a.onValidate){var u=a.onValidate(d);e.isArray(u)?e.each(u,function(e,t){o(t.message,t.element)}):u&&u.element&&u.message&&o(u.message,u.element)}return e.formUtils.isValidatingEntireForm=!1,l.length>0&&i&&("top"===a.errorMessagePosition?e.formUtils.dialogs.setMessageInTopOfForm(d,s,a,t):e.each(l,function(t,i){e.formUtils.dialogs.setInlineMessage(i,i.valAttr("current-error"),a)}),a.scrollToTopOnError&&e.formUtils.$win.scrollTop(d.offset().top-20)),!i&&e.formUtils.haltValidation&&(e.formUtils.errorDisplayPreventedWhenHalted=!0),0===l.length&&!e.formUtils.haltValidation},e.fn.restrictLength=function(t){return new e.formUtils.lengthRestriction(this,t),this},e.fn.addSuggestions=function(t){var a=!1;return this.find("input").each(function(){var i=e(this);(a=e.split(i.attr("data-suggestions"))).length>0&&!i.hasClass("has-suggestions")&&(e.formUtils.suggest(i,a,t),i.addClass("has-suggestions"))}),this}}(e,window),function(e){"use strict";e.formUtils=e.extend(e.formUtils||{},{isLoadingModules:!1,loadedModules:{},registerLoadedModule:function(t){this.loadedModules[e.trim(t).toLowerCase()]=!0},hasLoadedModule:function(t){return e.trim(t).toLowerCase()in this.loadedModules},loadModules:function(t,a,i){if(e.formUtils.isLoadingModules)setTimeout(function(){e.formUtils.loadModules(t,a,i)},100);else{var n=function(t,a){var n=e.split(t),o=n.length,r=function(){0===--o&&(e.formUtils.isLoadingModules=!1,"function"==typeof i&&i())};o>0&&(e.formUtils.isLoadingModules=!0);var s="?_="+(new Date).getTime(),l=document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0];e.each(n,function(t,i){if(0===(i=e.trim(i)).length||e.formUtils.hasLoadedModule(i))r();else{var n=a+i+(".js"===i.slice(-3)?"":".js"),o=document.createElement("SCRIPT");"function"==typeof define&&define.amd?require([n+(".dev.js"===n.slice(-7)?s:"")],r):(o.type="text/javascript",o.onload=r,o.src=n+(".dev.js"===n.slice(-7)?s:""),o.onerror=function(){e.formUtils.warn("Unable to load form validation module "+n,!0),r()},o.onreadystatechange=function(){"complete"!==this.readyState&&"loaded"!==this.readyState||(r(),this.onload=null,this.onreadystatechange=null)},l.appendChild(o))}})};if(a)n(t,a);else{var o=function(){var a=!1;return e('script[src*="form-validator"]').each(function(){if(!(this.src.split("form-validator")[1].split("node_modules").length>1))return"/"===(a=this.src.substr(0,this.src.lastIndexOf("/"))+"/")&&(a=""),!1}),!1!==a&&(n(t,a),!0)};o()||e(function(){o()||"function"==typeof i&&i()})}}}})}(e),function(e){"use strict";e.split=function(t,a,i){i=void 0===i||!0===i;var n=new RegExp("[,|"+(i?"\\s":"")+"-]\\s*","g");if("function"!=typeof a){if(!t)return[];var o=[];return e.each(t.split(a||n),function(t,a){(a=e.trim(a)).length&&o.push(a)}),o}t&&e.each(t.split(n),function(t,i){if((i=e.trim(i)).length)return a(i,t)})},e.validate=function(t){var a=e.extend(e.formUtils.defaultConfig(),{form:"form",validateOnEvent:!1,validateOnBlur:!0,validateCheckboxRadioOnClick:!0,showHelpOnFocus:!0,addSuggestions:!0,modules:"",onModulesLoaded:null,language:!1,onSuccess:!1,onError:!1,onElementValidate:!1});if(t=e.extend(a,t||{}),e(window).trigger("formValidationPluginInit",[t]),t.lang&&"en"!==t.lang){var i="lang/"+t.lang+".js";t.modules+=t.modules.length?","+i:i}e(t.form).each(function(a,i){i.validationConfig=t;var n=e(i);n.trigger("formValidationSetup",[n,t]),n.find(".has-help-txt").unbind("focus.validation").unbind("blur.validation"),n.removeClass("has-validation-callback").unbind("submit.validation").unbind("reset.validation").find("input[data-validation],textarea[data-validation]").unbind("blur.validation"),n.bind("submit.validation",function(a){var i=e(this),n=function(){return a.stopImmediatePropagation(),!1};if(e.formUtils.haltValidation)return n();if(e.formUtils.isLoadingModules)return setTimeout(function(){i.trigger("submit.validation")},200),n();var o=i.isValid(t.language,t);return e.formUtils.haltValidation?n():o&&"function"==typeof t.onSuccess?!1===t.onSuccess(i)?n():void 0:o||"function"!=typeof t.onError?!!o||n():(t.onError(i),n())}).bind("reset.validation",function(){e.formUtils.dialogs.removeAllMessagesAndStyling(n,t)}).addClass("has-validation-callback"),t.showHelpOnFocus&&n.showHelpOnFocus(),t.addSuggestions&&n.addSuggestions(),t.validateOnBlur&&(n.validateOnBlur(t.language,t),n.bind("html5ValidationAttrsFound",function(){n.validateOnBlur(t.language,t)})),t.validateOnEvent&&n.validateOnEvent(t.language,t)}),""!==t.modules&&e.formUtils.loadModules(t.modules,null,function(){"function"==typeof t.onModulesLoaded&&t.onModulesLoaded();var a="string"==typeof t.form?e(t.form):t.form;e.formUtils.$win.trigger("validatorsLoaded",[a,t])})}}(e),function(e,t){"use strict";var a=e(t);e.formUtils=e.extend(e.formUtils||{},{$win:a,defaultConfig:function(){return{ignore:[],errorElementClass:"error",successElementClass:"valid",borderColorOnError:"#b94a48",errorMessageClass:"form-error",validationRuleAttribute:"data-validation",validationErrorMsgAttribute:"data-validation-error-msg",errorMessagePosition:"inline",errorMessageTemplate:{container:'<div class="{errorMessageClass} alert alert-danger">{messages}</div>',messages:"<strong>{errorTitle}</strong><ul>{fields}</ul>",field:"<li>{msg}</li>"},scrollToTopOnError:!0,dateFormat:"yyyy-mm-dd",addValidClassOnAll:!1,decimalSeparator:".",inputParentClassOnError:"has-error",inputParentClassOnSuccess:"has-success",validateHiddenInputs:!1,inlineErrorMessageCallback:!1,submitErrorMessageCallback:!1}},validators:{},sanitizers:{},_events:{load:[],valid:[],invalid:[]},haltValidation:!1,addValidator:function(e){var t=0===e.name.indexOf("validate_")?e.name:"validate_"+e.name;void 0===e.validateOnKeyUp&&(e.validateOnKeyUp=!0),this.validators[t]=e},addSanitizer:function(e){this.sanitizers[e.name]=e},warn:function(e,a){"console"in t?"function"==typeof t.console.warn?t.console.warn(e):"function"==typeof t.console.log&&t.console.log(e):a&&alert(e)},getValue:function(e,t){var a=t?t.find(e):e;if(a.length>0){var i=a.eq(0).attr("type");return"radio"===i||"checkbox"===i?a.filter(":checked").val()||"":a.val()||""}return!1},validateInput:function(t,a,i,n,o){i=i||e.formUtils.defaultConfig(),a=a||e.formUtils.LANG,n.length||(n=t.parent());var r=this.getValue(t);t.valAttr("skipped",!1).one("beforeValidation",function(){(t.attr("disabled")||!t.is(":visible")&&!i.validateHiddenInputs)&&t.valAttr("skipped",1)}).trigger("beforeValidation",[r,a,i]);var s="true"===t.valAttr("optional"),l=!r&&s,d=t.attr(i.validationRuleAttribute),u=!0,c="",f={isValid:!0,shouldChangeDisplay:!0,errorMsg:""};if(!d||l||t.valAttr("skipped"))return f.shouldChangeDisplay=i.addValidClassOnAll,f;var h=t.valAttr("ignore");return h&&e.each(h.split(""),function(e,t){r=r.replace(new RegExp("\\"+t,"g"),"")}),e.split(d,function(s){0!==s.indexOf("validate_")&&(s="validate_"+s);var l=e.formUtils.validators[s];if(!l)throw new Error('Using undefined validator "'+s+'". Maybe you have forgotten to load the module that "'+s+'" belongs to?');if("validate_checkbox_group"===s&&(t=n.find('[name="'+t.attr("name")+'"]:eq(0)')),("keyup"!==o||l.validateOnKeyUp)&&(u=l.validatorFunction(r,t,i,a,n,o)),!u)return i.validateOnBlur&&t.validateOnKeyUp(a,i),c=e.formUtils.dialogs.resolveErrorMessage(t,l,s,i,a),!1}),!1===u?(t.trigger("validation",!1),f.errorMsg=c,f.isValid=!1,f.shouldChangeDisplay=!0):null===u?f.shouldChangeDisplay=!1:(t.trigger("validation",!0),f.shouldChangeDisplay=!0),"function"==typeof i.onElementValidate&&null!==c&&i.onElementValidate(f.isValid,t,n,c),t.trigger("afterValidation",[f,o]),f},parseDate:function(t,a,i){var n,o,r,s,l=a.replace(/[a-zA-Z]/gi,"").substring(0,1),d="^",u=a.split(l||null);if(e.each(u,function(e,t){d+=(e>0?"\\"+l:"")+"(\\d{"+t.length+"})"}),d+="$",i){var c=[];e.each(t.split(l),function(e,t){1===t.length&&(t="0"+t),c.push(t)}),t=c.join(l)}if(null===(n=t.match(new RegExp(d))))return!1;var f=function(t,a,i){for(var n=0;n<a.length;n++)if(a[n].substring(0,1)===t)return e.formUtils.parseDateInt(i[n+1]);return-1};return r=f("m",u,n),o=f("d",u,n),s=f("y",u,n),!(2===r&&o>28&&(s%4!=0||s%100==0&&s%400!=0)||2===r&&o>29&&(s%4==0||s%100!=0&&s%400==0)||r>12||0===r)&&!(this.isShortMonth(r)&&o>30||!this.isShortMonth(r)&&o>31||0===o)&&[s,r,o]},parseDateInt:function(e){return 0===e.indexOf("0")&&(e=e.replace("0","")),parseInt(e,10)},isShortMonth:function(e){return e%2==0&&e<7||e%2!=0&&e>7},lengthRestriction:function(t,a){var i=parseInt(a.text(),10),n=0,o=function(){var e=t.val().length;if(e>i){var o=t.scrollTop();t.val(t.val().substring(0,i)),t.scrollTop(o)}(n=i-e)<0&&(n=0),a.text(n)};e(t).bind("keydown keyup keypress focus blur",o).bind("cut paste",function(){setTimeout(o,100)}),e(document).bind("ready",o)},numericRangeCheck:function(t,a){var i=e.split(a),n=parseInt(a.substr(3),10);return 1===i.length&&-1===a.indexOf("min")&&-1===a.indexOf("max")&&(i=[a,a]),2===i.length&&(t<parseInt(i[0],10)||t>parseInt(i[1],10))?["out",i[0],i[1]]:0===a.indexOf("min")&&t<n?["min",n]:0===a.indexOf("max")&&t>n?["max",n]:["ok"]},_numSuggestionElements:0,_selectedSuggestion:null,_previousTypedVal:null,suggest:function(t,i,n){var o={css:{maxHeight:"150px",background:"#FFF",lineHeight:"150%",textDecoration:"underline",overflowX:"hidden",overflowY:"auto",border:"#CCC solid 1px",borderTop:"none",cursor:"pointer"},activeSuggestionCSS:{background:"#E9E9E9"}},r=function(e,t){var a=t.offset();e.css({width:t.outerWidth(),left:a.left+"px",top:a.top+t.outerHeight()+"px"})};n&&e.extend(o,n),o.css.position="absolute",o.css["z-index"]=9999,t.attr("autocomplete","off"),0===this._numSuggestionElements&&a.bind("resize",function(){e(".jquery-form-suggestions").each(function(){var t=e(this),a=t.attr("data-suggest-container");r(t,e(".suggestions-"+a).eq(0))})}),this._numSuggestionElements++;var s=function(t){var a=t.valAttr("suggestion-nr");e.formUtils._selectedSuggestion=null,e.formUtils._previousTypedVal=null,e(".jquery-form-suggestion-"+a).fadeOut("fast")};return t.data("suggestions",i).valAttr("suggestion-nr",this._numSuggestionElements).unbind("focus.suggest").bind("focus.suggest",function(){e(this).trigger("keyup"),e.formUtils._selectedSuggestion=null}).unbind("keyup.suggest").bind("keyup.suggest",function(){var a=e(this),i=[],n=e.trim(a.val()).toLocaleLowerCase();if(n!==e.formUtils._previousTypedVal){e.formUtils._previousTypedVal=n;var l=!1,d=a.valAttr("suggestion-nr"),u=e(".jquery-form-suggestion-"+d);if(u.scrollTop(0),""!==n){var c=n.length>2;e.each(a.data("suggestions"),function(e,t){var a=t.toLocaleLowerCase();return a===n?(i.push("<strong>"+t+"</strong>"),l=!0,!1):void((0===a.indexOf(n)||c&&a.indexOf(n)>-1)&&i.push(t.replace(new RegExp(n,"gi"),"<strong>$&</strong>")))})}l||0===i.length&&u.length>0?u.hide():i.length>0&&0===u.length?(u=e("<div></div>").css(o.css).appendTo("body"),t.addClass("suggestions-"+d),u.attr("data-suggest-container",d).addClass("jquery-form-suggestions").addClass("jquery-form-suggestion-"+d)):i.length>0&&!u.is(":visible")&&u.show(),i.length>0&&n.length!==i[0].length&&(r(u,a),u.html(""),e.each(i,function(t,i){e("<div></div>").append(i).css({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"5px"}).addClass("form-suggest-element").appendTo(u).click(function(){a.focus(),a.val(e(this).text()),a.trigger("change"),s(a)})}))}}).unbind("keydown.validation").bind("keydown.validation",function(t){var a,i,n=t.keyCode?t.keyCode:t.which,r=e(this);if(13===n&&null!==e.formUtils._selectedSuggestion){if(a=r.valAttr("suggestion-nr"),(i=e(".jquery-form-suggestion-"+a)).length>0){var l=i.find("div").eq(e.formUtils._selectedSuggestion).text();r.val(l),r.trigger("change"),s(r),t.preventDefault()}}else{a=r.valAttr("suggestion-nr");var d=(i=e(".jquery-form-suggestion-"+a)).children();if(d.length>0&&e.inArray(n,[38,40])>-1){38===n?(null===e.formUtils._selectedSuggestion?e.formUtils._selectedSuggestion=d.length-1:e.formUtils._selectedSuggestion--,e.formUtils._selectedSuggestion<0&&(e.formUtils._selectedSuggestion=d.length-1)):40===n&&(null===e.formUtils._selectedSuggestion?e.formUtils._selectedSuggestion=0:e.formUtils._selectedSuggestion++,e.formUtils._selectedSuggestion>d.length-1&&(e.formUtils._selectedSuggestion=0));var u=i.innerHeight(),c=i.scrollTop(),f=i.children().eq(0).outerHeight()*e.formUtils._selectedSuggestion;return(f<c||f>c+u)&&i.scrollTop(f),d.removeClass("active-suggestion").css("background","none").eq(e.formUtils._selectedSuggestion).addClass("active-suggestion").css(o.activeSuggestionCSS),t.preventDefault(),!1}}}).unbind("blur.suggest").bind("blur.suggest",function(){s(e(this))}),t},LANG:{errorTitle:"Form submission failed!",requiredField:"This is a required field",requiredFields:"You have not answered all required fields",badTime:"You have not given a correct time",badEmail:"You have not given a correct e-mail address",badTelephone:"You have not given a correct phone number",badSecurityAnswer:"You have not given a correct answer to the security question",badDate:"You have not given a correct date",lengthBadStart:"The input value must be between ",lengthBadEnd:" characters",lengthTooLongStart:"The input value is longer than ",lengthTooShortStart:"The input value is shorter than ",notConfirmed:"Input values could not be confirmed",badDomain:"Incorrect domain value",badUrl:"The input value is not a correct URL",badCustomVal:"The input value is incorrect",andSpaces:" and spaces ",badInt:"The input value was not a correct number",badSecurityNumber:"Your social security number was incorrect",badUKVatAnswer:"Incorrect UK VAT Number",badUKNin:"Incorrect UK NIN",badUKUtr:"Incorrect UK UTR Number",badStrength:"The password isn't strong enough",badNumberOfSelectedOptionsStart:"You have to choose at least ",badNumberOfSelectedOptionsEnd:" answers",badAlphaNumeric:"The input value can only contain alphanumeric characters ",badAlphaNumericExtra:" and ",wrongFileSize:"The file you are trying to upload is too large (max %s)",wrongFileType:"Only files of type %s is allowed",groupCheckedRangeStart:"Please choose between ",groupCheckedTooFewStart:"Please choose at least ",groupCheckedTooManyStart:"Please choose a maximum of ",groupCheckedEnd:" item(s)",badCreditCard:"The credit card number is not correct",badCVV:"The CVV number was not correct",wrongFileDim:"Incorrect image dimensions,",imageTooTall:"the image can not be taller than",imageTooWide:"the image can not be wider than",imageTooSmall:"the image was too small",min:"min",max:"max",imageRatioNotAccepted:"Image ratio is not be accepted",badBrazilTelephoneAnswer:"The phone number entered is invalid",badBrazilCEPAnswer:"The CEP entered is invalid",badBrazilCPFAnswer:"The CPF entered is invalid",badPlPesel:"The PESEL entered is invalid",badPlNip:"The NIP entered is invalid",badPlRegon:"The REGON entered is invalid",badreCaptcha:"Please confirm that you are not a bot",passwordComplexityStart:"Password must contain at least ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" uppercase letter(s)",passwordComplexityLowercaseInfo:" lowercase letter(s)",passwordComplexitySpecialCharsInfo:" special character(s)",passwordComplexityNumericCharsInfo:" numeric character(s)",passwordComplexityEnd:"."}})}(e,window),function(e){e.formUtils.addValidator({name:"email",validatorFunction:function(t){var a=t.toLowerCase().split("@"),i=a[0],n=a[1];if(i&&n){if(0===i.indexOf('"')){var o=i.length;if((i=i.replace(/\"/g,"")).length!==o-2)return!1}return e.formUtils.validators.validate_domain.validatorFunction(a[1])&&0!==i.indexOf(".")&&"."!==i.substring(i.length-1,i.length)&&-1===i.indexOf("..")&&!/[^\w\+\.\-\#\-\_\~\!\$\&\'\(\)\*\+\,\;\=\:]/.test(i)}return!1},errorMessage:"",errorMessageKey:"badEmail"}),e.formUtils.addValidator({name:"domain",validatorFunction:function(e){return e.length>0&&e.length<=253&&!/[^a-zA-Z0-9]/.test(e.slice(-2))&&!/[^a-zA-Z0-9]/.test(e.substr(0,1))&&!/[^a-zA-Z0-9\.\-]/.test(e)&&1===e.split("..").length&&e.split(".").length>1},errorMessage:"",errorMessageKey:"badDomain"}),e.formUtils.addValidator({name:"required",validatorFunction:function(t,a,i,n,o){switch(a.attr("type")){case"checkbox":return a.is(":checked");case"radio":return o.find('input[name="'+a.attr("name")+'"]').filter(":checked").length>0;default:return""!==e.trim(t)}},errorMessage:"",errorMessageKey:function(e){return"top"===e.errorMessagePosition||"function"==typeof e.errorMessagePosition?"requiredFields":"requiredField"}}),e.formUtils.addValidator({name:"length",validatorFunction:function(t,a,i,n){var o=a.valAttr("length"),r=a.attr("type");if(void 0===o)return alert('Please add attribute "data-validation-length" to '+a[0].nodeName+" named "+a.attr("name")),!0;var s,l="file"===r&&void 0!==a.get(0).files?a.get(0).files.length:t.length,d=e.formUtils.numericRangeCheck(l,o);switch(d[0]){case"out":this.errorMessage=n.lengthBadStart+o+n.lengthBadEnd,s=!1;break;case"min":this.errorMessage=n.lengthTooShortStart+d[1]+n.lengthBadEnd,s=!1;break;case"max":this.errorMessage=n.lengthTooLongStart+d[1]+n.lengthBadEnd,s=!1;break;default:s=!0}return s},errorMessage:"",errorMessageKey:""}),e.formUtils.addValidator({name:"url",validatorFunction:function(t){if(/^(https?|ftp):\/\/((((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])(\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])(\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|\[|\]|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(t)){var a=t.split("://")[1],i=a.indexOf("/");return i>-1&&(a=a.substr(0,i)),e.formUtils.validators.validate_domain.validatorFunction(a)}return!1},errorMessage:"",errorMessageKey:"badUrl"}),e.formUtils.addValidator({name:"number",validatorFunction:function(e,t,a){if(""!==e){var i,n,o=t.valAttr("allowing")||"",r=t.valAttr("decimal-separator")||a.decimalSeparator,s=!1,l=t.valAttr("step")||"",d=!1;if((t.attr("data-sanitize")||"").match(/(^|[\s])numberFormat([\s]|$)/i)){if(!window.numeral)throw new ReferenceError("The data-sanitize value numberFormat cannot be used without the numeral library. Please see Data Validation in http://www.formvalidator.net for more information.");e.length&&(e=String(numeral().unformat(e)))}if(-1===o.indexOf("number")&&(o+=",number"),-1===o.indexOf("negative")&&0===e.indexOf("-"))return!1;if(o.indexOf("range")>-1&&(i=parseFloat(o.substring(o.indexOf("[")+1,o.indexOf(";"))),n=parseFloat(o.substring(o.indexOf(";")+1,o.indexOf("]"))),s=!0),""!==l&&(d=!0),","===r){if(e.indexOf(".")>-1)return!1;e=e.replace(",",".")}if(""===e.replace(/[0-9-]/g,"")&&(!s||e>=i&&e<=n)&&(!d||e%l==0))return!0;if(o.indexOf("float")>-1&&null!==e.match(new RegExp("^([0-9-]+)\\.([0-9]+)$"))&&(!s||e>=i&&e<=n)&&(!d||e%l==0))return!0}return!1},errorMessage:"",errorMessageKey:"badInt"}),e.formUtils.addValidator({name:"alphanumeric",validatorFunction:function(t,a,i,n){var o="^([a-zA-Z0-9",r="]+)$",s=a.valAttr("allowing"),l="",d=!1;if(s){l=o+s+r;var u=s.replace(/\\/g,"");u.indexOf(" ")>-1&&(d=!0,u=u.replace(" ",""),u+=n.andSpaces||e.formUtils.LANG.andSpaces),n.badAlphaNumericAndExtraAndSpaces&&n.badAlphaNumericAndExtra?this.errorMessage=d?n.badAlphaNumericAndExtraAndSpaces+u:n.badAlphaNumericAndExtra+u+n.badAlphaNumericExtra:this.errorMessage=n.badAlphaNumeric+n.badAlphaNumericExtra+u}else l=o+r,this.errorMessage=n.badAlphaNumeric;return new RegExp(l).test(t)},errorMessage:"",errorMessageKey:""}),e.formUtils.addValidator({name:"custom",validatorFunction:function(e,t){return new RegExp(t.valAttr("regexp")).test(e)},errorMessage:"",errorMessageKey:"badCustomVal"}),e.formUtils.addValidator({name:"date",validatorFunction:function(t,a,i){var n=a.valAttr("format")||i.dateFormat||"yyyy-mm-dd",o="false"===a.valAttr("require-leading-zero");return!1!==e.formUtils.parseDate(t,n,o)},errorMessage:"",errorMessageKey:"badDate"}),e.formUtils.addValidator({name:"checkbox_group",validatorFunction:function(t,a,i,n,o){var r=!0,s=a.attr("name"),l=e('input[type=checkbox][name^="'+s+'"]',o),d=l.filter(":checked").length,u=a.valAttr("qty");if(void 0===u){var c=a.get(0).nodeName;alert('Attribute "data-validation-qty" is missing from '+c+" named "+a.attr("name"))}var f=e.formUtils.numericRangeCheck(d,u);switch(f[0]){case"out":this.errorMessage=n.groupCheckedRangeStart+u+n.groupCheckedEnd,r=!1;break;case"min":this.errorMessage=n.groupCheckedTooFewStart+f[1]+(n.groupCheckedTooFewEnd||n.groupCheckedEnd),r=!1;break;case"max":this.errorMessage=n.groupCheckedTooManyStart+f[1]+(n.groupCheckedTooManyEnd||n.groupCheckedEnd),r=!1;break;default:r=!0}if(!r){var h=function(){l.unbind("click",h),l.filter("*[data-validation]").validateInputOnBlur(n,i,!1,"blur")};l.bind("click",h)}return r}})}(e)}),function(e){"object"==typeof module&&"object"==typeof module.exports?e(require("jquery"),window,document):e(jQuery,window,document)}(function(e,t,a,i){var n=[],o=function(){return n.length?n[n.length-1]:null},r=function(){var e,t=!1;for(e=n.length-1;e>=0;e--)n[e].$blocker&&(n[e].$blocker.toggleClass("current",!t).toggleClass("behind",t),t=!0)};e.modal=function(t,a){var i,r;if(this.$body=e("body"),this.options=e.extend({},e.modal.defaults,a),this.options.doFade=!isNaN(parseInt(this.options.fadeDuration,10)),this.$blocker=null,this.options.closeExisting)for(;e.modal.isActive();)e.modal.close();if(n.push(this),t.is("a"))if(r=t.attr("href"),this.anchor=t,/^#/.test(r)){if(this.$elm=e(r),1!==this.$elm.length)return null;this.$body.append(this.$elm),this.open()}else this.$elm=e("<div>"),this.$body.append(this.$elm),i=function(e,t){t.elm.remove()},this.showSpinner(),t.trigger(e.modal.AJAX_SEND),e.get(r).done(function(a){if(e.modal.isActive()){t.trigger(e.modal.AJAX_SUCCESS);var n=o();n.$elm.empty().append(a).on(e.modal.CLOSE,i),n.hideSpinner(),n.open(),t.trigger(e.modal.AJAX_COMPLETE)}}).fail(function(){t.trigger(e.modal.AJAX_FAIL),o().hideSpinner(),n.pop(),t.trigger(e.modal.AJAX_COMPLETE)});else this.$elm=t,this.anchor=t,this.$body.append(this.$elm),this.open()},e.modal.prototype={constructor:e.modal,open:function(){var t=this;this.block(),this.anchor.blur(),this.options.doFade?setTimeout(function(){t.show()},this.options.fadeDuration*this.options.fadeDelay):this.show(),e(a).off("keydown.modal").on("keydown.modal",function(e){var t=o();27===e.which&&t.options.escapeClose&&t.close()}),this.options.clickClose&&this.$blocker.click(function(t){t.target===this&&e.modal.close()})},close:function(){n.pop(),this.unblock(),this.hide(),e.modal.isActive()||e(a).off("keydown.modal")},block:function(){this.$elm.trigger(e.modal.BEFORE_BLOCK,[this._ctx()]),this.$body.css("overflow","hidden"),this.$blocker=e('<div class="'+this.options.blockerClass+' blocker current"></div>').appendTo(this.$body),r(),this.options.doFade&&this.$blocker.css("opacity",0).animate({opacity:1},this.options.fadeDuration),this.$elm.trigger(e.modal.BLOCK,[this._ctx()])},unblock:function(t){!t&&this.options.doFade?this.$blocker.fadeOut(this.options.fadeDuration,this.unblock.bind(this,!0)):(this.$blocker.children().appendTo(this.$body),this.$blocker.remove(),this.$blocker=null,r(),e.modal.isActive()||this.$body.css("overflow",""))},show:function(){this.$elm.trigger(e.modal.BEFORE_OPEN,[this._ctx()]),this.options.showClose&&(this.closeButton=e('<a href="#close-modal" rel="modal:close" class="close-modal '+this.options.closeClass+'">'+this.options.closeText+"</a>"),this.$elm.append(this.closeButton)),this.$elm.addClass(this.options.modalClass).appendTo(this.$blocker),this.options.doFade?this.$elm.css({opacity:0,display:"inline-block"}).animate({opacity:1},this.options.fadeDuration):this.$elm.css("display","inline-block"),this.$elm.trigger(e.modal.OPEN,[this._ctx()])},hide:function(){this.$elm.trigger(e.modal.BEFORE_CLOSE,[this._ctx()]),this.closeButton&&this.closeButton.remove();var t=this;this.options.doFade?this.$elm.fadeOut(this.options.fadeDuration,function(){t.$elm.trigger(e.modal.AFTER_CLOSE,[t._ctx()])}):this.$elm.hide(0,function(){t.$elm.trigger(e.modal.AFTER_CLOSE,[t._ctx()])}),this.$elm.trigger(e.modal.CLOSE,[this._ctx()])},showSpinner:function(){this.options.showSpinner&&(this.spinner=this.spinner||e('<div class="'+this.options.modalClass+'-spinner"></div>').append(this.options.spinnerHtml),this.$body.append(this.spinner),this.spinner.show())},hideSpinner:function(){this.spinner&&this.spinner.remove()},_ctx:function(){return{elm:this.$elm,$elm:this.$elm,$blocker:this.$blocker,options:this.options}}},e.modal.close=function(t){if(e.modal.isActive()){t&&t.preventDefault();var a=o();return a.close(),a.$elm}},e.modal.isActive=function(){return n.length>0},e.modal.getCurrent=o,e.modal.defaults={closeExisting:!0,escapeClose:!0,clickClose:!0,closeText:"Close",closeClass:"",modalClass:"modal",blockerClass:"jquery-modal",spinnerHtml:'<div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div>',showSpinner:!0,showClose:!0,fadeDuration:null,fadeDelay:1},e.modal.BEFORE_BLOCK="modal:before-block",e.modal.BLOCK="modal:block",e.modal.BEFORE_OPEN="modal:before-open",e.modal.OPEN="modal:open",e.modal.BEFORE_CLOSE="modal:before-close",e.modal.CLOSE="modal:close",e.modal.AFTER_CLOSE="modal:after-close",e.modal.AJAX_SEND="modal:ajax:send",e.modal.AJAX_SUCCESS="modal:ajax:success",e.modal.AJAX_FAIL="modal:ajax:fail",e.modal.AJAX_COMPLETE="modal:ajax:complete",e.fn.modal=function(t){return 1===this.length&&new e.modal(this,t),this},e(a).on("click.modal",'a[rel~="modal:close"]',e.modal.close),e(a).on("click.modal",'a[rel~="modal:open"]',function(t){t.preventDefault(),e(this).modal()})}),jQuery(document).ready(function(e){var t=e("#snippet_type"),a=e("#anonymizeip"),i=e("#anonymizeip")[0],n=e("#gtm_id");e("#script_debug_mode");function o(e){e.attr("disabled",!0)}function r(e){e.removeAttr("disabled")}function s(e,t){e.checked=t}e.widget.bridge("gaetooltip",e.ui.tooltip),e(".ga-tooltip").gaetooltip({position:{my:"left bottom-10",at:"right top",collision:"none"}}),e("#advanced:checkbox").change(function(){e(this).is(":checked")?e("#forcesnopperwrap").show():e("#forcesnopperwrap").hide()}),e(".btn_upload").on("click",function(t){e(".settings_content").slideDown(),t.preventDefault()}),e(".btn_close").on("click",function(t){e(".settings_content").slideUp(),t.preventDefault()}),e(".popup").on("click",function(t){e(".popup").slideUp(),t.preventDefault()}),"none"!==t.val()&&"gtm"!==t.val()||(s(i,!1),o(a)),"gtm"===t.val()?r(n):o(n),t.change(function(){var t=e(this).val();"none"===t||"gtm"===t?(s(i,!1),o(a)):r(a),"gtm"===t?r(n):o(n)}),e(".btn_upload").on("click",function(t){e(".settings_content").slideDown(),t.preventDefault()}),e(".btn_close").on("click",function(t){e(".settings_content").slideUp(),t.preventDefault()}),e(".popup").on("click",function(t){e(".popup").slideUp(),t.preventDefault()}),e('input[name="ga_events_options[permitted_roles][]"][value="administrator"]').css({"pointer-events":"none",opacity:.5}).prop("checked",!0),e(".divs-istracktime:checkbox").change(function(){var t=e(this),a=t.is(":checked"),i=t.data("track"),n="#track-elem"+i,o="#eventValue"+i;a?(e(n).show(),e(o).attr("disabled",!0)):(e(n).hide(),e(o).removeAttr("disabled"))}),e("#empty-istracktime:checkbox").change(function(){e(this).is(":checked")?(e("#empty-trackelem").show(),e("#empty-eventValue").attr("disabled",!0)):(e("#empty-trackelem").hide(),e("#empty-eventValue").removeAttr("disabled"))}),e(".divs-istracktime").trigger("change"),jQuery("body").on("click",'a[href="admin.php?page=wp-google-analytics-events-upgrade"]',function(e){e.preventDefault(),window.open("https://wpflow.com/upgrade/?utm_source=wpadmin&utm_medium=banner&utm_campaign=nav","_blank")})});var gaeAjax=function(e){function t(t){t.preventDefault();var a=e(this).attr("id"),i="#"+e(this).data("action");e.ajax({type:"POST",url:wpflow_ajax.ajax_url,data:{post_id:a,action:"wpflow_get_event_json"},success:function(t){e(i).modal(),function(t,a){if(void 0!==a)for(var i in a)a.hasOwnProperty(i)&&(e(t+" #"+i).is(":checkbox")?"true"===a[i][0]?e(t+" #"+i).attr("checked",!0):e(t+" #"+i).removeAttr("checked",!1):e(t+" #"+i).val(a[i][0]))}(i,t.meta),e(i+" #event_id").val(a)},error:function(){alert("Error updating event")}})}function a(t){t.preventDefault();var a=e(this);e.ajax({type:"post",url:wpflow_ajax.ajax_url,data:a.serialize(),success:function(e){window.location.reload()}})}e(document).ready(function(e){if(void 0!==e.fn.modal.noConflict)e.fn.modal.noConflict();e.validate(),e(".wpgae-event-form").on("submit",a),e(".ga_main .edit a").click(t),e(".ga_main .delete a").click(t),e('.deactivate a[href*="wp-google-analytics-events"], #wpgae-modal-cancel a').click(function(t){t.preventDefault(),e("#wpgae-modal-content, #wpgae-modal-background").toggleClass("active"),e("#wpgae-just-deactivate").attr("href",this.href)}),e("#wpgae-feedback-form").submit(function(t){t.preventDefault();var a=e(this);e.ajax({type:"POST",url:wpflow_ajax.ajax_url,data:a.serialize(),success:function(t){window.location=e("#wpgae-just-deactivate").attr("href")}})})})}(jQuery);
|
1 |
+
!function(e){"object"==typeof module&&"object"==typeof module.exports?e(require("jquery"),window,document):e(jQuery,window,document)}(function(e,t,o,i){var n=[],s=function(){return n.length?n[n.length-1]:null},a=function(){var e,t=!1;for(e=n.length-1;e>=0;e--)n[e].$blocker&&(n[e].$blocker.toggleClass("current",!t).toggleClass("behind",t),t=!0)};e.modal=function(t,o){var i,a;if(this.$body=e("body"),this.options=e.extend({},e.modal.defaults,o),this.options.doFade=!isNaN(parseInt(this.options.fadeDuration,10)),this.$blocker=null,this.options.closeExisting)for(;e.modal.isActive();)e.modal.close();if(n.push(this),t.is("a"))if(a=t.attr("href"),this.anchor=t,/^#/.test(a)){if(this.$elm=e(a),1!==this.$elm.length)return null;this.$body.append(this.$elm),this.open()}else this.$elm=e("<div>"),this.$body.append(this.$elm),i=function(e,t){t.elm.remove()},this.showSpinner(),t.trigger(e.modal.AJAX_SEND),e.get(a).done(function(o){if(e.modal.isActive()){t.trigger(e.modal.AJAX_SUCCESS);var n=s();n.$elm.empty().append(o).on(e.modal.CLOSE,i),n.hideSpinner(),n.open(),t.trigger(e.modal.AJAX_COMPLETE)}}).fail(function(){t.trigger(e.modal.AJAX_FAIL),s().hideSpinner(),n.pop(),t.trigger(e.modal.AJAX_COMPLETE)});else this.$elm=t,this.anchor=t,this.$body.append(this.$elm),this.open()},e.modal.prototype={constructor:e.modal,open:function(){var t=this;this.block(),this.anchor.blur(),this.options.doFade?setTimeout(function(){t.show()},this.options.fadeDuration*this.options.fadeDelay):this.show(),e(o).off("keydown.modal").on("keydown.modal",function(e){var t=s();27===e.which&&t.options.escapeClose&&t.close()}),this.options.clickClose&&this.$blocker.click(function(t){t.target===this&&e.modal.close()})},close:function(){n.pop(),this.unblock(),this.hide(),e.modal.isActive()||e(o).off("keydown.modal")},block:function(){this.$elm.trigger(e.modal.BEFORE_BLOCK,[this._ctx()]),this.$body.css("overflow","hidden"),this.$blocker=e('<div class="'+this.options.blockerClass+' blocker current"></div>').appendTo(this.$body),a(),this.options.doFade&&this.$blocker.css("opacity",0).animate({opacity:1},this.options.fadeDuration),this.$elm.trigger(e.modal.BLOCK,[this._ctx()])},unblock:function(t){!t&&this.options.doFade?this.$blocker.fadeOut(this.options.fadeDuration,this.unblock.bind(this,!0)):(this.$blocker.children().appendTo(this.$body),this.$blocker.remove(),this.$blocker=null,a(),e.modal.isActive()||this.$body.css("overflow",""))},show:function(){this.$elm.trigger(e.modal.BEFORE_OPEN,[this._ctx()]),this.options.showClose&&(this.closeButton=e('<a href="#close-modal" rel="modal:close" class="close-modal '+this.options.closeClass+'">'+this.options.closeText+"</a>"),this.$elm.append(this.closeButton)),this.$elm.addClass(this.options.modalClass).appendTo(this.$blocker),this.options.doFade?this.$elm.css({opacity:0,display:"inline-block"}).animate({opacity:1},this.options.fadeDuration):this.$elm.css("display","inline-block"),this.$elm.trigger(e.modal.OPEN,[this._ctx()])},hide:function(){this.$elm.trigger(e.modal.BEFORE_CLOSE,[this._ctx()]),this.closeButton&&this.closeButton.remove();var t=this;this.options.doFade?this.$elm.fadeOut(this.options.fadeDuration,function(){t.$elm.trigger(e.modal.AFTER_CLOSE,[t._ctx()])}):this.$elm.hide(0,function(){t.$elm.trigger(e.modal.AFTER_CLOSE,[t._ctx()])}),this.$elm.trigger(e.modal.CLOSE,[this._ctx()])},showSpinner:function(){this.options.showSpinner&&(this.spinner=this.spinner||e('<div class="'+this.options.modalClass+'-spinner"></div>').append(this.options.spinnerHtml),this.$body.append(this.spinner),this.spinner.show())},hideSpinner:function(){this.spinner&&this.spinner.remove()},_ctx:function(){return{elm:this.$elm,$elm:this.$elm,$blocker:this.$blocker,options:this.options}}},e.modal.close=function(t){if(e.modal.isActive()){t&&t.preventDefault();var o=s();return o.close(),o.$elm}},e.modal.isActive=function(){return n.length>0},e.modal.getCurrent=s,e.modal.defaults={closeExisting:!0,escapeClose:!0,clickClose:!0,closeText:"Close",closeClass:"",modalClass:"modal",blockerClass:"jquery-modal",spinnerHtml:'<div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div>',showSpinner:!0,showClose:!0,fadeDuration:null,fadeDelay:1},e.modal.BEFORE_BLOCK="modal:before-block",e.modal.BLOCK="modal:block",e.modal.BEFORE_OPEN="modal:before-open",e.modal.OPEN="modal:open",e.modal.BEFORE_CLOSE="modal:before-close",e.modal.CLOSE="modal:close",e.modal.AFTER_CLOSE="modal:after-close",e.modal.AJAX_SEND="modal:ajax:send",e.modal.AJAX_SUCCESS="modal:ajax:success",e.modal.AJAX_FAIL="modal:ajax:fail",e.modal.AJAX_COMPLETE="modal:ajax:complete",e.fn.modal=function(t){return 1===this.length&&new e.modal(this,t),this},e(o).on("click.modal",'a[rel~="modal:close"]',e.modal.close),e(o).on("click.modal",'a[rel~="modal:open"]',function(t){t.preventDefault(),e(this).modal()})}),jQuery(document).ready(function(e){var t=e("#snippet_type"),o=e("#anonymizeip"),i=e("#anonymizeip")[0],n=e("#gtm_id");e("#script_debug_mode");function s(e){e.attr("disabled",!0)}function a(e){e.removeAttr("disabled")}function l(e,t){e.checked=t}e.widget.bridge("gaetooltip",e.ui.tooltip),e(".ga-tooltip").gaetooltip({position:{my:"left bottom-10",at:"right top",collision:"none"}}),e("#advanced:checkbox").on("change",function(){e(this).is(":checked")?e("#forcesnopperwrap").show():e("#forcesnopperwrap").hide()}),e(".btn_upload").on("click",function(t){e(".settings_content").slideDown(),t.preventDefault()}),e(".btn_close").on("click",function(t){e(".settings_content").slideUp(),t.preventDefault()}),e(".popup").on("click",function(t){e(".popup").slideUp(),t.preventDefault()}),"none"!==t.val()&&"gtm"!==t.val()||(l(i,!1),s(o)),"gtm"===t.val()?a(n):s(n),t.on("change",function(){var t=e(this).val();"none"===t||"gtm"===t?(l(i,!1),s(o)):a(o),"gtm"===t?a(n):s(n)}),e(".btn_upload").on("click",function(t){e(".settings_content").slideDown(),t.preventDefault()}),e(".btn_close").on("click",function(t){e(".settings_content").slideUp(),t.preventDefault()}),e(".popup").on("click",function(t){e(".popup").slideUp(),t.preventDefault()}),e('input[name="ga_events_options[permitted_roles][]"][value="administrator"]').css({"pointer-events":"none",opacity:.5}).prop("checked",!0),e(".divs-istracktime:checkbox").on("change",function(){var t=e(this),o=t.is(":checked"),i=t.data("track"),n="#track-elem"+i,s="#eventValue"+i;o?(e(n).show(),e(s).attr("disabled",!0)):(e(n).hide(),e(s).removeAttr("disabled"))}),e("#empty-istracktime:checkbox").on("change",function(){e(this).is(":checked")?(e("#empty-trackelem").show(),e("#empty-eventValue").attr("disabled",!0)):(e("#empty-trackelem").hide(),e("#empty-eventValue").removeAttr("disabled"))}),e(".divs-istracktime").trigger("change"),jQuery("body").on("click",'a[href="admin.php?page=wp-google-analytics-events-upgrade"]',function(e){e.preventDefault(),window.open("https://wpflow.com/upgrade/?utm_source=wpadmin&utm_medium=banner&utm_campaign=nav","_blank")})});var gaeAjax=function(e){function t(t){t.preventDefault();var o=e(this).attr("id"),i="#"+e(this).data("action");e.ajax({type:"POST",url:wpflow_ajax.ajax_url,data:{post_id:o,action:"wpflow_get_event_json"},success:function(t){e(i).modal(),function(t,o){if(void 0!==o)for(var i in o)o.hasOwnProperty(i)&&(e(t+" #"+i).is(":checkbox")?"true"===o[i][0]?e(t+" #"+i).attr("checked",!0):e(t+" #"+i).removeAttr("checked",!1):e(t+" #"+i).val(o[i][0]))}(i,t.meta),e(i+" #event_id").val(o)},error:function(){alert("Error updating event")}})}function o(t){t.preventDefault();var o=e(this);e.ajax({type:"post",url:wpflow_ajax.ajax_url,data:o.serialize(),success:function(e){window.location.reload()}})}e(document).ready(function(e){if(void 0!==e.fn.modal.noConflict)e.fn.modal.noConflict();e(".wpgae-event-form").on("submit",o),e(".ga_main .edit a").on("click",t),e(".ga_main .delete a").on("click",t),e('.deactivate a[href*="wp-google-analytics-events"], #wpgae-modal-cancel a').on("click",function(t){t.preventDefault(),e("#wpgae-modal-content, #wpgae-modal-background").toggleClass("active"),e("#wpgae-just-deactivate").attr("href",this.href)}),e("#wpgae-feedback-form").on("submit",function(t){t.preventDefault();var o=e(this);e.ajax({type:"POST",url:wpflow_ajax.ajax_url,data:o.serialize(),success:function(t){window.location=e("#wpgae-just-deactivate").attr("href")}})})})}(jQuery);
|
js/dist/admin-scripts.js
CHANGED
@@ -1,14 +1,3 @@
|
|
1 |
-
/** File generated by Grunt -- do not modify
|
2 |
-
* JQUERY-FORM-VALIDATOR
|
3 |
-
*
|
4 |
-
* @version 2.3.79
|
5 |
-
* @website http://formvalidator.net/
|
6 |
-
* @author Victor Jonsson, http://victorjonsson.se
|
7 |
-
* @license MIT
|
8 |
-
*/
|
9 |
-
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a,b,c){function d(a,b){this.$form=a,this.$input=b,this.reset(),b.on("change paste",this.reset.bind(this))}var e=function(){return!1},f=null,g={numHalted:0,haltValidation:function(b){this.numHalted++,a.formUtils.haltValidation=!0,b.unbind("submit",e).bind("submit",e).find('*[type="submit"]').addClass("disabled").attr("disabled","disabled")},unHaltValidation:function(b){this.numHalted--,0===this.numHalted&&(a.formUtils.haltValidation=!1,b.unbind("submit",e).find('*[type="submit"]').removeClass("disabled").removeAttr("disabled","disabled"))}};d.prototype.reset=function(){this.haltedFormValidation=!1,this.hasRun=!1,this.isRunning=!1,this.result=c},d.prototype.run=function(a,b){return"keyup"===a?null:this.isRunning?(f=a,this.haltedFormValidation||(g.haltValidation(),this.haltedFormValidation=!0),null):this.hasRun?this.result:(f=a,g.haltValidation(this.$form),this.haltedFormValidation=!0,this.isRunning=!0,this.$input.attr("disabled","disabled").addClass("async-validation"),this.$form.addClass("async-validation"),b(function(a){this.done(a)}.bind(this)),null)},d.prototype.done=function(a){this.result=a,this.hasRun=!0,this.isRunning=!1,this.$input.removeAttr("disabled").removeClass("async-validation"),this.$form.removeClass("async-validation"),this.haltedFormValidation&&(g.unHaltValidation(this.$form),"submit"===f?this.$form.trigger("submit"):this.$input.trigger("validation.revalidate"))},d.loadInstance=function(a,b,c){var e,f=b.get(0);return f.asyncValidators||(f.asyncValidators={}),f.asyncValidators[a]?e=f.asyncValidators[a]:(e=new d(c,b),f.asyncValidators[a]=e),e},a.formUtils=a.extend(a.formUtils||{},{asyncValidation:function(a,b,c){return this.warn("Use of deprecated function $.formUtils.asyncValidation, use $.formUtils.addAsyncValidator() instead"),d.loadInstance(a,b,c)},addAsyncValidator:function(b){var c=a.extend({},b),e=c.validatorFunction;c.async=!0,c.validatorFunction=function(a,b,f,g,h,i){var j=d.loadInstance(this.name,b,h);return j.run(i,function(d){e.apply(c,[d,a,b,f,g,h,i])})},this.addValidator(c)}}),a(b).bind("validatorsLoaded formValidationSetup",function(b,c){c||(c=a("form")),c.find("[data-validation]").each(function(){var b=a(this);b.valAttr("async",!1),a.each(a.split(b.attr("data-validation")),function(c,d){var e=a.formUtils.validators["validate_"+d];e&&e.async&&b.valAttr("async","yes")})})})}(a,window),function(a,b){"use strict";function c(b){b&&"custom"===b.errorMessagePosition&&"function"==typeof b.errorMessageCustom&&(a.formUtils.warn("Use of deprecated function errorMessageCustom, use config.submitErrorMessageCallback instead"),b.submitErrorMessageCallback=function(a,c){b.errorMessageCustom(a,b.language.errorTitle,c,b)})}function d(b){if(b.errorMessagePosition&&"object"==typeof b.errorMessagePosition){a.formUtils.warn("Deprecated use of config parameter errorMessagePosition, use config.submitErrorMessageCallback instead");var c=b.errorMessagePosition;b.errorMessagePosition="top",b.submitErrorMessageCallback=function(){return c}}}function e(b){var c=b.find("[data-validation-if-checked]");c.length&&a.formUtils.warn('Detected use of attribute "data-validation-if-checked" which is deprecated. Use "data-validation-depends-on" provided by module "logic"'),c.on("beforeValidation",function(){var c=a(this),d=c.valAttr("if-checked"),e=a('input[name="'+d+'"]',b),f=e.is(":checked"),g=(a.formUtils.getValue(e)||"").toString(),h=c.valAttr("if-checked-value");(!f||h&&h!==g)&&c.valAttr("skipped",!0)})}function f(b){var c={se:"sv",cz:"cs",dk:"da"};if(b.lang in c){var d=c[b.lang];a.formUtils.warn('Deprecated use of lang code "'+b.lang+'" use "'+d+'" instead'),b.lang=d}}a.fn.validateForm=function(b,c){return a.formUtils.warn("Use of deprecated function $.validateForm, use $.isValid instead"),this.isValid(b,c,!0)},a(window).on("formValidationPluginInit",function(a,b){f(b),c(b),d(b)}).on("validatorsLoaded formValidationSetup",function(b,c){c||(c=a("form")),e(c)})}(a),function(a){"use strict";var b={resolveErrorMessage:function(a,b,c,d,e){var f=d.validationErrorMsgAttribute+"-"+c.replace("validate_",""),g=a.attr(f);return g||(g=a.attr(d.validationErrorMsgAttribute),g||(g="function"!=typeof b.errorMessageKey?e[b.errorMessageKey]:e[b.errorMessageKey(d)],g||(g=b.errorMessage))),g},getParentContainer:function(b){if(b.valAttr("error-msg-container"))return a(b.valAttr("error-msg-container"));var c=b.parent();return"checkbox"===b.attr("type")&&b.closest(".checkbox").length?c=b.closest(".checkbox").parent():"radio"===b.attr("type")&&b.closest(".radio").length&&(c=b.closest(".radio").parent()),c.closest(".input-group").length&&(c=c.closest(".input-group").parent()),c},applyInputErrorStyling:function(a,b){a.addClass(b.errorElementClass).removeClass(b.successElementClass),this.getParentContainer(a).addClass(b.inputParentClassOnError).removeClass(b.inputParentClassOnSuccess),""!==b.borderColorOnError&&a.css("border-color",b.borderColorOnError)},applyInputSuccessStyling:function(a,b){a.addClass(b.successElementClass),this.getParentContainer(a).addClass(b.inputParentClassOnSuccess)},removeInputStylingAndMessage:function(a,c){a.removeClass(c.successElementClass).removeClass(c.errorElementClass).css("border-color","");var d=b.getParentContainer(a);if(d.removeClass(c.inputParentClassOnError).removeClass(c.inputParentClassOnSuccess),"function"==typeof c.inlineErrorMessageCallback){var e=c.inlineErrorMessageCallback(a,!1,c);e&&e.html("")}else d.find("."+c.errorMessageClass).remove()},removeAllMessagesAndStyling:function(c,d){if("function"==typeof d.submitErrorMessageCallback){var e=d.submitErrorMessageCallback(c,!1,d);e&&e.html("")}else c.find("."+d.errorMessageClass+".alert").remove();c.find("."+d.errorElementClass+",."+d.successElementClass).each(function(){b.removeInputStylingAndMessage(a(this),d)})},setInlineMessage:function(b,c,d){this.applyInputErrorStyling(b,d);var e,f=document.getElementById(b.attr("name")+"_err_msg"),g=!1,h=function(d){a.formUtils.$win.trigger("validationErrorDisplay",[b,d]),d.html(c)},i=function(){var f=!1;g.find("."+d.errorMessageClass).each(function(){if(this.inputReferer===b[0])return f=a(this),!1}),f?c?h(f):f.remove():""!==c&&(e=a('<div class="'+d.errorMessageClass+' alert"></div>'),h(e),e[0].inputReferer=b[0],g.prepend(e))};if(f)a.formUtils.warn("Using deprecated element reference "+f.id),g=a(f),i();else if("function"==typeof d.inlineErrorMessageCallback){if(g=d.inlineErrorMessageCallback(b,c,d),!g)return;i()}else{var j=this.getParentContainer(b);e=j.find("."+d.errorMessageClass+".help-block"),0===e.length&&(e=a("<span></span>").addClass("help-block").addClass(d.errorMessageClass),e.appendTo(j)),h(e)}},setMessageInTopOfForm:function(b,c,d,e){var f='<div class="{errorMessageClass} alert alert-danger"><strong>{errorTitle}</strong><ul>{fields}</ul></div>',g=!1;if("function"!=typeof d.submitErrorMessageCallback||(g=d.submitErrorMessageCallback(b,c,d))){var h={errorTitle:e.errorTitle,fields:"",errorMessageClass:d.errorMessageClass};a.each(c,function(a,b){h.fields+="<li>"+b+"</li>"}),a.each(h,function(a,b){f=f.replace("{"+a+"}",b)}),g?g.html(f):b.children().eq(0).before(a(f))}}};a.formUtils=a.extend(a.formUtils||{},{dialogs:b})}(a),function(a,b,c){"use strict";var d=0;a.fn.validateOnBlur=function(b,c){var d=this,e=this.find("*[data-validation]");return e.each(function(){var e=a(this);if(e.is("[type=radio]")){var f=d.find('[type=radio][name="'+e.attr("name")+'"]');f.bind("blur.validation",function(){e.validateInputOnBlur(b,c,!0,"blur")}),c.validateCheckboxRadioOnClick&&f.bind("click.validation",function(){e.validateInputOnBlur(b,c,!0,"click")})}}),e.bind("blur.validation",function(){a(this).validateInputOnBlur(b,c,!0,"blur")}),c.validateCheckboxRadioOnClick&&this.find("input[type=checkbox][data-validation],input[type=radio][data-validation]").bind("click.validation",function(){a(this).validateInputOnBlur(b,c,!0,"click")}),this},a.fn.validateOnEvent=function(b,c){if(0!==this.length){var d="FORM"===this[0].nodeName?this.find("*[data-validation-event]"):this;return d.each(function(){var d=a(this),e=d.valAttr("event");e&&d.unbind(e+".validation").bind(e+".validation",function(d){9!==(d||{}).keyCode&&a(this).validateInputOnBlur(b,c,!0,e)})}),this}},a.fn.showHelpOnFocus=function(b){return b||(b="data-validation-help"),this.find("textarea,input").each(function(){var c=a(this),e="jquery_form_help_"+ ++d,f=c.attr(b);c.removeClass("has-help-text").unbind("focus.help").unbind("blur.help"),f&&c.addClass("has-help-txt").bind("focus.help",function(){var b=c.parent().find("."+e);0===b.length&&(b=a("<span />").addClass(e).addClass("help").addClass("help-block").text(f).hide(),c.after(b)),b.fadeIn()}).bind("blur.help",function(){a(this).parent().find("."+e).fadeOut("slow")})}),this},a.fn.validate=function(b,c,d){var e=a.extend({},a.formUtils.LANG,d||{});this.each(function(){var d=a(this),f=d.closest("form").get(0)||{},g=f.validationConfig||a.formUtils.defaultConfig();d.one("validation",function(a,c){"function"==typeof b&&b(c,this,a)}),d.validateInputOnBlur(e,a.extend({},g,c||{}),!0)})},a.fn.willPostponeValidation=function(){return(this.valAttr("suggestion-nr")||this.valAttr("postpone")||this.hasClass("hasDatepicker"))&&!b.postponedValidation},a.fn.validateInputOnBlur=function(c,d,e,f){if(a.formUtils.eventType=f,this.willPostponeValidation()){var g=this,h=this.valAttr("postpone")||200;return b.postponedValidation=function(){g.validateInputOnBlur(c,d,e,f),b.postponedValidation=!1},setTimeout(function(){b.postponedValidation&&b.postponedValidation()},h),this}c=a.extend({},a.formUtils.LANG,c||{}),a.formUtils.dialogs.removeInputStylingAndMessage(this,d);var i=this,j=i.closest("form"),k=a.formUtils.validateInput(i,c,d,j,f),l=function(){i.validateInputOnBlur(c,d,!1,"blur.revalidated")};return"blur"===f&&i.unbind("validation.revalidate",l).one("validation.revalidate",l),e&&i.removeKeyUpValidation(),k.shouldChangeDisplay&&(k.isValid?a.formUtils.dialogs.applyInputSuccessStyling(i,d):a.formUtils.dialogs.setInlineMessage(i,k.errorMsg,d)),!k.isValid&&e&&i.validateOnKeyUp(c,d),this},a.fn.validateOnKeyUp=function(b,c){return this.each(function(){var d=a(this);d.valAttr("has-keyup-event")||d.valAttr("has-keyup-event","true").bind("keyup.validation",function(a){9!==a.keyCode&&d.validateInputOnBlur(b,c,!1,"keyup")})}),this},a.fn.removeKeyUpValidation=function(){return this.each(function(){a(this).valAttr("has-keyup-event",!1).unbind("keyup.validation")}),this},a.fn.valAttr=function(a,b){return b===c?this.attr("data-validation-"+a):b===!1||null===b?this.removeAttr("data-validation-"+a):(a=a.length>0?"-"+a:"",this.attr("data-validation"+a,b))},a.fn.isValid=function(b,c,d){if(a.formUtils.isLoadingModules){var e=this;return setTimeout(function(){e.isValid(b,c,d)},200),null}c=a.extend({},a.formUtils.defaultConfig(),c||{}),b=a.extend({},a.formUtils.LANG,b||{}),d=d!==!1,a.formUtils.errorDisplayPreventedWhenHalted&&(delete a.formUtils.errorDisplayPreventedWhenHalted,d=!1);var f=function(b,e){a.inArray(b,h)<0&&h.push(b),i.push(e),e.valAttr("current-error",b),d&&a.formUtils.dialogs.applyInputErrorStyling(e,c)},g=[],h=[],i=[],j=this,k=function(b,d){return"submit"===d||"button"===d||"reset"===d||a.inArray(b,c.ignore||[])>-1};if(d&&a.formUtils.dialogs.removeAllMessagesAndStyling(j,c),j.find("input,textarea,select").filter(':not([type="submit"],[type="button"])').each(function(){var d=a(this),e=d.attr("type"),h="radio"===e||"checkbox"===e,i=d.attr("name");if(!k(i,e)&&(!h||a.inArray(i,g)<0)){h&&g.push(i);var l=a.formUtils.validateInput(d,b,c,j,"submit");l.isValid?l.isValid&&l.shouldChangeDisplay&&(d.valAttr("current-error",!1),a.formUtils.dialogs.applyInputSuccessStyling(d,c)):f(l.errorMsg,d)}}),"function"==typeof c.onValidate){var l=c.onValidate(j);a.isArray(l)?a.each(l,function(a,b){f(b.message,b.element)}):l&&l.element&&l.message&&f(l.message,l.element)}return a.formUtils.isValidatingEntireForm=!1,i.length>0&&d&&("top"===c.errorMessagePosition?a.formUtils.dialogs.setMessageInTopOfForm(j,h,c,b):a.each(i,function(b,d){a.formUtils.dialogs.setInlineMessage(d,d.valAttr("current-error"),c)}),c.scrollToTopOnError&&a.formUtils.$win.scrollTop(j.offset().top-20)),!d&&a.formUtils.haltValidation&&(a.formUtils.errorDisplayPreventedWhenHalted=!0),0===i.length&&!a.formUtils.haltValidation},a.fn.restrictLength=function(b){return new a.formUtils.lengthRestriction(this,b),this},a.fn.addSuggestions=function(b){var c=!1;return this.find("input").each(function(){var d=a(this);c=a.split(d.attr("data-suggestions")),c.length>0&&!d.hasClass("has-suggestions")&&(a.formUtils.suggest(d,c,b),d.addClass("has-suggestions"))}),this}}(a,window),function(a){"use strict";a.formUtils=a.extend(a.formUtils||{},{isLoadingModules:!1,loadedModules:{},registerLoadedModule:function(b){this.loadedModules[a.trim(b).toLowerCase()]=!0},hasLoadedModule:function(b){return a.trim(b).toLowerCase()in this.loadedModules},loadModules:function(b,c,d){if(a.formUtils.isLoadingModules)return void setTimeout(function(){a.formUtils.loadModules(b,c,d)},100);var e=function(b,c){var e=a.split(b),f=e.length,g=function(){f--,0===f&&(a.formUtils.isLoadingModules=!1,"function"==typeof d&&d())};f>0&&(a.formUtils.isLoadingModules=!0);var h="?_="+(new Date).getTime(),i=document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0];a.each(e,function(b,d){if(d=a.trim(d),0===d.length||a.formUtils.hasLoadedModule(d))g();else{var e=c+d+(".js"===d.slice(-3)?"":".js"),f=document.createElement("SCRIPT");"function"==typeof define&&define.amd?require([e+(".dev.js"===e.slice(-7)?h:"")],g):(f.type="text/javascript",f.onload=g,f.src=e+(".dev.js"===e.slice(-7)?h:""),f.onerror=function(){a.formUtils.warn("Unable to load form validation module "+e,!0),g()},f.onreadystatechange=function(){"complete"!==this.readyState&&"loaded"!==this.readyState||(g(),this.onload=null,this.onreadystatechange=null)},i.appendChild(f))}})};if(c)e(b,c);else{var f=function(){var c=!1;return a('script[src*="form-validator"]').each(function(){var a=this.src.split("form-validator")[1].split("node_modules").length>1;if(!a)return c=this.src.substr(0,this.src.lastIndexOf("/"))+"/","/"===c&&(c=""),!1}),c!==!1&&(e(b,c),!0)};f()||a(function(){var a=f();a||"function"==typeof d&&d()})}}})}(a),function(a){"use strict";a.split=function(b,c,d){d=void 0===d||d===!0;var e="[,|"+(d?"\\s":"")+"-]\\s*",f=new RegExp(e,"g");if("function"!=typeof c){if(!b)return[];var g=[];return a.each(b.split(c?c:f),function(b,c){c=a.trim(c),c.length&&g.push(c)}),g}b&&a.each(b.split(f),function(b,d){if(d=a.trim(d),d.length)return c(d,b)})},a.validate=function(b){var c=a.extend(a.formUtils.defaultConfig(),{form:"form",validateOnEvent:!1,validateOnBlur:!0,validateCheckboxRadioOnClick:!0,showHelpOnFocus:!0,addSuggestions:!0,modules:"",onModulesLoaded:null,language:!1,onSuccess:!1,onError:!1,onElementValidate:!1});if(b=a.extend(c,b||{}),a(window).trigger("formValidationPluginInit",[b]),b.lang&&"en"!==b.lang){var d="lang/"+b.lang+".js";b.modules+=b.modules.length?","+d:d}a(b.form).each(function(c,d){d.validationConfig=b;var e=a(d);e.trigger("formValidationSetup",[e,b]),e.find(".has-help-txt").unbind("focus.validation").unbind("blur.validation"),e.removeClass("has-validation-callback").unbind("submit.validation").unbind("reset.validation").find("input[data-validation],textarea[data-validation]").unbind("blur.validation"),e.bind("submit.validation",function(c){var d=a(this),e=function(){return c.stopImmediatePropagation(),!1};if(a.formUtils.haltValidation)return e();if(a.formUtils.isLoadingModules)return setTimeout(function(){d.trigger("submit.validation")},200),e();var f=d.isValid(b.language,b);if(a.formUtils.haltValidation)return e();if(!f||"function"!=typeof b.onSuccess)return f||"function"!=typeof b.onError?!!f||e():(b.onError(d),e());var g=b.onSuccess(d);return g===!1?e():void 0}).bind("reset.validation",function(){a.formUtils.dialogs.removeAllMessagesAndStyling(e,b)}).addClass("has-validation-callback"),b.showHelpOnFocus&&e.showHelpOnFocus(),b.addSuggestions&&e.addSuggestions(),b.validateOnBlur&&(e.validateOnBlur(b.language,b),e.bind("html5ValidationAttrsFound",function(){e.validateOnBlur(b.language,b)})),b.validateOnEvent&&e.validateOnEvent(b.language,b)}),""!==b.modules&&a.formUtils.loadModules(b.modules,null,function(){"function"==typeof b.onModulesLoaded&&b.onModulesLoaded();var c="string"==typeof b.form?a(b.form):b.form;a.formUtils.$win.trigger("validatorsLoaded",[c,b])})}}(a),function(a,b){"use strict";var c=a(b);a.formUtils=a.extend(a.formUtils||{},{$win:c,defaultConfig:function(){return{ignore:[],errorElementClass:"error",successElementClass:"valid",borderColorOnError:"#b94a48",errorMessageClass:"form-error",validationRuleAttribute:"data-validation",validationErrorMsgAttribute:"data-validation-error-msg",errorMessagePosition:"inline",errorMessageTemplate:{container:'<div class="{errorMessageClass} alert alert-danger">{messages}</div>',messages:"<strong>{errorTitle}</strong><ul>{fields}</ul>",field:"<li>{msg}</li>"},scrollToTopOnError:!0,dateFormat:"yyyy-mm-dd",addValidClassOnAll:!1,decimalSeparator:".",inputParentClassOnError:"has-error",inputParentClassOnSuccess:"has-success",validateHiddenInputs:!1,inlineErrorMessageCallback:!1,submitErrorMessageCallback:!1}},validators:{},sanitizers:{},_events:{load:[],valid:[],invalid:[]},haltValidation:!1,addValidator:function(a){var b=0===a.name.indexOf("validate_")?a.name:"validate_"+a.name;void 0===a.validateOnKeyUp&&(a.validateOnKeyUp=!0),this.validators[b]=a},addSanitizer:function(a){this.sanitizers[a.name]=a},warn:function(a,c){"console"in b?"function"==typeof b.console.warn?b.console.warn(a):"function"==typeof b.console.log&&b.console.log(a):c&&alert(a)},getValue:function(a,b){var c=b?b.find(a):a;if(c.length>0){var d=c.eq(0).attr("type");return"radio"===d||"checkbox"===d?c.filter(":checked").val()||"":c.val()||""}return!1},validateInput:function(b,c,d,e,f){d=d||a.formUtils.defaultConfig(),c=c||a.formUtils.LANG,e.length||(e=b.parent());var g=this.getValue(b);b.valAttr("skipped",!1).one("beforeValidation",function(){(b.attr("disabled")||!b.is(":visible")&&!d.validateHiddenInputs)&&b.valAttr("skipped",1)}).trigger("beforeValidation",[g,c,d]);var h="true"===b.valAttr("optional"),i=!g&&h,j=b.attr(d.validationRuleAttribute),k=!0,l="",m={isValid:!0,shouldChangeDisplay:!0,errorMsg:""};if(!j||i||b.valAttr("skipped"))return m.shouldChangeDisplay=d.addValidClassOnAll,m;var n=b.valAttr("ignore");return n&&a.each(n.split(""),function(a,b){g=g.replace(new RegExp("\\"+b,"g"),"")}),a.split(j,function(h){0!==h.indexOf("validate_")&&(h="validate_"+h);var i=a.formUtils.validators[h];if(!i)throw new Error('Using undefined validator "'+h+'". Maybe you have forgotten to load the module that "'+h+'" belongs to?');if("validate_checkbox_group"===h&&(b=e.find('[name="'+b.attr("name")+'"]:eq(0)')),("keyup"!==f||i.validateOnKeyUp)&&(k=i.validatorFunction(g,b,d,c,e,f)),!k)return d.validateOnBlur&&b.validateOnKeyUp(c,d),l=a.formUtils.dialogs.resolveErrorMessage(b,i,h,d,c),!1}),k===!1?(b.trigger("validation",!1),m.errorMsg=l,m.isValid=!1,m.shouldChangeDisplay=!0):null===k?m.shouldChangeDisplay=!1:(b.trigger("validation",!0),m.shouldChangeDisplay=!0),"function"==typeof d.onElementValidate&&null!==l&&d.onElementValidate(m.isValid,b,e,l),b.trigger("afterValidation",[m,f]),m},parseDate:function(b,c,d){var e,f,g,h,i=c.replace(/[a-zA-Z]/gi,"").substring(0,1),j="^",k=c.split(i||null);if(a.each(k,function(a,b){j+=(a>0?"\\"+i:"")+"(\\d{"+b.length+"})"}),j+="$",d){var l=[];a.each(b.split(i),function(a,b){1===b.length&&(b="0"+b),l.push(b)}),b=l.join(i)}if(e=b.match(new RegExp(j)),null===e)return!1;var m=function(b,c,d){for(var e=0;e<c.length;e++)if(c[e].substring(0,1)===b)return a.formUtils.parseDateInt(d[e+1]);return-1};return g=m("m",k,e),f=m("d",k,e),h=m("y",k,e),!(2===g&&f>28&&(h%4!==0||h%100===0&&h%400!==0)||2===g&&f>29&&(h%4===0||h%100!==0&&h%400===0)||g>12||0===g)&&(!(this.isShortMonth(g)&&f>30||!this.isShortMonth(g)&&f>31||0===f)&&[h,g,f])},parseDateInt:function(a){return 0===a.indexOf("0")&&(a=a.replace("0","")),parseInt(a,10)},isShortMonth:function(a){return a%2===0&&a<7||a%2!==0&&a>7},lengthRestriction:function(b,c){var d=parseInt(c.text(),10),e=0,f=function(){var a=b.val().length;if(a>d){var f=b.scrollTop();b.val(b.val().substring(0,d)),b.scrollTop(f)}e=d-a,e<0&&(e=0),c.text(e)};a(b).bind("keydown keyup keypress focus blur",f).bind("cut paste",function(){setTimeout(f,100)}),a(document).bind("ready",f)},numericRangeCheck:function(b,c){var d=a.split(c),e=parseInt(c.substr(3),10);return 1===d.length&&c.indexOf("min")===-1&&c.indexOf("max")===-1&&(d=[c,c]),2===d.length&&(b<parseInt(d[0],10)||b>parseInt(d[1],10))?["out",d[0],d[1]]:0===c.indexOf("min")&&b<e?["min",e]:0===c.indexOf("max")&&b>e?["max",e]:["ok"]},_numSuggestionElements:0,_selectedSuggestion:null,_previousTypedVal:null,suggest:function(b,d,e){var f={css:{maxHeight:"150px",background:"#FFF",lineHeight:"150%",textDecoration:"underline",overflowX:"hidden",overflowY:"auto",border:"#CCC solid 1px",borderTop:"none",cursor:"pointer"},activeSuggestionCSS:{background:"#E9E9E9"}},g=function(a,b){var c=b.offset();a.css({width:b.outerWidth(),left:c.left+"px",top:c.top+b.outerHeight()+"px"})};e&&a.extend(f,e),f.css.position="absolute",f.css["z-index"]=9999,b.attr("autocomplete","off"),0===this._numSuggestionElements&&c.bind("resize",function(){a(".jquery-form-suggestions").each(function(){var b=a(this),c=b.attr("data-suggest-container");g(b,a(".suggestions-"+c).eq(0))})}),this._numSuggestionElements++;var h=function(b){var c=b.valAttr("suggestion-nr");a.formUtils._selectedSuggestion=null,a.formUtils._previousTypedVal=null,a(".jquery-form-suggestion-"+c).fadeOut("fast")};return b.data("suggestions",d).valAttr("suggestion-nr",this._numSuggestionElements).unbind("focus.suggest").bind("focus.suggest",function(){a(this).trigger("keyup"),a.formUtils._selectedSuggestion=null}).unbind("keyup.suggest").bind("keyup.suggest",function(){var c=a(this),d=[],e=a.trim(c.val()).toLocaleLowerCase();if(e!==a.formUtils._previousTypedVal){a.formUtils._previousTypedVal=e;var i=!1,j=c.valAttr("suggestion-nr"),k=a(".jquery-form-suggestion-"+j);if(k.scrollTop(0),""!==e){var l=e.length>2;a.each(c.data("suggestions"),function(a,b){var c=b.toLocaleLowerCase();return c===e?(d.push("<strong>"+b+"</strong>"),i=!0,!1):void((0===c.indexOf(e)||l&&c.indexOf(e)>-1)&&d.push(b.replace(new RegExp(e,"gi"),"<strong>$&</strong>")))})}i||0===d.length&&k.length>0?k.hide():d.length>0&&0===k.length?(k=a("<div></div>").css(f.css).appendTo("body"),b.addClass("suggestions-"+j),k.attr("data-suggest-container",j).addClass("jquery-form-suggestions").addClass("jquery-form-suggestion-"+j)):d.length>0&&!k.is(":visible")&&k.show(),d.length>0&&e.length!==d[0].length&&(g(k,c),k.html(""),a.each(d,function(b,d){a("<div></div>").append(d).css({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"5px"}).addClass("form-suggest-element").appendTo(k).click(function(){c.focus(),c.val(a(this).text()),c.trigger("change"),h(c)})}))}}).unbind("keydown.validation").bind("keydown.validation",function(b){var c,d,e=b.keyCode?b.keyCode:b.which,g=a(this);if(13===e&&null!==a.formUtils._selectedSuggestion){if(c=g.valAttr("suggestion-nr"),d=a(".jquery-form-suggestion-"+c),d.length>0){var i=d.find("div").eq(a.formUtils._selectedSuggestion).text();g.val(i),g.trigger("change"),h(g),b.preventDefault()}}else{c=g.valAttr("suggestion-nr"),d=a(".jquery-form-suggestion-"+c);var j=d.children();if(j.length>0&&a.inArray(e,[38,40])>-1){38===e?(null===a.formUtils._selectedSuggestion?a.formUtils._selectedSuggestion=j.length-1:a.formUtils._selectedSuggestion--,a.formUtils._selectedSuggestion<0&&(a.formUtils._selectedSuggestion=j.length-1)):40===e&&(null===a.formUtils._selectedSuggestion?a.formUtils._selectedSuggestion=0:a.formUtils._selectedSuggestion++,a.formUtils._selectedSuggestion>j.length-1&&(a.formUtils._selectedSuggestion=0));var k=d.innerHeight(),l=d.scrollTop(),m=d.children().eq(0).outerHeight(),n=m*a.formUtils._selectedSuggestion;return(n<l||n>l+k)&&d.scrollTop(n),j.removeClass("active-suggestion").css("background","none").eq(a.formUtils._selectedSuggestion).addClass("active-suggestion").css(f.activeSuggestionCSS),b.preventDefault(),!1}}}).unbind("blur.suggest").bind("blur.suggest",function(){h(a(this))}),b},LANG:{errorTitle:"Form submission failed!",requiredField:"This is a required field",requiredFields:"You have not answered all required fields",badTime:"You have not given a correct time",badEmail:"You have not given a correct e-mail address",badTelephone:"You have not given a correct phone number",badSecurityAnswer:"You have not given a correct answer to the security question",badDate:"You have not given a correct date",lengthBadStart:"The input value must be between ",lengthBadEnd:" characters",lengthTooLongStart:"The input value is longer than ",lengthTooShortStart:"The input value is shorter than ",notConfirmed:"Input values could not be confirmed",badDomain:"Incorrect domain value",badUrl:"The input value is not a correct URL",badCustomVal:"The input value is incorrect",andSpaces:" and spaces ",badInt:"The input value was not a correct number",badSecurityNumber:"Your social security number was incorrect",badUKVatAnswer:"Incorrect UK VAT Number",badUKNin:"Incorrect UK NIN",badUKUtr:"Incorrect UK UTR Number",badStrength:"The password isn't strong enough",badNumberOfSelectedOptionsStart:"You have to choose at least ",badNumberOfSelectedOptionsEnd:" answers",badAlphaNumeric:"The input value can only contain alphanumeric characters ",badAlphaNumericExtra:" and ",wrongFileSize:"The file you are trying to upload is too large (max %s)",wrongFileType:"Only files of type %s is allowed",groupCheckedRangeStart:"Please choose between ",groupCheckedTooFewStart:"Please choose at least ",groupCheckedTooManyStart:"Please choose a maximum of ",groupCheckedEnd:" item(s)",badCreditCard:"The credit card number is not correct",badCVV:"The CVV number was not correct",wrongFileDim:"Incorrect image dimensions,",imageTooTall:"the image can not be taller than",imageTooWide:"the image can not be wider than",imageTooSmall:"the image was too small",min:"min",max:"max",imageRatioNotAccepted:"Image ratio is not be accepted",badBrazilTelephoneAnswer:"The phone number entered is invalid",badBrazilCEPAnswer:"The CEP entered is invalid",badBrazilCPFAnswer:"The CPF entered is invalid",badPlPesel:"The PESEL entered is invalid",badPlNip:"The NIP entered is invalid",badPlRegon:"The REGON entered is invalid",badreCaptcha:"Please confirm that you are not a bot",passwordComplexityStart:"Password must contain at least ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" uppercase letter(s)",passwordComplexityLowercaseInfo:" lowercase letter(s)",passwordComplexitySpecialCharsInfo:" special character(s)",passwordComplexityNumericCharsInfo:" numeric character(s)",passwordComplexityEnd:"."}})}(a,window),function(a){a.formUtils.addValidator({name:"email",validatorFunction:function(b){var c=b.toLowerCase().split("@"),d=c[0],e=c[1];if(d&&e){if(0===d.indexOf('"')){var f=d.length;if(d=d.replace(/\"/g,""),d.length!==f-2)return!1}return a.formUtils.validators.validate_domain.validatorFunction(c[1])&&0!==d.indexOf(".")&&"."!==d.substring(d.length-1,d.length)&&d.indexOf("..")===-1&&!/[^\w\+\.\-\#\-\_\~\!\$\&\'\(\)\*\+\,\;\=\:]/.test(d)}return!1},errorMessage:"",errorMessageKey:"badEmail"}),a.formUtils.addValidator({name:"domain",validatorFunction:function(a){return a.length>0&&a.length<=253&&!/[^a-zA-Z0-9]/.test(a.slice(-2))&&!/[^a-zA-Z0-9]/.test(a.substr(0,1))&&!/[^a-zA-Z0-9\.\-]/.test(a)&&1===a.split("..").length&&a.split(".").length>1},errorMessage:"",errorMessageKey:"badDomain"}),a.formUtils.addValidator({name:"required",validatorFunction:function(b,c,d,e,f){switch(c.attr("type")){case"checkbox":return c.is(":checked");case"radio":return f.find('input[name="'+c.attr("name")+'"]').filter(":checked").length>0;default:return""!==a.trim(b)}},errorMessage:"",errorMessageKey:function(a){return"top"===a.errorMessagePosition||"function"==typeof a.errorMessagePosition?"requiredFields":"requiredField"}}),a.formUtils.addValidator({name:"length",validatorFunction:function(b,c,d,e){var f=c.valAttr("length"),g=c.attr("type");if(void 0===f)return alert('Please add attribute "data-validation-length" to '+c[0].nodeName+" named "+c.attr("name")),!0;var h,i="file"===g&&void 0!==c.get(0).files?c.get(0).files.length:b.length,j=a.formUtils.numericRangeCheck(i,f);switch(j[0]){case"out":this.errorMessage=e.lengthBadStart+f+e.lengthBadEnd,h=!1;break;case"min":this.errorMessage=e.lengthTooShortStart+j[1]+e.lengthBadEnd,h=!1;break;case"max":this.errorMessage=e.lengthTooLongStart+j[1]+e.lengthBadEnd,h=!1;break;default:h=!0}return h},errorMessage:"",errorMessageKey:""}),a.formUtils.addValidator({name:"url",validatorFunction:function(b){var c=/^(https?|ftp):\/\/((((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])(\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])(\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|\[|\]|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;if(c.test(b)){var d=b.split("://")[1],e=d.indexOf("/");return e>-1&&(d=d.substr(0,e)),a.formUtils.validators.validate_domain.validatorFunction(d)}return!1},errorMessage:"",errorMessageKey:"badUrl"}),a.formUtils.addValidator({name:"number",validatorFunction:function(a,b,c){if(""!==a){var d,e,f=b.valAttr("allowing")||"",g=b.valAttr("decimal-separator")||c.decimalSeparator,h=!1,i=b.valAttr("step")||"",j=!1,k=b.attr("data-sanitize")||"",l=k.match(/(^|[\s])numberFormat([\s]|$)/i);if(l){if(!window.numeral)throw new ReferenceError("The data-sanitize value numberFormat cannot be used without the numeral library. Please see Data Validation in http://www.formvalidator.net for more information.");a.length&&(a=String(numeral().unformat(a)))}if(f.indexOf("number")===-1&&(f+=",number"),f.indexOf("negative")===-1&&0===a.indexOf("-"))return!1;if(f.indexOf("range")>-1&&(d=parseFloat(f.substring(f.indexOf("[")+1,f.indexOf(";"))),e=parseFloat(f.substring(f.indexOf(";")+1,f.indexOf("]"))),h=!0),""!==i&&(j=!0),","===g){if(a.indexOf(".")>-1)return!1;a=a.replace(",",".")}if(""===a.replace(/[0-9-]/g,"")&&(!h||a>=d&&a<=e)&&(!j||a%i===0))return!0;if(f.indexOf("float")>-1&&null!==a.match(new RegExp("^([0-9-]+)\\.([0-9]+)$"))&&(!h||a>=d&&a<=e)&&(!j||a%i===0))return!0}return!1},errorMessage:"",errorMessageKey:"badInt"}),a.formUtils.addValidator({name:"alphanumeric",validatorFunction:function(b,c,d,e){var f="^([a-zA-Z0-9",g="]+)$",h=c.valAttr("allowing"),i="",j=!1;if(h){i=f+h+g;var k=h.replace(/\\/g,"");k.indexOf(" ")>-1&&(j=!0,k=k.replace(" ",""),k+=e.andSpaces||a.formUtils.LANG.andSpaces),e.badAlphaNumericAndExtraAndSpaces&&e.badAlphaNumericAndExtra?j?this.errorMessage=e.badAlphaNumericAndExtraAndSpaces+k:this.errorMessage=e.badAlphaNumericAndExtra+k+e.badAlphaNumericExtra:this.errorMessage=e.badAlphaNumeric+e.badAlphaNumericExtra+k;
|
10 |
-
}else i=f+g,this.errorMessage=e.badAlphaNumeric;return new RegExp(i).test(b)},errorMessage:"",errorMessageKey:""}),a.formUtils.addValidator({name:"custom",validatorFunction:function(a,b){var c=new RegExp(b.valAttr("regexp"));return c.test(a)},errorMessage:"",errorMessageKey:"badCustomVal"}),a.formUtils.addValidator({name:"date",validatorFunction:function(b,c,d){var e=c.valAttr("format")||d.dateFormat||"yyyy-mm-dd",f="false"===c.valAttr("require-leading-zero");return a.formUtils.parseDate(b,e,f)!==!1},errorMessage:"",errorMessageKey:"badDate"}),a.formUtils.addValidator({name:"checkbox_group",validatorFunction:function(b,c,d,e,f){var g=!0,h=c.attr("name"),i=a('input[type=checkbox][name^="'+h+'"]',f),j=i.filter(":checked").length,k=c.valAttr("qty");if(void 0===k){var l=c.get(0).nodeName;alert('Attribute "data-validation-qty" is missing from '+l+" named "+c.attr("name"))}var m=a.formUtils.numericRangeCheck(j,k);switch(m[0]){case"out":this.errorMessage=e.groupCheckedRangeStart+k+e.groupCheckedEnd,g=!1;break;case"min":this.errorMessage=e.groupCheckedTooFewStart+m[1]+(e.groupCheckedTooFewEnd||e.groupCheckedEnd),g=!1;break;case"max":this.errorMessage=e.groupCheckedTooManyStart+m[1]+(e.groupCheckedTooManyEnd||e.groupCheckedEnd),g=!1;break;default:g=!0}if(!g){var n=function(){i.unbind("click",n),i.filter("*[data-validation]").validateInputOnBlur(e,d,!1,"blur")};i.bind("click",n)}return g}})}(a)});
|
11 |
-
|
12 |
/*
|
13 |
A simple jQuery modal (http://github.com/kylefox/jquery-modal)
|
14 |
Version 0.9.1
|
@@ -54,7 +43,7 @@ jQuery(document).ready(function($){
|
|
54 |
}
|
55 |
})
|
56 |
|
57 |
-
$('#advanced:checkbox').change
|
58 |
var checked = $(this).is(':checked');
|
59 |
if (checked){
|
60 |
$('#forcesnopperwrap').show();
|
@@ -97,7 +86,7 @@ jQuery(document).ready(function($){
|
|
97 |
}
|
98 |
|
99 |
// When the snippet type option is changed
|
100 |
-
snippet_type.change
|
101 |
// Store current value
|
102 |
var val = $(this).val();
|
103 |
|
@@ -142,7 +131,7 @@ jQuery(document).ready(function($){
|
|
142 |
$('input[name="ga_events_options[permitted_roles][]"][value="administrator"]').css({'pointer-events': 'none',
|
143 |
'opacity': 0.5}).prop('checked', true);
|
144 |
|
145 |
-
$('.divs-istracktime:checkbox').change
|
146 |
var checkbox = $(this);
|
147 |
var checked = checkbox.is(':checked');
|
148 |
var index = checkbox.data('track');
|
@@ -158,7 +147,7 @@ jQuery(document).ready(function($){
|
|
158 |
|
159 |
});
|
160 |
|
161 |
-
$('#empty-istracktime:checkbox').change
|
162 |
var checkbox = $(this);
|
163 |
var checked = checkbox.is(':checked');
|
164 |
var trackValue = "#empty-trackelem";
|
@@ -199,21 +188,20 @@ var gaeAjax = ( function ( $ ) {
|
|
199 |
}
|
200 |
|
201 |
// Form Submit
|
202 |
-
|
203 |
-
$(".wpgae-event-form").on('submit', submitEventForm);
|
204 |
// Populate and Show the edit event modal
|
205 |
-
$(".ga_main .edit a").click
|
206 |
// Populate and Show the Delete event modal
|
207 |
-
$(".ga_main .delete a").click
|
208 |
|
209 |
|
210 |
-
$('.deactivate a[href*="wp-google-analytics-events"], #wpgae-modal-cancel a').click
|
211 |
e.preventDefault();
|
212 |
$("#wpgae-modal-content, #wpgae-modal-background").toggleClass("active");
|
213 |
$("#wpgae-just-deactivate").attr("href", this.href);
|
214 |
});
|
215 |
|
216 |
-
$('#wpgae-feedback-form').submit
|
217 |
e.preventDefault(); // avoid to execute the actual submit of the form.
|
218 |
var form = $(this);
|
219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/*
|
2 |
A simple jQuery modal (http://github.com/kylefox/jquery-modal)
|
3 |
Version 0.9.1
|
43 |
}
|
44 |
})
|
45 |
|
46 |
+
$('#advanced:checkbox').on('change', function (){
|
47 |
var checked = $(this).is(':checked');
|
48 |
if (checked){
|
49 |
$('#forcesnopperwrap').show();
|
86 |
}
|
87 |
|
88 |
// When the snippet type option is changed
|
89 |
+
snippet_type.on('change', function (){
|
90 |
// Store current value
|
91 |
var val = $(this).val();
|
92 |
|
131 |
$('input[name="ga_events_options[permitted_roles][]"][value="administrator"]').css({'pointer-events': 'none',
|
132 |
'opacity': 0.5}).prop('checked', true);
|
133 |
|
134 |
+
$('.divs-istracktime:checkbox').on('change', function (){
|
135 |
var checkbox = $(this);
|
136 |
var checked = checkbox.is(':checked');
|
137 |
var index = checkbox.data('track');
|
147 |
|
148 |
});
|
149 |
|
150 |
+
$('#empty-istracktime:checkbox').on('change', function (){
|
151 |
var checkbox = $(this);
|
152 |
var checked = checkbox.is(':checked');
|
153 |
var trackValue = "#empty-trackelem";
|
188 |
}
|
189 |
|
190 |
// Form Submit
|
191 |
+
$(".wpgae-event-form").on('submit', submitEventForm);
|
|
|
192 |
// Populate and Show the edit event modal
|
193 |
+
$(".ga_main .edit a").on('click', openAndPoplulateEventModal);
|
194 |
// Populate and Show the Delete event modal
|
195 |
+
$(".ga_main .delete a").on('click', openAndPoplulateEventModal);
|
196 |
|
197 |
|
198 |
+
$('.deactivate a[href*="wp-google-analytics-events"], #wpgae-modal-cancel a').on('click', function(e) {
|
199 |
e.preventDefault();
|
200 |
$("#wpgae-modal-content, #wpgae-modal-background").toggleClass("active");
|
201 |
$("#wpgae-just-deactivate").attr("href", this.href);
|
202 |
});
|
203 |
|
204 |
+
$('#wpgae-feedback-form').on('submit', function (e) {
|
205 |
e.preventDefault(); // avoid to execute the actual submit of the form.
|
206 |
var form = $(this);
|
207 |
|
js/dist/frontend-scripts-min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var gaeMapper=function(){if("undefined"!=typeof ga_options){function e(e){var
|
1 |
+
var gaeMapper=function(){if("undefined"!=typeof ga_options){function e(e){var a="";return"class"===e.type?a+=".":"id"===e.type&&(a+="#"),a+=e.name}for(var a=[],n=ga_options.click_elements,t=0;t<n.length;t++){var o=n[t];newClickElement={};var r="true"===o.bounce;newClickElement.data={select:e(o),category:o.category,action:o.action,label:o.label,bounce:r,evalue:o.value,link_click_delay:parseInt(ga_options.link_clicks_delay),universal:parseInt(ga_options.universal)},newClickElement.selector=newClickElement.data.select,a.push(newClickElement)}var i=ga_options.scroll_elements,l=[];return void 0!==i&&i.forEach(function(a){var n="true"===a.bounce;l.push({select:e(a),category:a.category,action:a.action,label:a.label,bounce:n,evalue:a.value})}),{clickElementsFromDB:a,scrollElementsFromDB:l,advancedMode:ga_options.advanced,forceSnippet:ga_options.force_snippet,emailLinksTracking:ga_options.email_link_tracking,telLinksTracking:ga_options.tel_link_tracking,downloadTracking:ga_options.download_tracking,downloadTrackingFileTypes:ga_options.download_tracking_type,link_clicks_delay:ga_options.link_clicks_delay,snippet_type:ga_options.snippet_type,isFrontPage:gaePlaceholders.is_front_page,pageTitle:gaePlaceholders.page_title,scriptDebugMode:ga_options.script_debug_mode}}}();gaEventsMain=function(e){"use strict";var a;function n(){for(var a=e(window).height(),n=e(document).scrollTop(),t=0;t<gaeMapper.scrollElementsFromDB.length;t++)if(!gaeMapper.scrollElementsFromDB[t].sent){var r=e(gaeMapper.scrollElementsFromDB[t].select);gaeMapper.scrollElementsFromDB[t].offset=r.offset(),gaeMapper.scrollElementsFromDB[t].offset&&n+a>=gaeMapper.scrollElementsFromDB[t].offset.top+r.height()&&(o(gaeMapper.scrollElementsFromDB[t].category,gaeMapper.scrollElementsFromDB[t].action,gaeMapper.scrollElementsFromDB[t].label,gaeMapper.scrollElementsFromDB[t].bounce,gaeMapper.scrollElementsFromDB[t].evalue),gaeMapper.scrollElementsFromDB[t].sent=!0)}}e(document).ready(function(){gaeMapper.clickElementsFromDB.forEach(function(a){e("body").on("click",a.selector,a.data,u)}),"1"===gaeMapper.downloadTracking&&gaeMapper.downloadTrackingFileTypes.forEach(function(a){var n=a.toLowerCase(),o=a.toUpperCase();e("body").on("click",'a[href$=".'+n+'"]',t),e("body").on("click",'a[href$=".'+o+'"]',t)}),"1"===gaeMapper.emailLinksTracking&&e("body").on("click",'a[href^="mailto:"]',function(e){e.preventDefault();var a=this.href.split(":").pop(),n=v();o(n,"Email Link",a,!1,""),d(this,e)}),"1"===gaeMapper.telLinksTracking&&e("body").on("click",'a[href^="tel:"]',function(e){e.preventDefault();var a=this.href.split(":").pop(),n=v();o(n,"Telephone Number Link",a,!1,""),d(this,e)}),e(window).on("scroll",n)});var t=function(e){e.preventDefault();var a=this.href.split("/").pop(),n=v();o(n,"Download",a,!1,""),d(this,e)},o=function(e,n,t,o,u){if(void 0===a)if("undefined"!=typeof ga)a=ga;else if("undefined"!=typeof _gaq)a=_gaq;else if("function"==typeof __gaTracker)a=__gaTracker;else if("function"==typeof gaplusu)a=gaplusu;else if("gtm"!==gaeMapper.snippet_type&&"undefined"==typeof dataLayer)return;e=e||"uncategorized",n=n||"",t=t||"";var d=u||"",_=o||!1;switch(gaeMapper.forceSnippet){case"none":i()?s(e,n,t,d,_):r()?p(e,n,t,d,_):l()?g(e,n,t,d,_):c()&&f(e,n,t,d,_);break;case"gtm":p(e,n,t,d,_);break;case"gst":s(e,n,t,d,_);break;case"universal":g(e,n,t,d,_)}},r=function(){return"gtm"===gaeMapper.snippet_type||"undefined"!=typeof dataLayer&&"undefined"==typeof gtag},i=function(){return"gst"===gaeMapper.snippet_type||"undefined"!=typeof gtag},l=function(){return"universal"===gaeMapper.snippet_type||"undefined"!=typeof ga||"function"==typeof __gaTracker},c=function(){return"legacy"===gaeMapper.snippet_type||"undefined"!=typeof _gaq},p=function(e,a,n,t,o){dataLayer.push({event:"WPGAE",eventCategory:e,eventAction:a,eventLabel:n,eventValue:t,nonInteraction:o})},s=function(e,a,n,t,o){gtag("event",a,{event_category:e,event_label:n,value:t,non_interaction:o})},g=function(e,n,t,o,r){o?a("send","event",e,n,t,o,{nonInteraction:r}):a("send","event",e,n,t,{nonInteraction:r})},f=function(e,n,t,o,r){a.push(["_trackEvent",e,n,t,o,r])},u=function(e){o(e.data.category,e.data.action,e.data.label,e.data.bounce,e.data.evalue,this),void 0!==e.data.link_click_delay&&e.data.link_click_delay>0&&void 0!==e.target.href&&"A"==e.target.nodeName&&d(this,e)},d=function(a,n){n.preventDefault();var t,o=_(n),r=function(a){var n=e(a).attr("target");return void 0!==n&&"_blank"===n.trim()}(a);r&&(t=window.open("","_blank"));var i=k(o);void 0!==i&&""!==i?window.location.hash=i:window.location.href!==o&&setTimeout(function(){r?t.location.href=o:window.location=o},parseInt(gaeMapper.link_clicks_delay),t)},_=function(a){return"A"!==a.target.tagName?e(a.target).parents("a").attr("href"):a.target.href},k=function(e){return void 0!==e&&0===e.indexOf("#")?e:""};function v(){return"1"===gaeMapper.isFrontPage?"Home":void 0!==gaeMapper.pageTitle?gaeMapper.pageTitle:""}}(jQuery);
|
js/dist/frontend-scripts.js
CHANGED
@@ -49,13 +49,13 @@ var gaeMapper = (function () {
|
|
49 |
var clicked = click_elements_from_options[i];
|
50 |
newClickElement = {};
|
51 |
|
52 |
-
|
53 |
newClickElement.data = {
|
54 |
"select": makeSelector(clicked),
|
55 |
"category": clicked.category,
|
56 |
"action": clicked.action,
|
57 |
"label": clicked.label,
|
58 |
-
"bounce":
|
59 |
"evalue": clicked.value, // "value" in DB. Change in project?
|
60 |
"link_click_delay": parseInt(ga_options.link_clicks_delay),
|
61 |
"universal": parseInt(ga_options.universal)
|
@@ -76,12 +76,14 @@ var gaeMapper = (function () {
|
|
76 |
// NB these will be assigned meaningful names in backend eventually
|
77 |
if (typeof scroll_elements_from_options !== "undefined") {
|
78 |
scroll_elements_from_options.forEach(function (el) {
|
|
|
|
|
79 |
scrollElementsFromDB.push({
|
80 |
"select": makeSelector(el),
|
81 |
"category": el.category,
|
82 |
"action": el.action,
|
83 |
"label": el.label,
|
84 |
-
"bounce":
|
85 |
"evalue": el.value // "value" in DB. Change in project?
|
86 |
});
|
87 |
});
|
49 |
var clicked = click_elements_from_options[i];
|
50 |
newClickElement = {};
|
51 |
|
52 |
+
var nonInteraction = (clicked.bounce === "true");
|
53 |
newClickElement.data = {
|
54 |
"select": makeSelector(clicked),
|
55 |
"category": clicked.category,
|
56 |
"action": clicked.action,
|
57 |
"label": clicked.label,
|
58 |
+
"bounce": nonInteraction,
|
59 |
"evalue": clicked.value, // "value" in DB. Change in project?
|
60 |
"link_click_delay": parseInt(ga_options.link_clicks_delay),
|
61 |
"universal": parseInt(ga_options.universal)
|
76 |
// NB these will be assigned meaningful names in backend eventually
|
77 |
if (typeof scroll_elements_from_options !== "undefined") {
|
78 |
scroll_elements_from_options.forEach(function (el) {
|
79 |
+
var nonInteraction = (el.bounce === "true");
|
80 |
+
|
81 |
scrollElementsFromDB.push({
|
82 |
"select": makeSelector(el),
|
83 |
"category": el.category,
|
84 |
"action": el.action,
|
85 |
"label": el.label,
|
86 |
+
"bounce": nonInteraction,
|
87 |
"evalue": el.value // "value" in DB. Change in project?
|
88 |
});
|
89 |
});
|
js/main.js
CHANGED
@@ -49,13 +49,13 @@ var gaeMapper = (function () {
|
|
49 |
var clicked = click_elements_from_options[i];
|
50 |
newClickElement = {};
|
51 |
|
52 |
-
|
53 |
newClickElement.data = {
|
54 |
"select": makeSelector(clicked),
|
55 |
"category": clicked.category,
|
56 |
"action": clicked.action,
|
57 |
"label": clicked.label,
|
58 |
-
"bounce":
|
59 |
"evalue": clicked.value, // "value" in DB. Change in project?
|
60 |
"link_click_delay": parseInt(ga_options.link_clicks_delay),
|
61 |
"universal": parseInt(ga_options.universal)
|
@@ -76,12 +76,14 @@ var gaeMapper = (function () {
|
|
76 |
// NB these will be assigned meaningful names in backend eventually
|
77 |
if (typeof scroll_elements_from_options !== "undefined") {
|
78 |
scroll_elements_from_options.forEach(function (el) {
|
|
|
|
|
79 |
scrollElementsFromDB.push({
|
80 |
"select": makeSelector(el),
|
81 |
"category": el.category,
|
82 |
"action": el.action,
|
83 |
"label": el.label,
|
84 |
-
"bounce":
|
85 |
"evalue": el.value // "value" in DB. Change in project?
|
86 |
});
|
87 |
});
|
@@ -386,8 +388,8 @@ gaEventsMain = (function ($) {
|
|
386 |
var isNewTab = function (self) {
|
387 |
var target = $(self).attr("target")
|
388 |
if (typeof target !== "undefined" && target.trim() === "_blank") {
|
389 |
-
|
390 |
-
|
391 |
return false;
|
392 |
}
|
393 |
|
49 |
var clicked = click_elements_from_options[i];
|
50 |
newClickElement = {};
|
51 |
|
52 |
+
var nonInteraction = (clicked.bounce === "true");
|
53 |
newClickElement.data = {
|
54 |
"select": makeSelector(clicked),
|
55 |
"category": clicked.category,
|
56 |
"action": clicked.action,
|
57 |
"label": clicked.label,
|
58 |
+
"bounce": nonInteraction,
|
59 |
"evalue": clicked.value, // "value" in DB. Change in project?
|
60 |
"link_click_delay": parseInt(ga_options.link_clicks_delay),
|
61 |
"universal": parseInt(ga_options.universal)
|
76 |
// NB these will be assigned meaningful names in backend eventually
|
77 |
if (typeof scroll_elements_from_options !== "undefined") {
|
78 |
scroll_elements_from_options.forEach(function (el) {
|
79 |
+
var nonInteraction = (el.bounce === "true");
|
80 |
+
|
81 |
scrollElementsFromDB.push({
|
82 |
"select": makeSelector(el),
|
83 |
"category": el.category,
|
84 |
"action": el.action,
|
85 |
"label": el.label,
|
86 |
+
"bounce": nonInteraction,
|
87 |
"evalue": el.value // "value" in DB. Change in project?
|
88 |
});
|
89 |
});
|
388 |
var isNewTab = function (self) {
|
389 |
var target = $(self).attr("target")
|
390 |
if (typeof target !== "undefined" && target.trim() === "_blank") {
|
391 |
+
return true;
|
392 |
+
}
|
393 |
return false;
|
394 |
}
|
395 |
|
readme.txt
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
=== WP Google Analytics Events ===
|
2 |
Contributors: yuvalo
|
3 |
Tags: analytics, google, events, ga, google analytics, tracking
|
4 |
-
Tested up to: 5.
|
5 |
-
Stable tag: 2.6.
|
6 |
License: GPLv2
|
7 |
Requires at least: 3.0
|
8 |
|
@@ -106,6 +106,11 @@ If you are looking for more in-depth support, we encourage you to check out [WP
|
|
106 |
2. Google Analytics real time events screenshot-4.png
|
107 |
|
108 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
109 |
= Version 2.6.2 =
|
110 |
1. Fixes a bug where tracking anchor links leads to an invalid page.
|
111 |
|
1 |
=== WP Google Analytics Events ===
|
2 |
Contributors: yuvalo
|
3 |
Tags: analytics, google, events, ga, google analytics, tracking
|
4 |
+
Tested up to: 5.8.2
|
5 |
+
Stable tag: 2.6.3
|
6 |
License: GPLv2
|
7 |
Requires at least: 3.0
|
8 |
|
106 |
2. Google Analytics real time events screenshot-4.png
|
107 |
|
108 |
== Changelog ==
|
109 |
+
|
110 |
+
= Version 2.6.3 =
|
111 |
+
1. User interface improvements.
|
112 |
+
2. Fixin a bug with non-interaction.
|
113 |
+
|
114 |
= Version 2.6.2 =
|
115 |
1. Fixes a bug where tracking anchor links leads to an invalid page.
|
116 |
|
templates/click-elements-input-table.php
CHANGED
@@ -34,9 +34,14 @@ $clickTracking = new ClickTracking_Table();
|
|
34 |
$wpgae_options = get_option('ga_events_options');
|
35 |
|
36 |
?>
|
37 |
-
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
40 |
<?php
|
41 |
$clickTracking->prepare_items();
|
42 |
?>
|
34 |
$wpgae_options = get_option('ga_events_options');
|
35 |
|
36 |
?>
|
37 |
+
<div class="wrap wpgae-gs-form-tabs">
|
38 |
+
<div class="wpgae-gs-internal">
|
39 |
+
<h2>Click Tracking</h2>
|
40 |
+
<div id="icon-users" class="icon32"></div>
|
41 |
+
</div>
|
42 |
+
<div style="margin-bottom: 10px;" class="wpgae-gs-internal">
|
43 |
+
<a href="#wpgae-add-click-event" rel="modal:open" class="page-title-action">Add New Click Event</a>
|
44 |
+
</div>
|
45 |
<?php
|
46 |
$clickTracking->prepare_items();
|
47 |
?>
|
templates/scroll-elements-input-table.php
CHANGED
@@ -36,8 +36,14 @@ $wpgae_options = get_option('ga_events_options');
|
|
36 |
|
37 |
?>
|
38 |
<div class="wrap">
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
<?php
|
42 |
$scrollTracking->prepare_items();
|
43 |
?>
|
36 |
|
37 |
?>
|
38 |
<div class="wrap">
|
39 |
+
<div class="wrap wpgae-gs-form-tabs">
|
40 |
+
<div class="wpgae-gs-internal">
|
41 |
+
<h2>Scroll Tracking</h2>
|
42 |
+
<div id="icon-users" class="icon32"></div>
|
43 |
+
</div>
|
44 |
+
<div style="margin-bottom: 10px;" class="wpgae-gs-internal">
|
45 |
+
<a href="#wpgae-add-scroll-event" rel="modal:open" class="page-title-action">Add New Scroll Event</a>
|
46 |
+
</div>
|
47 |
<?php
|
48 |
$scrollTracking->prepare_items();
|
49 |
?>
|