Version Description
Oct 06 2022 =
Several integrations added , custom logo for SFW blocking pages added , external forms into iframe protected and some minor issues fixed
- New. MemberPress direct integration.
- New. SFW. Added custom logo on sfw die page.
- New. Integrations. Handle EasyDigitalDownloads plugin registration hook.
- New. External forms. External forms into an iframe has been protected.
- Fix. ct_ajax_hook. Latepoint serice AJAX requests ignored.
- Fix. apbct_settings__prepare_errors() Mismatching types fix.
- Fix. Integrations. Ignore service requests in GiveWP integration.
- Fix: Removed duplication of the hidden field in the search form
- Fix. EmailEncoding. Styles fix.
- Mod. EmailEncoding. Add a tooltip while decoding mailto: links.
- Fix. External forms. Mautic external forms integration.
- Fix. Internal forms. Modify regexp for exclusion urls of wordpress native internal forms.
- Fix. Intergrations. Correct registration flag translation to basecall due EasyDigitalDownloads handling.
- Fix. Common. Rotating m-servers fixed.
- Fix. JS. Custom ajax forms blocking answer fixed.
- Fix. JS. Headless parameter cast to boolean type.
- Fix. NoCookie.php. Remove namespace redundant declaration to keep compat with <php5.6
- Fix. Internal forms. Internal forms protection fixed.
Download this release
Release Info
Developer | shagimuratov |
Plugin | Spam protection, AntiSpam, FireWall by CleanTalk |
Version | 5.186 |
Comparing to | |
See all releases |
Code changes from version 5.185.1 to 5.186
- cleantalk.php +18 -1
- css/cleantalk-public.min.css +1 -1
- css/src/cleantalk-admin-settings-page.css +0 -279
- css/src/cleantalk-admin.css +0 -86
- css/src/cleantalk-dashboard-widget.css +0 -122
- css/src/cleantalk-icons.css +0 -172
- css/src/cleantalk-public-admin.css +0 -64
- css/src/cleantalk-public.css +0 -67
- css/src/cleantalk-spam-check.css +0 -94
- inc/cleantalk-admin.php +4 -0
- inc/cleantalk-ajax.php +2 -1
- inc/cleantalk-public-validate-skip-functions.php +174 -92
- inc/cleantalk-public-validate.php +3 -3
- inc/cleantalk-public.php +1 -6
- inc/cleantalk-settings.php +41 -1
- inc/images/placeholder.png +0 -0
- js/apbct-disable-comments.min.js.map +1 -1
- js/apbct-public--3--cleantalk-modal.min.js +1 -1
- js/apbct-public--3--cleantalk-modal.min.js.map +1 -1
- js/apbct-public-bundle.min.js +1 -1
- js/apbct-public-bundle.min.js.map +1 -1
- js/cleantalk-admin-settings-page.min.js +1 -1
- js/cleantalk-admin-settings-page.min.js.map +1 -1
- js/cleantalk-admin.min.js.map +1 -1
- js/cleantalk-comments-checkspam.min.js +1 -1
- js/cleantalk-comments-checkspam.min.js.map +1 -1
- js/cleantalk-comments-editscreen.min.js.map +1 -1
- js/cleantalk-dashboard-widget.min.js.map +1 -1
- js/cleantalk-debug-ajax.min.js.map +1 -1
- js/cleantalk-public-admin.min.js.map +1 -1
- js/cleantalk-users-checkspam.min.js +1 -1
- js/cleantalk-users-checkspam.min.js.map +1 -1
- js/cleantalk-users-editscreen.min.js.map +1 -1
- js/src/apbct-disable-comments.js +0 -10
- js/src/apbct-public--0--LibBundle.js +0 -865
- js/src/apbct-public--1--functions.js +0 -187
- js/src/apbct-public--2--public.js +0 -789
- js/src/apbct-public--3--cleantalk-modal.js +0 -180
- js/src/apbct-public--4--gdpr.js +0 -95
- js/src/apbct-public--5--external-forms.js +0 -253
- js/src/apbct-public--6--internal-forms.js +0 -77
- js/src/apbct-public-bundle.js +0 -2448
- js/src/cleantalk-admin-settings-page.js +0 -560
- js/src/cleantalk-admin.js +0 -93
- js/src/cleantalk-comments-checkspam.js +0 -455
- js/src/cleantalk-comments-editscreen.js +0 -134
- js/src/cleantalk-dashboard-widget.js +0 -60
- js/src/cleantalk-debug-ajax.js +0 -18
- js/src/cleantalk-public-admin.js +0 -89
- js/src/cleantalk-users-checkspam.js +0 -596
- js/src/cleantalk-users-editscreen.js +0 -56
- lib/Cleantalk/Antispam/Cleantalk.php +1 -1
- lib/Cleantalk/Antispam/Integrations/EasyDigitalDownloads.php +34 -0
- lib/Cleantalk/Antispam/Integrations/GiveWP.php +1 -1
- lib/Cleantalk/Antispam/Integrations/MemberPress.php +51 -0
- lib/Cleantalk/ApbctWP/CleantalkUpgrader.php +2 -0
- lib/Cleantalk/ApbctWP/CleantalkUpgraderSkin.php +2 -2
- lib/Cleantalk/ApbctWP/CleantalkUpgraderSkinDeprecated.php +2 -2
- lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php +10 -5
- lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php +12 -1
- lib/Cleantalk/ApbctWP/Firewall/SFW.php +11 -0
- lib/Cleantalk/ApbctWP/Firewall/die_page_anticrawler.html +1 -1
- lib/Cleantalk/ApbctWP/Firewall/die_page_antiflood.html +3 -0
- lib/Cleantalk/ApbctWP/Firewall/die_page_sfw.html +3 -1
- lib/Cleantalk/ApbctWP/Variables/NoCookie.php +0 -2
- readme.txt +68 -198
cleantalk.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Anti-Spam by CleanTalk
|
5 |
Plugin URI: https://cleantalk.org
|
6 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
7 |
-
Version: 5.
|
8 |
Author: СleanTalk <welcome@cleantalk.org>
|
9 |
Author URI: https://cleantalk.org
|
10 |
Text Domain: cleantalk-spam-protect
|
@@ -371,6 +371,16 @@ $apbct_active_integrations = array(
|
|
371 |
'setting' => 'forms__registrations_test',
|
372 |
'ajax' => false
|
373 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
374 |
);
|
375 |
new \Cleantalk\Antispam\Integrations($apbct_active_integrations, (array)$apbct->settings);
|
376 |
|
@@ -2569,6 +2579,13 @@ function apbct_log($message = 'empty', $func = null, $params = array())
|
|
2569 |
update_option(APBCT_DEBUG, $debug);
|
2570 |
}
|
2571 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2572 |
function apbct_sfw__delete_tables($blog_id, $_drop)
|
2573 |
{
|
2574 |
global $wpdb;
|
4 |
Plugin Name: Anti-Spam by CleanTalk
|
5 |
Plugin URI: https://cleantalk.org
|
6 |
Description: Max power, all-in-one, no Captcha, premium anti-spam plugin. No comment spam, no registration spam, no contact spam, protects any WordPress forms.
|
7 |
+
Version: 5.186
|
8 |
Author: СleanTalk <welcome@cleantalk.org>
|
9 |
Author URI: https://cleantalk.org
|
10 |
Text Domain: cleantalk-spam-protect
|
371 |
'setting' => 'forms__registrations_test',
|
372 |
'ajax' => false
|
373 |
),
|
374 |
+
'MemberPress' => array(
|
375 |
+
'hook' => 'mepr-validate-signup',
|
376 |
+
'setting' => 'forms__registrations_test',
|
377 |
+
'ajax' => false
|
378 |
+
),
|
379 |
+
'EasyDigitalDownloads' => array(
|
380 |
+
'hook' => 'edd_pre_process_register_form',
|
381 |
+
'setting' => 'forms__registrations_test',
|
382 |
+
'ajax' => false
|
383 |
+
),
|
384 |
);
|
385 |
new \Cleantalk\Antispam\Integrations($apbct_active_integrations, (array)$apbct->settings);
|
386 |
|
2579 |
update_option(APBCT_DEBUG, $debug);
|
2580 |
}
|
2581 |
|
2582 |
+
/**
|
2583 |
+
* @param $blog_id
|
2584 |
+
* @param $_drop
|
2585 |
+
*
|
2586 |
+
* @return void
|
2587 |
+
* @psalm-suppress UnusedParam
|
2588 |
+
*/
|
2589 |
function apbct_sfw__delete_tables($blog_id, $_drop)
|
2590 |
{
|
2591 |
global $wpdb;
|
css/cleantalk-public.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#honeypot-field-url,.um-form input[type=text].apbct_special_field,.wc_apbct_email_id,input[class*=apbct].apbct_special_field{display:none!important}.comment-form-cookies-consent{width:100%;overflow:hidden}.apbct-email-encoder{position:relative}.apbct-tooltip
|
1 |
+
#honeypot-field-url,.um-form input[type=text].apbct_special_field,.wc_apbct_email_id,input[class*=apbct].apbct_special_field{display:none!important}.apbct-tooltip,.apbct-tooltip--text{border-radius:5px;background:#d3d3d3}.comment-form-cookies-consent{width:100%;overflow:hidden}.apbct-email-encoder{position:relative}.apbct-tooltip{display:none;position:inherit;margin-top:5px;left:5px;opacity:.9}.apbct-tooltip--text{position:sticky;padding:10px;width:max-content}.apbct-tooltip--arrow{position:absolute;background:#d3d3d3;width:10px;height:10px;top:-5px;left:10px;transform:rotate(135deg)}
|
css/src/cleantalk-admin-settings-page.css
DELETED
@@ -1,279 +0,0 @@
|
|
1 |
-
.apbct_settings-field_content,
|
2 |
-
.cleantalk_link-auto,
|
3 |
-
.cleantalk_link-manual,
|
4 |
-
.ct-warning-test-failed,
|
5 |
-
.ct_rate_block,
|
6 |
-
.ct_settings_banner,
|
7 |
-
i.animate-spin {
|
8 |
-
display: inline-block
|
9 |
-
}
|
10 |
-
|
11 |
-
#apbctTopWarning {margin-bottom: 5px;}
|
12 |
-
#apbctTopWarning h3{margin: 10px 0 5px 0;}
|
13 |
-
#apbctTopWarning h4{margin: 10px;}
|
14 |
-
#apbctTopWarning h4 span{margin-top: 5px;}
|
15 |
-
|
16 |
-
/* Main title */
|
17 |
-
/*.apbct_settings-title{ display: inline-block; }*/
|
18 |
-
.apbct_settings-subtitle{
|
19 |
-
position: relative;
|
20 |
-
top: -15px;
|
21 |
-
margin: 0;
|
22 |
-
}
|
23 |
-
|
24 |
-
/* Setting fields */
|
25 |
-
.apbct_settings-field_wrapper{ margin: 15px 0; }
|
26 |
-
.apbct_settings-field_wrapper--sub{ margin-left: 30px !important; }
|
27 |
-
|
28 |
-
.apbct_settings-field_title{ }
|
29 |
-
.apbct_settings__label{
|
30 |
-
margin-right: 10px;
|
31 |
-
font-size: 17px;
|
32 |
-
vertical-align: text-bottom;
|
33 |
-
}
|
34 |
-
|
35 |
-
.apbct_settings-field_content{ display: inline-block; }
|
36 |
-
.apbct_settings-field_content--checkbox{ }
|
37 |
-
.apbct_settings-field_content--radio,
|
38 |
-
.apbct_settings-field_wrapper > .apbct_settings-field_description {
|
39 |
-
width: 70%;
|
40 |
-
}
|
41 |
-
.apbct_settings-field_content--text{ }
|
42 |
-
|
43 |
-
.apbct_settings-field_title{}
|
44 |
-
.apbct_settings-field_title--checkbox{ }
|
45 |
-
.apbct_settings-field_title--radio{
|
46 |
-
display: inline-block;
|
47 |
-
margin: 0;
|
48 |
-
width: 210px;
|
49 |
-
padding-right: 10px;
|
50 |
-
font-size: 14px;
|
51 |
-
vertical-align: top;
|
52 |
-
}
|
53 |
-
.apbct_input_text{min-width: 255px; width: 400px;}
|
54 |
-
|
55 |
-
.apbct_settings-field--api_key{font-size: 14pt;}
|
56 |
-
|
57 |
-
.apbct_settings-long_description---show:hover{
|
58 |
-
color: #aaaaaa;
|
59 |
-
cursor: pointer;
|
60 |
-
}
|
61 |
-
|
62 |
-
.apbct_setting_textarea {
|
63 |
-
min-width: 300px;
|
64 |
-
}
|
65 |
-
|
66 |
-
.cleantalk_link {
|
67 |
-
text-decoration: none;
|
68 |
-
font-size: 13px;
|
69 |
-
line-height: 26px;
|
70 |
-
margin: 10px 0 0 0;
|
71 |
-
padding: 0 10px 1px;
|
72 |
-
cursor: pointer;
|
73 |
-
border-width: 1px;
|
74 |
-
border-style: solid;
|
75 |
-
-webkit-appearance: none;
|
76 |
-
white-space: nowrap;
|
77 |
-
-webkit-box-sizing: border-box;
|
78 |
-
-moz-box-sizing: border-box;
|
79 |
-
box-sizing: border-box;
|
80 |
-
}
|
81 |
-
.cleantalk_link-auto{
|
82 |
-
background: #ccc;
|
83 |
-
border-color: #999;
|
84 |
-
-webkit-box-shadow: inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);
|
85 |
-
box-shadow: inset 0 1px 0 rgba(200,200,200,.5),0 1px 0 rgba(0,0,0,.15);
|
86 |
-
color: #000;
|
87 |
-
display: inline-block;
|
88 |
-
height: 28px;
|
89 |
-
-webkit-border-radius: 2px;
|
90 |
-
border-radius: 2px;
|
91 |
-
}
|
92 |
-
.cleantalk_link-auto:hover {color: #fff;}
|
93 |
-
.cleantalk_link-manual {
|
94 |
-
background: #2ea2cc;
|
95 |
-
border-color: #0074a2;
|
96 |
-
-webkit-box-shadow: inset 0 1px 0 rgba(120, 200, 230, .5), 0 1px 0 rgba(0, 0, 0, .15);
|
97 |
-
box-shadow: inset 0 1px 0 rgba(120, 200, 230, .5), 0 1px 0 rgba(0, 0, 0, .15);
|
98 |
-
color: #fff;
|
99 |
-
display: inline-block;
|
100 |
-
-webkit-border-radius: 3px;
|
101 |
-
border-radius: 3px;
|
102 |
-
text-align: center;
|
103 |
-
}
|
104 |
-
.cleantalk_link-manual:hover {color:black;}
|
105 |
-
.cleantalk_link[disabled=disabled]{
|
106 |
-
background: #5d9db5; color: #000;
|
107 |
-
}
|
108 |
-
|
109 |
-
.apbct_status_icon{
|
110 |
-
vertical-align: text-bottom;
|
111 |
-
margin: 0 5px 0 8px;
|
112 |
-
}
|
113 |
-
|
114 |
-
a.ct_support_link{
|
115 |
-
color: #666;
|
116 |
-
margin-right: 0.5em;
|
117 |
-
font-size: 10pt;
|
118 |
-
font-weight: normal;
|
119 |
-
}
|
120 |
-
|
121 |
-
.ct-warning-test-failed {
|
122 |
-
display: inline-block;
|
123 |
-
position: relative;
|
124 |
-
padding: 5px;
|
125 |
-
margin: 4px;
|
126 |
-
border: 3px solid rgba(240,50,50,1);
|
127 |
-
border-radius: 5px;
|
128 |
-
background-color: rgba(255,200,200,1);
|
129 |
-
}
|
130 |
-
|
131 |
-
/* Settings banners */
|
132 |
-
.ct_settings_banner{
|
133 |
-
text-align: right;
|
134 |
-
display:inline-block;
|
135 |
-
width: 100%;
|
136 |
-
margin: 1em 0;
|
137 |
-
vertical-align: top;
|
138 |
-
}
|
139 |
-
|
140 |
-
#ct_translate_plugin {margin-left: 0;}
|
141 |
-
.ct_rate_block {
|
142 |
-
display: inline-block;
|
143 |
-
width: 370px;
|
144 |
-
margin-right: 3em;
|
145 |
-
padding: 0.8em 0.8em 15px 0.8em;
|
146 |
-
text-align: center;
|
147 |
-
border: 1px dashed #666;
|
148 |
-
}
|
149 |
-
#ct_translate_plugin .apbct_button_rate{margin-bottom: 10px;}
|
150 |
-
|
151 |
-
.apbct_long_desc{
|
152 |
-
position: absolute;
|
153 |
-
background: #5a5a5a;
|
154 |
-
min-width: 80px; min-height: 80px;
|
155 |
-
max-width: 500px;
|
156 |
-
padding: 10px;
|
157 |
-
color: white;
|
158 |
-
z-index: 10;
|
159 |
-
}
|
160 |
-
.apbct_long_desc a {
|
161 |
-
color: rgba(120,200,230,1);
|
162 |
-
}
|
163 |
-
i.animate-spin{
|
164 |
-
-moz-animation: spin 2s infinite linear;
|
165 |
-
-o-animation: spin 2s infinite linear;
|
166 |
-
-webkit-animation: spin 2s infinite linear;
|
167 |
-
animation: spin 2s infinite linear;
|
168 |
-
display: inline-block;
|
169 |
-
margin: 0 auto;
|
170 |
-
font-size: 25px;
|
171 |
-
line-height: 20px;
|
172 |
-
color: rgba(120,200,230,1);
|
173 |
-
margin: 25px;
|
174 |
-
}
|
175 |
-
@keyframes spin {
|
176 |
-
to{transform: rotate(359deg);}
|
177 |
-
}
|
178 |
-
.apbct_long_desc__cancel{
|
179 |
-
position: absolute;
|
180 |
-
top: 5px; right: 5px;
|
181 |
-
color: rgba(255,255,255,0.5);
|
182 |
-
}
|
183 |
-
.apbct_long_desc__cancel:hover{
|
184 |
-
color: white;
|
185 |
-
}
|
186 |
-
.apbct_long_desc__angle{
|
187 |
-
position: absolute;
|
188 |
-
top: 5px; left: -17px;
|
189 |
-
width: 10px; height: 10px;
|
190 |
-
background: #5a5a5a;
|
191 |
-
-webkit-transform: rotate(135deg);
|
192 |
-
-ms-transform: rotate(135deg);
|
193 |
-
transform: rotate(135deg);
|
194 |
-
-webkit-transform-origin: 100% 100%;
|
195 |
-
-ms-transform-origin: 100% 100%;
|
196 |
-
transform-origin: 100% 100%;
|
197 |
-
}
|
198 |
-
.apbct_long_desc__title{
|
199 |
-
color: rgba(120,200,230,1);
|
200 |
-
margin: 0;
|
201 |
-
}
|
202 |
-
|
203 |
-
.--hide{ display: none; }
|
204 |
-
.apbct_preloader_button{ height: 15px; margin-left: 5px; vertical-align: text-top; display: none; }
|
205 |
-
|
206 |
-
/* Modal Window Stiles */
|
207 |
-
#cleantalk-modal-content {
|
208 |
-
text-align: center;
|
209 |
-
}
|
210 |
-
#cleantalk-modal-content > * {
|
211 |
-
display: block;
|
212 |
-
width: 100%;
|
213 |
-
}
|
214 |
-
|
215 |
-
button.ct_support_link{
|
216 |
-
border: none;
|
217 |
-
background: transparent;
|
218 |
-
color: #666;
|
219 |
-
text-decoration: underline;
|
220 |
-
cursor: pointer;
|
221 |
-
}
|
222 |
-
.apbct-btn-as-link {
|
223 |
-
padding: 0;
|
224 |
-
margin: 0;
|
225 |
-
vertical-align: baseline;
|
226 |
-
color: gray;
|
227 |
-
border: 0 none;
|
228 |
-
border-bottom: 1px solid;
|
229 |
-
cursor: pointer;
|
230 |
-
}
|
231 |
-
#apbct-account-email[contenteditable="true"] {
|
232 |
-
padding: 6px;
|
233 |
-
background-color: #fff;
|
234 |
-
border: 1px solid #ccc;
|
235 |
-
}
|
236 |
-
button[value="save_changes"]:disabled {
|
237 |
-
color: #2271b1;
|
238 |
-
border-color: #2271b1;
|
239 |
-
background: #f6f7f7;
|
240 |
-
}
|
241 |
-
#apbct_settings__advanced_settings {
|
242 |
-
position: relative;
|
243 |
-
}
|
244 |
-
#apbct_settings__advanced_settings_inner {
|
245 |
-
width: 70%;
|
246 |
-
}
|
247 |
-
#apbct_hidden_section_nav {
|
248 |
-
position: absolute;
|
249 |
-
top: 0;
|
250 |
-
right: 20px;
|
251 |
-
}
|
252 |
-
#apbct_settings__after_advanced_settings{
|
253 |
-
margin-bottom: 20px;
|
254 |
-
}
|
255 |
-
#apbct_settings__button_section {
|
256 |
-
position: fixed;
|
257 |
-
z-index: 9999;
|
258 |
-
width: 100%;
|
259 |
-
padding-bottom: 40px;
|
260 |
-
}
|
261 |
-
#cleantalk_notice_review .caption {
|
262 |
-
margin: 0 0 15px;
|
263 |
-
color: gray;
|
264 |
-
}
|
265 |
-
#cleantalk_notice_review .button {
|
266 |
-
margin-bottom: 20px;
|
267 |
-
}
|
268 |
-
|
269 |
-
.apbct_highlighted{
|
270 |
-
outline-offset: 5px;
|
271 |
-
outline-color: red;
|
272 |
-
outline-width: 3px !important;
|
273 |
-
outline-style: solid !important;
|
274 |
-
}
|
275 |
-
|
276 |
-
.apbct_notice_inner{
|
277 |
-
display: flex;
|
278 |
-
margin-top: 10px !important;
|
279 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/src/cleantalk-admin.css
DELETED
@@ -1,86 +0,0 @@
|
|
1 |
-
/* Common styles for admin pages */
|
2 |
-
:disabled{cursor: not-allowed !important;}
|
3 |
-
.apbct_color--gray{color: gray;}
|
4 |
-
.apbct_display--none{display: none;}
|
5 |
-
|
6 |
-
/* Additional styles for admin pages */
|
7 |
-
.ct_meta_links{
|
8 |
-
|
9 |
-
}
|
10 |
-
.ct_translate_links{color: rgba(150, 150, 20, 1);}
|
11 |
-
.ct_support_links {color: rgba(150, 20, 20, 1);}
|
12 |
-
.ct_faq_links {color: rgba(20, 150, 20, 1);}
|
13 |
-
.ct_setting_links {color: rgba(20, 20, 150, 1);}
|
14 |
-
|
15 |
-
.ct_translate_links:hover{color: rgba(210, 210, 20, 1) !important;}
|
16 |
-
.ct_support_links:hover {color: rgba(250, 20, 20, 1) !important;}
|
17 |
-
.ct_faq_links:hover {color: rgba(20, 250, 20, 1) !important;}
|
18 |
-
.ct_setting_links:hover {color: rgba(20, 20, 250, 1) !important;}
|
19 |
-
|
20 |
-
.ct_link_new_tab img{
|
21 |
-
float: none !important;
|
22 |
-
margin: 0 2px;
|
23 |
-
border: 0;
|
24 |
-
}
|
25 |
-
|
26 |
-
#negative_reports_table tr td{
|
27 |
-
padding: 7px 5px !important;
|
28 |
-
}
|
29 |
-
|
30 |
-
#wp-admin-bar-cleantalk_admin_bar__parent_node{
|
31 |
-
margin-right: 5px;
|
32 |
-
}
|
33 |
-
|
34 |
-
#wp-admin-bar-cleantalk_admin_bar__parent_node span {
|
35 |
-
display: inline-block;
|
36 |
-
}
|
37 |
-
|
38 |
-
#wp-admin-bar-cleantalk_admin_bar__parent_node .apbct-icon-attention-alt {
|
39 |
-
background: #d63638;
|
40 |
-
color: #fff;
|
41 |
-
border-radius: 50%;
|
42 |
-
font-size: 12px;
|
43 |
-
}
|
44 |
-
|
45 |
-
#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__spbc_icon{
|
46 |
-
width: 14px;
|
47 |
-
height: 17px;
|
48 |
-
margin-top: 7px;
|
49 |
-
}
|
50 |
-
|
51 |
-
#wp-admin-bar-cleantalk_admin_bar__parent_node img.cleantalk_admin_bar__apbct_icon{
|
52 |
-
width: 18px;
|
53 |
-
height: 18px;
|
54 |
-
margin-top: 7px;
|
55 |
-
}
|
56 |
-
|
57 |
-
#wp-admin-bar-cleantalk_admin_bar__parent_node div.cleantalk_admin_bar__sum_counter{
|
58 |
-
color: #999;
|
59 |
-
display: inline;
|
60 |
-
padding: 2px 5px !important;
|
61 |
-
}
|
62 |
-
|
63 |
-
.cleantalk_admin_bar__blocked div{
|
64 |
-
cursor: not-allowed !important;
|
65 |
-
}
|
66 |
-
|
67 |
-
.cleantalk_admin_bar__blocked div a{
|
68 |
-
color: #777 !important;
|
69 |
-
}
|
70 |
-
|
71 |
-
.cleantalk_admin_bar__title{
|
72 |
-
vertical-align: top;
|
73 |
-
}
|
74 |
-
|
75 |
-
.cleantalk_admin_bar__separator{
|
76 |
-
height: 0px !important;
|
77 |
-
}
|
78 |
-
|
79 |
-
.cleantalk-admin_bar--list_wrapper .ab-sub-wrapper ul:last-child{
|
80 |
-
margin-bottom: 5px !important;
|
81 |
-
}
|
82 |
-
|
83 |
-
.apbct-plugin-errors {
|
84 |
-
margin-left: 0;
|
85 |
-
margin-bottom: 20px;
|
86 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/src/cleantalk-dashboard-widget.css
DELETED
@@ -1,122 +0,0 @@
|
|
1 |
-
#ct_widget_wrapper {
|
2 |
-
position: relative;
|
3 |
-
width: 100%;
|
4 |
-
height: 100%;
|
5 |
-
}
|
6 |
-
.ct_widget_top_links {
|
7 |
-
text-align: right;
|
8 |
-
padding: 0 12px;
|
9 |
-
height: 32px;
|
10 |
-
}
|
11 |
-
.ct_widget_settings_link{margin: 0 0 0 10px;}
|
12 |
-
.ct_widget_refresh_link{}
|
13 |
-
|
14 |
-
.ct_preloader{
|
15 |
-
display: none;
|
16 |
-
float: left;
|
17 |
-
width: 20px; height: 20px;
|
18 |
-
margin: 0 10px;
|
19 |
-
}
|
20 |
-
|
21 |
-
.ct_widget_hr{
|
22 |
-
width: 100%;
|
23 |
-
}
|
24 |
-
|
25 |
-
.ct_widget_block_header{
|
26 |
-
font-size: 18px !important;
|
27 |
-
margin-left: 12px !important;
|
28 |
-
}
|
29 |
-
|
30 |
-
.ct_widget_block{
|
31 |
-
display: block; position: relative;
|
32 |
-
padding: 12px;
|
33 |
-
}
|
34 |
-
.ct_widget_chart_wrapper{
|
35 |
-
height: 300px;
|
36 |
-
margin-right: 10px;
|
37 |
-
}
|
38 |
-
#ct_widget_chart{}
|
39 |
-
|
40 |
-
.bar {fill: steelblue;}
|
41 |
-
.bar:nth-child(odd){fill: rgba(50,50,250,0.9);}
|
42 |
-
.bar:hover {fill: brown;}
|
43 |
-
|
44 |
-
.axis--x path {
|
45 |
-
display: none;
|
46 |
-
}
|
47 |
-
|
48 |
-
.ct_widget_block table{
|
49 |
-
width: 100%;
|
50 |
-
text-align: left;
|
51 |
-
}
|
52 |
-
.ct_widget_block table tr{margin-bottom: 10px;}
|
53 |
-
.ct_widget_block table th{
|
54 |
-
text-align: left;
|
55 |
-
padding: 10px 0 5px 10px;;
|
56 |
-
border-bottom: 2px solid gray;
|
57 |
-
|
58 |
-
}
|
59 |
-
.ct_widget_block table td{
|
60 |
-
text-align: left;
|
61 |
-
padding: 10px 0 5px 10px;;
|
62 |
-
border-bottom: 1px solid gray;
|
63 |
-
}
|
64 |
-
#ct_widget_wrapper .ct_widget_block table td.ct_widget_block__country_cell img {
|
65 |
-
width: 16px !important;
|
66 |
-
height: auto;
|
67 |
-
}
|
68 |
-
|
69 |
-
.ct_widget_button{
|
70 |
-
display: block;
|
71 |
-
margin: 10px auto;
|
72 |
-
}
|
73 |
-
.ct_widget_activate_button{
|
74 |
-
display: block;
|
75 |
-
margin: 10px auto; padding: 7px 15px;
|
76 |
-
font-weight: 600;
|
77 |
-
border-radius: 3px;
|
78 |
-
border: 2px solid #aaa;
|
79 |
-
background: rgba(250,50,50,0.9);
|
80 |
-
}
|
81 |
-
.ct_widget_resolve_button{
|
82 |
-
background: rgba(50,250,50,0.9);
|
83 |
-
}
|
84 |
-
.ct_widget_activate_header{
|
85 |
-
display: inline-block;
|
86 |
-
width: 100%;
|
87 |
-
text-align: center;
|
88 |
-
font-size: 18px !important;
|
89 |
-
}
|
90 |
-
.ct_widget_wprapper_total_blocked{
|
91 |
-
padding: 10px 0 10px 10px;
|
92 |
-
background: #f1f1f1;
|
93 |
-
}
|
94 |
-
.ct_widget_wprapper_total_blocked span{
|
95 |
-
position: relative;
|
96 |
-
top: 2px;
|
97 |
-
}
|
98 |
-
.ct_widget_small_logo{
|
99 |
-
margin-right: 1em;
|
100 |
-
vertical-align: middle;
|
101 |
-
}
|
102 |
-
#ct_widget_wrapper .ct_widget_wprapper_total_blocked img.ct_widget_small_logo {
|
103 |
-
width: 24px !important;
|
104 |
-
height: 24px !important;
|
105 |
-
}
|
106 |
-
#ct_widget_button_view_all{
|
107 |
-
cursor: pointer;
|
108 |
-
border: 1px solid #0074a2;
|
109 |
-
-webkit-appearance: none;
|
110 |
-
-webkit-border-radius: 2px;
|
111 |
-
border-radius: 2px;
|
112 |
-
white-space: nowrap;
|
113 |
-
-webkit-box-sizing: border-box;
|
114 |
-
-moz-box-sizing: border-box;
|
115 |
-
box-sizing: border-box;
|
116 |
-
background: #0085ba;
|
117 |
-
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,.5), 0 1px 0 rgba(0,0,0,.15);
|
118 |
-
box-shadow: inset 0 1px 0 rgba(120,200,230,.5), 0 1px 0 rgba(0,0,0,.15);
|
119 |
-
color: #fff;
|
120 |
-
}
|
121 |
-
#ct_widget_button_view_all:hover{color: #000 !important;}
|
122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/src/cleantalk-icons.css
DELETED
@@ -1,172 +0,0 @@
|
|
1 |
-
@font-face {
|
2 |
-
font-family: 'fontello';
|
3 |
-
src: url('./fonts/icons/icons.eot');
|
4 |
-
src: url('./fonts/icons/icons.eot') format('embedded-opentype'),
|
5 |
-
url('./fonts/icons/icons.woff2') format('woff2'),
|
6 |
-
url('./fonts/icons/icons.woff') format('woff'),
|
7 |
-
url('./fonts/icons/icons.ttf') format('truetype'),
|
8 |
-
url('./fonts/icons/icons.svg') format('svg');
|
9 |
-
font-weight: normal;
|
10 |
-
font-style: normal;
|
11 |
-
}
|
12 |
-
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
|
13 |
-
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
|
14 |
-
/*
|
15 |
-
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
16 |
-
@font-face {
|
17 |
-
font-family: 'fontello';
|
18 |
-
src: url('./fonts/icons/icons.svg') format('svg');
|
19 |
-
}
|
20 |
-
}
|
21 |
-
*/
|
22 |
-
|
23 |
-
[class^="apbct-icon-"]:before, [class*=" apbct-icon-"]:before {
|
24 |
-
font-family: "fontello";
|
25 |
-
font-style: normal;
|
26 |
-
font-weight: normal;
|
27 |
-
speak: none;
|
28 |
-
|
29 |
-
display: inline-block;
|
30 |
-
text-decoration: inherit;
|
31 |
-
width: 1em;
|
32 |
-
margin-right: .2em;
|
33 |
-
text-align: center;
|
34 |
-
/* opacity: .8; */
|
35 |
-
|
36 |
-
/* For safety - reset parent styles, that can break glyph codes*/
|
37 |
-
font-variant: normal;
|
38 |
-
text-transform: none;
|
39 |
-
|
40 |
-
/* fix buttons height, for twitter bootstrap */
|
41 |
-
line-height: 1em;
|
42 |
-
|
43 |
-
/* Animation center compensation - margins should be symmetric */
|
44 |
-
/* remove if not needed */
|
45 |
-
margin-left: .2em;
|
46 |
-
|
47 |
-
/* you can be more comfortable with increased icons size */
|
48 |
-
/* font-size: 120%; */
|
49 |
-
|
50 |
-
/* Font smoothing. That was taken from TWBS */
|
51 |
-
-webkit-font-smoothing: antialiased;
|
52 |
-
-moz-osx-font-smoothing: grayscale;
|
53 |
-
|
54 |
-
/* Uncomment for 3D effect */
|
55 |
-
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
56 |
-
}
|
57 |
-
|
58 |
-
.apbct-icon-download:before { content: '\e800'; } /* '' */
|
59 |
-
.apbct-icon-glass:before { content: '\e801'; } /* '' */
|
60 |
-
.apbct-icon-emo-happy:before { content: '\e802'; } /* '' */
|
61 |
-
.apbct-icon-search:before { content: '\e803'; } /* '' */
|
62 |
-
.apbct-icon-emo-unhappy:before { content: '\e804'; } /* '' */
|
63 |
-
.apbct-icon-mail:before { content: '\e805'; } /* '' */
|
64 |
-
.apbct-icon-info-circled:before { content: '\e806'; } /* '' */
|
65 |
-
.apbct-icon-help-circled:before { content: '\e807'; } /* '' */
|
66 |
-
.apbct-icon-heart:before { content: '\e808'; } /* '' */
|
67 |
-
.apbct-icon-heart-empty:before { content: '\e809'; } /* '' */
|
68 |
-
.apbct-icon-star:before { content: '\e80a'; } /* '' */
|
69 |
-
.apbct-icon-star-empty:before { content: '\e80b'; } /* '' */
|
70 |
-
.apbct-icon-user:before { content: '\e80c'; } /* '' */
|
71 |
-
.apbct-icon-users:before { content: '\e80d'; } /* '' */
|
72 |
-
.apbct-icon-th-large:before { content: '\e80e'; } /* '' */
|
73 |
-
.apbct-icon-th:before { content: '\e80f'; } /* '' */
|
74 |
-
.apbct-icon-th-list:before { content: '\e810'; } /* '' */
|
75 |
-
.apbct-icon-to-end:before { content: '\e811'; } /* '' */
|
76 |
-
.apbct-icon-to-start:before { content: '\e812'; } /* '' */
|
77 |
-
.apbct-icon-fast-fw:before { content: '\e813'; } /* '' */
|
78 |
-
.apbct-icon-fast-bw:before { content: '\e814'; } /* '' */
|
79 |
-
.apbct-icon-off:before { content: '\e815'; } /* '' */
|
80 |
-
.apbct-icon-chart-bar:before { content: '\e816'; } /* '' */
|
81 |
-
.apbct-icon-home:before { content: '\e817'; } /* '' */
|
82 |
-
.apbct-icon-link-1:before { content: '\e818'; } /* '' */
|
83 |
-
.apbct-icon-lock-open:before { content: '\e819'; } /* '' */
|
84 |
-
.apbct-icon-eye:before { content: '\e81a'; } /* '' */
|
85 |
-
.apbct-icon-eye-off:before { content: '\e81b'; } /* '' */
|
86 |
-
.apbct-icon-download-1:before { content: '\e81c'; } /* '' */
|
87 |
-
.apbct-icon-chat:before { content: '\e81d'; } /* '' */
|
88 |
-
.apbct-icon-comment:before { content: '\e81e'; } /* '' */
|
89 |
-
.apbct-icon-doc:before { content: '\e81f'; } /* '' */
|
90 |
-
.apbct-icon-lock:before { content: '\e820'; } /* '' */
|
91 |
-
.apbct-icon-emo-wink2:before { content: '\e821'; } /* '' */
|
92 |
-
.apbct-icon-plus:before { content: '\e822'; } /* '' */
|
93 |
-
.apbct-icon-upload:before { content: '\e823'; } /* '' */
|
94 |
-
.apbct-icon-picture:before { content: '\e824'; } /* '' */
|
95 |
-
.apbct-icon-ok:before { content: '\e825'; } /* '' */
|
96 |
-
.apbct-icon-cancel:before { content: '\e826'; } /* '' */
|
97 |
-
.apbct-icon-pencil:before { content: '\e827'; } /* '' */
|
98 |
-
.apbct-icon-edit:before { content: '\e828'; } /* '' */
|
99 |
-
.apbct-icon-forward:before { content: '\e829'; } /* '' */
|
100 |
-
.apbct-icon-export:before { content: '\e82a'; } /* '' */
|
101 |
-
.apbct-icon-trash-empty:before { content: '\e82b'; } /* '' */
|
102 |
-
.apbct-icon-down-dir:before { content: '\e82c'; } /* '' */
|
103 |
-
.apbct-icon-up-dir:before { content: '\e82d'; } /* '' */
|
104 |
-
.apbct-icon-left-dir:before { content: '\e82e'; } /* '' */
|
105 |
-
.apbct-icon-right-dir:before { content: '\e82f'; } /* '' */
|
106 |
-
.apbct-icon-spin1:before { content: '\e830'; } /* '' */
|
107 |
-
.apbct-icon-spin2:before { content: '\e831'; } /* '' */
|
108 |
-
.apbct-icon-mobile:before { content: '\e832'; } /* '' */
|
109 |
-
.apbct-icon-bell:before { content: '\e833'; } /* '' */
|
110 |
-
.apbct-icon-ccw:before { content: '\e834'; } /* '' */
|
111 |
-
.apbct-icon-wrench:before { content: '\e835'; } /* '' */
|
112 |
-
.apbct-icon-stop-1:before { content: '\e837'; } /* '' */
|
113 |
-
.apbct-icon-spin5:before { content: '\e838'; } /* '' */
|
114 |
-
.apbct-icon-pause-1:before { content: '\e839'; } /* '' */
|
115 |
-
.apbct-icon-play-1:before { content: '\e83a'; } /* '' */
|
116 |
-
.apbct-icon-link-ext:before { content: '\f08e'; } /* '' */
|
117 |
-
.apbct-icon-menu:before { content: '\f0c9'; } /* '' */
|
118 |
-
.apbct-icon-sort:before { content: '\f0dc'; } /* '' */
|
119 |
-
.apbct-icon-mail-alt:before { content: '\f0e0'; } /* '' */
|
120 |
-
.apbct-icon-lightbulb:before { content: '\f0eb'; } /* '' */
|
121 |
-
.apbct-icon-exchange:before { content: '\f0ec'; } /* '' */
|
122 |
-
.apbct-icon-upload-cloud:before { content: '\f0ee'; } /* '' */
|
123 |
-
.apbct-icon-bell-alt:before { content: '\f0f3'; } /* '' */
|
124 |
-
.apbct-icon-doc-text:before { content: '\f0f6'; } /* '' */
|
125 |
-
.apbct-icon-angle-double-left:before { content: '\f100'; } /* '' */
|
126 |
-
.apbct-icon-angle-double-right:before { content: '\f101'; } /* '' */
|
127 |
-
.apbct-icon-angle-double-up:before { content: '\f102'; } /* '' */
|
128 |
-
.apbct-icon-angle-double-down:before { content: '\f103'; } /* '' */
|
129 |
-
.apbct-icon-desktop:before { content: '\f108'; } /* '' */
|
130 |
-
.apbct-icon-laptop:before { content: '\f109'; } /* '' */
|
131 |
-
.apbct-icon-tablet:before { content: '\f10a'; } /* '' */
|
132 |
-
.apbct-icon-circle-empty:before { content: '\f10c'; } /* '' */
|
133 |
-
.apbct-icon-circle:before { content: '\f111'; } /* '' */
|
134 |
-
.apbct-icon-unlink:before { content: '\f127'; } /* '' */
|
135 |
-
.apbct-icon-help:before { content: '\f128'; } /* '' */
|
136 |
-
.apbct-icon-info:before { content: '\f129'; } /* '' */
|
137 |
-
.apbct-icon-attention-alt:before { content: '\f12a'; } /* '' */
|
138 |
-
.apbct-icon-ellipsis:before { content: '\f141'; } /* '' */
|
139 |
-
.apbct-icon-ellipsis-vert:before { content: '\f142'; } /* '' */
|
140 |
-
.apbct-icon-euro:before { content: '\f153'; } /* '' */
|
141 |
-
.apbct-icon-pound:before { content: '\f154'; } /* '' */
|
142 |
-
.apbct-icon-dollar:before { content: '\f155'; } /* '' */
|
143 |
-
.apbct-icon-rupee:before { content: '\f156'; } /* '' */
|
144 |
-
.apbct-icon-yen:before { content: '\f157'; } /* '' */
|
145 |
-
.apbct-icon-rouble:before { content: '\f158'; } /* '' */
|
146 |
-
.apbct-icon-won:before { content: '\f159'; } /* '' */
|
147 |
-
.apbct-icon-bitcoin:before { content: '\f15a'; } /* '' */
|
148 |
-
.apbct-icon-sort-alt-up:before { content: '\f160'; } /* '' */
|
149 |
-
.apbct-icon-sort-alt-down:before { content: '\f161'; } /* '' */
|
150 |
-
.apbct-icon-bug:before { content: '\f188'; } /* '' */
|
151 |
-
.apbct-icon-try:before { content: '\f195'; } /* '' */
|
152 |
-
.apbct-icon-wordpress:before { content: '\f19a'; } /* '' */
|
153 |
-
.apbct-icon-cubes:before { content: '\f1b3'; } /* '' */
|
154 |
-
.apbct-icon-database:before { content: '\f1c0'; } /* '' */
|
155 |
-
.apbct-icon-circle-thin:before { content: '\f1db'; } /* '' */
|
156 |
-
.apbct-icon-sliders:before { content: '\f1de'; } /* '' */
|
157 |
-
.apbct-icon-share:before { content: '\f1e0'; } /* '' */
|
158 |
-
.apbct-icon-plug:before { content: '\f1e6'; } /* '' */
|
159 |
-
.apbct-icon-trash:before { content: '\f1f8'; } /* '' */
|
160 |
-
.apbct-icon-chart-line:before { content: '\f201'; } /* '' */
|
161 |
-
.apbct-icon-shekel:before { content: '\f20b'; } /* '' */
|
162 |
-
.apbct-icon-user-secret:before { content: '\f21b'; } /* '' */
|
163 |
-
.apbct-icon-user-plus:before { content: '\f234'; } /* '' */
|
164 |
-
.apbct-icon-user-times:before { content: '\f235'; } /* '' */
|
165 |
-
.apbct-icon-viacoin:before { content: '\f237'; } /* '' */
|
166 |
-
.apbct-icon-safari:before { content: '\f267'; } /* '' */
|
167 |
-
.apbct-icon-chrome:before { content: '\f268'; } /* '' */
|
168 |
-
.apbct-icon-firefox:before { content: '\f269'; } /* '' */
|
169 |
-
.apbct-icon-opera:before { content: '\f26a'; } /* '' */
|
170 |
-
.apbct-icon-internet-explorer:before { content: '\f26b'; } /* '' */
|
171 |
-
.apbct-icon-television:before { content: '\f26c'; } /* '' */
|
172 |
-
.apbct-icon-percent:before { content: '\f295'; } /* '' */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/src/cleantalk-public-admin.css
DELETED
@@ -1,64 +0,0 @@
|
|
1 |
-
.ct_hidden{
|
2 |
-
display: none;
|
3 |
-
}
|
4 |
-
|
5 |
-
.ct_comment_info{
|
6 |
-
position: relative;
|
7 |
-
font-size: 11px;
|
8 |
-
line-height: 12px;
|
9 |
-
margin-bottom: 15px;
|
10 |
-
}
|
11 |
-
.ct_comment_info img, .ct_comment_info a{
|
12 |
-
display: inline-block;
|
13 |
-
}
|
14 |
-
|
15 |
-
.ct_comment_titles
|
16 |
-
{
|
17 |
-
border-bottom: 1px solid gray !important;
|
18 |
-
background: inherit;
|
19 |
-
margin-bottom: 15px;
|
20 |
-
}
|
21 |
-
p.ct_comment_info_title{
|
22 |
-
display: inline-block;
|
23 |
-
}
|
24 |
-
p.ct_comment_logo_title{
|
25 |
-
float:right;
|
26 |
-
display: inline-block;
|
27 |
-
}
|
28 |
-
.ct_comment_logo_img{
|
29 |
-
height: 12px;
|
30 |
-
vertical-align: text-top;
|
31 |
-
box-shadow: transparent 0 0 0 !important;
|
32 |
-
}
|
33 |
-
|
34 |
-
.ct_this_is{
|
35 |
-
padding: 2px 3px;
|
36 |
-
cursor: pointer;
|
37 |
-
white-space: nowrap;
|
38 |
-
color: black !important;
|
39 |
-
background: rgba(230,230,230,1);
|
40 |
-
border: 1px solid #777;
|
41 |
-
border-radius: 4px;
|
42 |
-
}
|
43 |
-
.ct_this_is_spam{
|
44 |
-
|
45 |
-
}
|
46 |
-
p.ct_feedback_wrap{
|
47 |
-
display: none;
|
48 |
-
position: absolute;
|
49 |
-
top: 37px; left: 0;
|
50 |
-
width: 100%; height: 27px;
|
51 |
-
margin: 0;
|
52 |
-
padding: 6px 6px;
|
53 |
-
border-radius: 3px;
|
54 |
-
background: white;
|
55 |
-
}
|
56 |
-
.ct_feedback_result{display: none; text-decoration: underline;}
|
57 |
-
.ct_feedback_result_spam{color: red;}
|
58 |
-
.ct_feedback_result_not_spam{color: green;}
|
59 |
-
|
60 |
-
.ct_feedback_msg a{color: green !important; text-decoration: underline;}
|
61 |
-
|
62 |
-
.ct_feedback_success{color: green;}
|
63 |
-
.ct_feedback_error{color: red;}
|
64 |
-
.ct_feedback_no_hash{color: blue;}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/src/cleantalk-public.css
DELETED
@@ -1,67 +0,0 @@
|
|
1 |
-
/*.apbct-email-encoder{*/
|
2 |
-
/* position: relative;*/
|
3 |
-
/*}*/
|
4 |
-
/*.apbct-tooltip{*/
|
5 |
-
/* position: relative;*/
|
6 |
-
/*}*/
|
7 |
-
/* .apbct-tooltip--text{*/
|
8 |
-
/* position: absolute;*/
|
9 |
-
/* background: lightgray;*/
|
10 |
-
/* border-radius: 10px;*/
|
11 |
-
/* padding: 5px;*/
|
12 |
-
/* color: white;*/
|
13 |
-
/* top: 4px;*/
|
14 |
-
/* }*/
|
15 |
-
/* .apbct-tooltip--arrow{*/
|
16 |
-
/* position: absolute;*/
|
17 |
-
/* top: 0px;*/
|
18 |
-
/* left: 15px;*/
|
19 |
-
/* width: 10px;*/
|
20 |
-
/* height: 10px;*/
|
21 |
-
/* background: #5a5a5a;*/
|
22 |
-
/* transform: rotate(135deg);*/
|
23 |
-
/* }*/
|
24 |
-
|
25 |
-
#honeypot-field-url {
|
26 |
-
display: none !important;
|
27 |
-
}
|
28 |
-
.comment-form-cookies-consent {
|
29 |
-
width:100%;
|
30 |
-
overflow: hidden;
|
31 |
-
}
|
32 |
-
.wc_apbct_email_id {
|
33 |
-
display: none !important;
|
34 |
-
}
|
35 |
-
.um-form input[type=text].apbct_special_field,
|
36 |
-
input[class*='apbct'].apbct_special_field{
|
37 |
-
display: none !important;
|
38 |
-
}
|
39 |
-
|
40 |
-
.apbct-email-encoder{
|
41 |
-
position: relative;
|
42 |
-
}
|
43 |
-
.apbct-tooltip{
|
44 |
-
display: none;
|
45 |
-
position: absolute;
|
46 |
-
top: 35px;
|
47 |
-
left: 15px;
|
48 |
-
background: lightgray;
|
49 |
-
border-radius: 5px;
|
50 |
-
opacity: .9;
|
51 |
-
}
|
52 |
-
.apbct-tooltip--text{
|
53 |
-
position: absolute;
|
54 |
-
background: lightgray;
|
55 |
-
padding: 10px;
|
56 |
-
border-radius: 5px;
|
57 |
-
width: max-content;
|
58 |
-
}
|
59 |
-
.apbct-tooltip--arrow{
|
60 |
-
position: absolute;
|
61 |
-
background: lightgray;
|
62 |
-
width: 10px;
|
63 |
-
height: 10px;
|
64 |
-
top: -5px;
|
65 |
-
left: 10px;
|
66 |
-
transform: rotate(135deg);
|
67 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/src/cleantalk-spam-check.css
DELETED
@@ -1,94 +0,0 @@
|
|
1 |
-
#ct_checking_status, #ct_cooling_notice, #ct_error_message h3, #ct_checking_count, #ct_error_message h4{
|
2 |
-
text-align: center;
|
3 |
-
width:90%;
|
4 |
-
}
|
5 |
-
|
6 |
-
#ct_preloader{
|
7 |
-
display:none;
|
8 |
-
width:100%;
|
9 |
-
text-align:center;
|
10 |
-
}
|
11 |
-
#ct_preloader img {
|
12 |
-
border: none !important;
|
13 |
-
}
|
14 |
-
#ct_working_message{
|
15 |
-
display:none;
|
16 |
-
margin: 1em auto auto auto;
|
17 |
-
padding:3px;
|
18 |
-
width:70%;
|
19 |
-
border:2px dotted gray;
|
20 |
-
background:#ffff99;
|
21 |
-
}
|
22 |
-
|
23 |
-
#ct_pause{
|
24 |
-
display:none;
|
25 |
-
}
|
26 |
-
|
27 |
-
div.ct_check_params_wrapper{}
|
28 |
-
.ct_check_params_elem{}
|
29 |
-
.ct_check_params_elem_sub{
|
30 |
-
margin: 15px 0 0 25px;
|
31 |
-
width: 150px;
|
32 |
-
display: inline-block;
|
33 |
-
}
|
34 |
-
.ct_check_params_elem_sub_sub{ margin: 15px 0 0 50px; }
|
35 |
-
button#ct_check_spam_button{
|
36 |
-
background: #2ea2cc;
|
37 |
-
border-color: #0074a2;
|
38 |
-
color: #fff;
|
39 |
-
-webkit-box-shadow: inset 0 1px 0 rgba(120,200,230,.5), 0 1px 0 rgba(0,0,0,.15);
|
40 |
-
box-shadow: inset 0 1px 0 rgba(120,200,230,.5), 0 1px 0 rgba(0,0,0,.15);
|
41 |
-
}
|
42 |
-
button#ct_check_spam_button:hover{ color: black; }
|
43 |
-
.ct_date{
|
44 |
-
display: inline;
|
45 |
-
width: 150px;
|
46 |
-
}
|
47 |
-
.ct_check_params_desc{
|
48 |
-
display: inline-block;
|
49 |
-
margin: 5px 10px 10px 15px;
|
50 |
-
}
|
51 |
-
#ct_check_tabs {
|
52 |
-
border: 1px solid #c5c5c5;
|
53 |
-
border-radius: 3px;
|
54 |
-
padding: .2em;
|
55 |
-
background: #ffffff;
|
56 |
-
}
|
57 |
-
#ct_check_tabs ul {
|
58 |
-
margin: 0;
|
59 |
-
padding: .2em .2em 0;
|
60 |
-
border: 1px solid #c5c5c5;
|
61 |
-
border-radius: 3px;
|
62 |
-
background: #e9e9e9;
|
63 |
-
color: #333333;
|
64 |
-
font-weight: bold;
|
65 |
-
display: flex;
|
66 |
-
}
|
67 |
-
#ct_check_tabs ul li {
|
68 |
-
list-style: none;
|
69 |
-
position: relative;
|
70 |
-
margin: 1px .2em -1px 0;
|
71 |
-
padding: 0;
|
72 |
-
white-space: nowrap;
|
73 |
-
border: 1px solid #c5c5c5;
|
74 |
-
border-radius: 3px 3px 0 0;
|
75 |
-
background: #fff;
|
76 |
-
font-weight: normal;
|
77 |
-
}
|
78 |
-
#ct_check_tabs ul li.active {
|
79 |
-
border-bottom: 1px solid transparent;
|
80 |
-
}
|
81 |
-
#ct_check_tabs ul li a {
|
82 |
-
display: block;
|
83 |
-
padding: .5em 1em;
|
84 |
-
text-decoration: none;
|
85 |
-
}
|
86 |
-
#ct_check_tabs ul li.active a {
|
87 |
-
font-weight: bold;
|
88 |
-
}
|
89 |
-
#ct_check_content {
|
90 |
-
display: block;
|
91 |
-
border-width: 0;
|
92 |
-
padding: 1em 1.4em;
|
93 |
-
background: none;
|
94 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/cleantalk-admin.php
CHANGED
@@ -68,6 +68,8 @@ function apbct_add_buttons_to_comments_and_users($_unused_argument)
|
|
68 |
/**
|
69 |
* Adding widget
|
70 |
* Hooked by 'wp_dashboard_setup'
|
|
|
|
|
71 |
*/
|
72 |
function ct_dashboard_statistics_widget()
|
73 |
{
|
@@ -500,6 +502,8 @@ function apbct_admin__enqueue_scripts($hook)
|
|
500 |
|
501 |
// SETTINGS's page JavaScript and CSS
|
502 |
if ( $hook == 'settings_page_cleantalk' ) {
|
|
|
|
|
503 |
wp_enqueue_script(
|
504 |
'cleantalk_admin_js_settings_page',
|
505 |
APBCT_JS_ASSETS_PATH . '/cleantalk-admin-settings-page.min.js',
|
68 |
/**
|
69 |
* Adding widget
|
70 |
* Hooked by 'wp_dashboard_setup'
|
71 |
+
*
|
72 |
+
* @psalm-suppress UndefinedFunction
|
73 |
*/
|
74 |
function ct_dashboard_statistics_widget()
|
75 |
{
|
502 |
|
503 |
// SETTINGS's page JavaScript and CSS
|
504 |
if ( $hook == 'settings_page_cleantalk' ) {
|
505 |
+
wp_enqueue_media();
|
506 |
+
|
507 |
wp_enqueue_script(
|
508 |
'cleantalk_admin_js_settings_page',
|
509 |
APBCT_JS_ASSETS_PATH . '/cleantalk-admin-settings-page.min.js',
|
inc/cleantalk-ajax.php
CHANGED
@@ -428,7 +428,8 @@ function ct_ajax_hook($message_obj = null)
|
|
428 |
) ||
|
429 |
(Post::get('action') === 'arm_shortcode_form_ajax_action' && Post::get('arm_action') === 'please-login') || //arm forms skip login
|
430 |
(Post::get('action') === 'erf_login_user' && in_array('easy-registration-forms/erforms.php', apply_filters('active_plugins', get_option('active_plugins')))) || //Easy Registration Forms login form skip
|
431 |
-
(Post::get('action') === 'mailpoet' && Post::get('endpoint') === 'ImportExport' && Post::get('method') === 'processImport') //Mailpoet import
|
|
|
432 |
) {
|
433 |
do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
|
434 |
|
428 |
) ||
|
429 |
(Post::get('action') === 'arm_shortcode_form_ajax_action' && Post::get('arm_action') === 'please-login') || //arm forms skip login
|
430 |
(Post::get('action') === 'erf_login_user' && in_array('easy-registration-forms/erforms.php', apply_filters('active_plugins', get_option('active_plugins')))) || //Easy Registration Forms login form skip
|
431 |
+
(Post::get('action') === 'mailpoet' && Post::get('endpoint') === 'ImportExport' && Post::get('method') === 'processImport') || //Mailpoet import
|
432 |
+
(Post::get('action') === 'latepoint_route_call' && Post::get('route_name') === 'steps__reload_booking_summary') //LatePoint service calls
|
433 |
) {
|
434 |
do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__, $_POST);
|
435 |
|
inc/cleantalk-public-validate-skip-functions.php
CHANGED
@@ -69,103 +69,185 @@ function skip_for_ct_contact_form_validate_postdata()
|
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
-
* Function for skip in ct_contact_form_validate()
|
73 |
-
* @return
|
74 |
*/
|
75 |
function skip_for_ct_contact_form_validate()
|
76 |
{
|
77 |
global $apbct, $pagenow, $ct_checkjs_frm;
|
78 |
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
}
|
170 |
|
171 |
return false;
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
+
* Function for skip in ct_contact_form_validate(). Returns false if no exclusions found, or the key of the exclusion.
|
73 |
+
* @return false|string
|
74 |
*/
|
75 |
function skip_for_ct_contact_form_validate()
|
76 |
{
|
77 |
global $apbct, $pagenow, $ct_checkjs_frm;
|
78 |
|
79 |
+
$exclusions = array(
|
80 |
+
'1' => @sizeof($_POST) === 0,
|
81 |
+
'2' => (isset($_POST['signup_username'], $_POST['signup_email'], $_POST['signup_password'])),
|
82 |
+
'3' => (isset($pagenow) && $pagenow === 'wp-login.php'),
|
83 |
+
// WordPress log in form
|
84 |
+
'4' =>
|
85 |
+
(isset($pagenow, $_GET['action']) && $pagenow === 'wp-login.php' && $_GET['action'] === 'lostpassword'),
|
86 |
+
'5' => apbct_is_in_referer('lostpassword'),
|
87 |
+
'6' => apbct_is_in_referer('lost-password'),
|
88 |
+
//Skip lost-password form check
|
89 |
+
'7' =>
|
90 |
+
(apbct_is_in_uri('/wp-admin/')
|
91 |
+
&& (empty($_POST['your-phone'])
|
92 |
+
&& empty($_POST['your-email'])
|
93 |
+
&& empty($_POST['your-message']))),
|
94 |
+
//Bitrix24 Contact
|
95 |
+
'8' => apbct_is_in_uri('wp-login.php'),
|
96 |
+
'9' => apbct_is_in_uri('wp-comments-post.php'),
|
97 |
+
'10' => apbct_is_in_uri('?provider=facebook&'),
|
98 |
+
'11' => apbct_is_in_uri('reset-password/'),
|
99 |
+
// Ticket #13668. Password reset.
|
100 |
+
'12' => apbct_is_in_referer('/wp-admin/'),
|
101 |
+
'13' => apbct_is_in_uri('/login/'),
|
102 |
+
'14' => apbct_is_in_uri('/my-account/edit-account/'),
|
103 |
+
// WooCommerce edit account page
|
104 |
+
'15' => apbct_is_in_uri('/my-account/edit-address/'),
|
105 |
+
// WooCommerce edit account page
|
106 |
+
'16' => (isset($_POST['action']) && $_POST['action'] === 'save_account_details'),
|
107 |
+
// WooCommerce edit account action
|
108 |
+
'17' => apbct_is_in_uri('/peepsoajax/profilefieldsajax.validate_register'),
|
109 |
+
'18' => (isset($_GET['ptype']) && $_GET['ptype'] === 'login'),
|
110 |
+
'19' => isset($_POST['ct_checkjs_register_form']),
|
111 |
+
'20' =>
|
112 |
+
(isset($_POST['signup_username'], $_POST['signup_password_confirm'], $_POST['signup_submit'])),
|
113 |
+
'21' =>
|
114 |
+
($apbct->settings['forms__general_contact_forms_test'] == 0 && $apbct->settings['forms__check_external'] == 0 && $apbct->settings['forms__check_internal'] == 0),
|
115 |
+
'22' => isset($_POST['bbp_topic_content']),
|
116 |
+
'23' => isset($_POST['bbp_reply_content']),
|
117 |
+
'24' => isset($_POST['fscf_submitted']),
|
118 |
+
'25' => apbct_is_in_uri('/wc-api'),
|
119 |
+
'26' => (isset($_POST['log'], $_POST['pwd'], $_POST['wp-submit'])),
|
120 |
+
'27' => (isset($_POST[$ct_checkjs_frm]) && $apbct->settings['forms__contact_forms_test'] == 1),
|
121 |
+
// Formidable forms
|
122 |
+
'28' => (isset($_POST['comment_post_ID']) && ! isset($_POST['comment-submit'])),
|
123 |
+
// The comment form && ! DW Question & Answer
|
124 |
+
'29' => isset($_GET['for']),
|
125 |
+
'30' => (isset($_POST['log'], $_POST['pwd'])),
|
126 |
+
//WooCommerce Sensei login form fix
|
127 |
+
'31' => (isset($_POST['wc_reset_password'], $_POST['_wpnonce'], $_POST['_wp_http_referer'])),
|
128 |
+
// WooCommerce recovery password form
|
129 |
+
'32' =>
|
130 |
+
((isset($_POST['woocommerce-login-nonce']) || isset($_POST['_wpnonce'])) && isset($_POST['login'], $_POST['password'], $_POST['_wp_http_referer'])),
|
131 |
+
// WooCommerce login form
|
132 |
+
'33' => (isset($_POST['wc-api']) && strtolower($_POST['wc-api']) === 'wc_gateway_systempay'),
|
133 |
+
// Woo Systempay payment plugin
|
134 |
+
'34' => apbct_is_in_uri('wc-api=WC_Gateway_Realex_Redirect'),
|
135 |
+
// Woo Realex payment Gateway plugin
|
136 |
+
'35' => apbct_is_in_uri('wc-api=WC_Gateway_Tpay_Basic'),
|
137 |
+
// Tpay payment Gateway plugin
|
138 |
+
'36' => (isset($_POST['_wpcf7'], $_POST['_wpcf7_version'], $_POST['_wpcf7_locale'])),
|
139 |
+
//CF7 fix)
|
140 |
+
'37' => (isset($_POST['hash'], $_POST['device_unique_id'], $_POST['device_name'])),
|
141 |
+
//Mobile Assistant Connector fix
|
142 |
+
'38' => isset($_POST['gform_submit']),
|
143 |
+
//Gravity form
|
144 |
+
'39' => apbct_is_in_uri('wc-ajax=get_refreshed_fragments'),
|
145 |
+
'40' => (isset($_POST['ccf_form']) && intval($_POST['ccf_form']) == 1),
|
146 |
+
'41' => (isset($_POST['contact_tags']) && strpos($_POST['contact_tags'], 'MBR:') !== false),
|
147 |
+
'42' => (apbct_is_in_uri('bizuno.php') && ! empty($_POST['bizPass'])),
|
148 |
+
'43' => apbct_is_in_referer('my-dashboard/'),
|
149 |
+
// ticket_id=7885
|
150 |
+
'44' => isset($_POST['slm_action'], $_POST['license_key'], $_POST['secret_key'], $_POST['registered_domain']),
|
151 |
+
// ticket_id=9122
|
152 |
+
'45' => (isset($_POST['wpforms']['submit']) && $_POST['wpforms']['submit'] === 'wpforms-submit'),
|
153 |
+
// WPForms
|
154 |
+
'46' => (isset($_POST['action']) && $_POST['action'] === 'grunion-contact-form'),
|
155 |
+
// JetPack
|
156 |
+
'47' => (isset($_POST['action']) && $_POST['action'] === 'bbp-update-user'),
|
157 |
+
//BBP update user info page
|
158 |
+
'48' => apbct_is_in_referer('?wc-api=WC_Gateway_Transferuj'),
|
159 |
+
//WC Gateway
|
160 |
+
'49' => (isset($_GET['mbr'], $_GET['amp;appname'], $_GET['amp;master'])),
|
161 |
+
// ticket_id=10773
|
162 |
+
'50' =>
|
163 |
+
(isset($_POST['call_function']) && $_POST['call_function'] === 'push_notification_settings'),
|
164 |
+
// Skip mobile requests (push settings)
|
165 |
+
'51' => apbct_is_in_uri('membership-login'),
|
166 |
+
// Skip login form
|
167 |
+
'52' => (isset($_GET['cookie-state-change'])),
|
168 |
+
//skip GDPR plugin
|
169 |
+
'53' => (Server::get('HTTP_USER_AGENT') === 'MailChimp'
|
170 |
+
&& apbct_is_in_uri('mc4wp-sync-api/webhook-listener')),
|
171 |
+
// Mailchimp webhook skip
|
172 |
+
'54' => apbct_is_in_uri('researcher-log-in'),
|
173 |
+
// Skip login form
|
174 |
+
'55' => apbct_is_in_uri('admin_aspcms/_system/AspCms_SiteSetting.asp?action=saves'),
|
175 |
+
// Skip admin save callback
|
176 |
+
'56' => apbct_is_in_uri('?profile_tab=postjobs'),
|
177 |
+
// Skip post vacancies
|
178 |
+
'57' => (isset($_POST['btn_insert_post_type_hotel']) && $_POST['btn_insert_post_type_hotel'] === 'SUBMIT HOTEL'),
|
179 |
+
// Skip adding hotel
|
180 |
+
'58' => (isset($_POST['action']) && $_POST['action'] === 'updraft_savesettings'),
|
181 |
+
// Updraft save settings
|
182 |
+
'59' => isset($_POST['quform_submit']),
|
183 |
+
//QForms multi-paged form skip
|
184 |
+
'60' => (isset($_POST['wpum_form']) && $_POST['wpum_form'] === 'login'),
|
185 |
+
//WPUM login skip
|
186 |
+
'61' => (isset($_POST['password']) && ! apbct_custom_forms_trappings()),
|
187 |
+
// Exception for login form. From Analysis uid=406596
|
188 |
+
'62' => (isset($_POST['action']) && $_POST['action'] === 'wilcity_reset_password'),
|
189 |
+
// Exception for reset password form. From Analysis uid=430898
|
190 |
+
'63' => (isset($_POST['action']) && $_POST['action'] === 'wilcity_login'),
|
191 |
+
// Exception for login form. From Analysis uid=430898
|
192 |
+
'64' => apbct_is_in_uri('tin-canny-learndash-reporting/src/h5p-xapi/process-xapi-statement.php?v=asd'),
|
193 |
+
//Skip Tin Canny plugin
|
194 |
+
'65' => (isset($_POST['na'], $_POST['ts'], $_POST['nhr']) && ! apbct_is_in_uri('?na=s')),
|
195 |
+
// The Newsletter Plugin double requests fix. Ticket #14772
|
196 |
+
'66' => (isset($_POST['spl_action']) && $_POST['spl_action'] === 'register'),
|
197 |
+
//Skip interal action with empty params
|
198 |
+
'67' => (isset($_POST['action'])
|
199 |
+
&& $_POST['action'] === 'bwfan_insert_abandoned_cart'
|
200 |
+
&& apbct_is_in_uri('my-account/edit-address')),
|
201 |
+
//Skip edit account
|
202 |
+
'68' => apbct_is_in_uri('login-1'),
|
203 |
+
//Skip login form
|
204 |
+
'69' => apbct_is_in_uri('recuperacao-de-senha-2'),
|
205 |
+
//Skip form reset password
|
206 |
+
'70' => (apbct_is_in_uri('membermouse/api/request.php')
|
207 |
+
&& isset($_POST['membership_level_id'], $_POST['apikey'], $_POST['apisecret'])),
|
208 |
+
// Membermouse API
|
209 |
+
'71' => (isset($_POST['AppKey'], $_POST['cbAP']) && $_POST['cbAP'] === 'Caspio'),
|
210 |
+
// Caspio exclusion (ticket #16444)
|
211 |
+
'72' => isset($_POST['wpforms_id'], $_POST['wpforms_author']),
|
212 |
+
//Skip wpforms
|
213 |
+
'73' => (isset($_POST['somfrp_action'], $_POST['submitted']) && $_POST['somfrp_action'] === 'somfrp_lost_pass'),
|
214 |
+
// Frontend Reset Password exclusion
|
215 |
+
'74' => (isset($_POST['action']) && $_POST['action'] === 'dokan_save_account_details'),
|
216 |
+
'75' => Post::get('action') === 'frm_get_lookup_text_value',
|
217 |
+
// Exception for Formidable multilevel form
|
218 |
+
'76' => (isset($_POST['ihcaction']) && $_POST['ihcaction'] === 'reset_pass'),
|
219 |
+
//Reset pass exclusion
|
220 |
+
'77' => (isset($_POST['action'], $_POST['register_unspecified_nonce_field'])
|
221 |
+
&& $_POST['action'] === 'register'),
|
222 |
+
// Profile Builder have a direct integration
|
223 |
+
'78' => (isset($_POST['_wpmem_register_nonce'])
|
224 |
+
&& wp_verify_nonce($_POST['_wpmem_register_nonce'], 'wpmem_longform_nonce')),
|
225 |
+
// WP Members have a direct integration
|
226 |
+
'79' => (apbct_is_in_uri('/settings/') && isset($_POST['submit'])),
|
227 |
+
// Buddypress integration
|
228 |
+
'80' => (apbct_is_in_uri('/settings/notifications/') && isset($_POST['submit'])),
|
229 |
+
// Buddypress integration
|
230 |
+
'81' => (apbct_is_in_uri('/settings/profile/') && isset($_POST['submit'])),
|
231 |
+
// Buddypress integration
|
232 |
+
'82' => (apbct_is_in_uri('/settings/data/') && isset($_POST['submit'])),
|
233 |
+
// Buddypress integration
|
234 |
+
'83' => (apbct_is_in_uri('/settings/delete-account/') && isset($_POST['submit'])),
|
235 |
+
// Buddypress integration
|
236 |
+
'84' => (apbct_is_in_uri('/profile/') && isset($_POST['submit'])),
|
237 |
+
// Buddypress integration
|
238 |
+
'85' => (isset($_POST['action']) && $_POST['action'] === 'bwfan_insert_abandoned_cart'),
|
239 |
+
// Autonami Marketing Automations - WC Plugin - integration
|
240 |
+
'86' => (isset($_POST['action']) && $_POST['action'] === 'check_email_exists'),
|
241 |
+
// Handling an unknown action check_email_exists
|
242 |
+
'87' => Server::inUri('cleantalk-antispam/v1/alt_sessions'),
|
243 |
+
// has direct integration lib/Cleantalk/Antispam/Integrations/MemberPress.php
|
244 |
+
'88' => apbct_is_plugin_active('memberpress/memberpress.php') && Post::get('mepr_process_signup_form'),
|
245 |
+
);
|
246 |
+
|
247 |
+
foreach ( $exclusions as $exclusion_key => $state ) {
|
248 |
+
if ( $state === true ) {
|
249 |
+
return $exclusion_key;
|
250 |
+
}
|
251 |
}
|
252 |
|
253 |
return false;
|
inc/cleantalk-public-validate.php
CHANGED
@@ -24,9 +24,9 @@ function ct_contact_form_validate()
|
|
24 |
return null;
|
25 |
}
|
26 |
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
return null;
|
31 |
}
|
32 |
|
24 |
return null;
|
25 |
}
|
26 |
|
27 |
+
$do_skip = skip_for_ct_contact_form_validate();
|
28 |
+
if ( $do_skip ) {
|
29 |
+
do_action('apbct_skipped_request', __FILE__ . ' -> ' . __FUNCTION__ . '():' . __LINE__ . ', ON KEY ' . $do_skip, $_POST);
|
30 |
return null;
|
31 |
}
|
32 |
|
inc/cleantalk-public.php
CHANGED
@@ -107,11 +107,6 @@ function apbct_init()
|
|
107 |
ct_ajax_hook();
|
108 |
}
|
109 |
|
110 |
-
// MemberPress integration
|
111 |
-
if ( $apbct->settings['forms__contact_forms_test'] == 1 && Post::get('mepr_process_signup_form') ) {
|
112 |
-
add_action('mepr-signup', 'ct_contact_form_validate');
|
113 |
-
}
|
114 |
-
|
115 |
/**hooks for cm answers pro */
|
116 |
if ( defined('CMA_PLUGIN_FILE') ) {
|
117 |
add_action('wp', 'ct_ajax_hook', 1);
|
@@ -700,7 +695,7 @@ function ct_add_honeypot_field($form_type, $form_method = 'post')
|
|
700 |
|
701 |
//add a submit button if method is get to prevent keyboard send misfunction
|
702 |
if ( $form_method === 'get' ) {
|
703 |
-
$honeypot
|
704 |
id="apbct_submit_id__' . $form_type . '_' . $random . '"
|
705 |
class="apbct_special_field apbct__email_id__' . $form_type . '"
|
706 |
name="apbct_submit_id__' . $form_type . '_' . $random . '"
|
107 |
ct_ajax_hook();
|
108 |
}
|
109 |
|
|
|
|
|
|
|
|
|
|
|
110 |
/**hooks for cm answers pro */
|
111 |
if ( defined('CMA_PLUGIN_FILE') ) {
|
112 |
add_action('wp', 'ct_ajax_hook', 1);
|
695 |
|
696 |
//add a submit button if method is get to prevent keyboard send misfunction
|
697 |
if ( $form_method === 'get' ) {
|
698 |
+
$honeypot = '<input
|
699 |
id="apbct_submit_id__' . $form_type . '_' . $random . '"
|
700 |
class="apbct_special_field apbct__email_id__' . $form_type . '"
|
701 |
name="apbct_submit_id__' . $form_type . '_' . $random . '"
|
inc/cleantalk-settings.php
CHANGED
@@ -669,6 +669,11 @@ function apbct_settings__set_fields()
|
|
669 |
'cleantalk-spam-protect'
|
670 |
),
|
671 |
),
|
|
|
|
|
|
|
|
|
|
|
672 |
'sfw__anti_crawler' => array(
|
673 |
'type' => 'checkbox',
|
674 |
'title' => 'Anti-Crawler' . $additional_ac_title, // Do not to localize this phrase
|
@@ -1389,7 +1394,7 @@ function apbct_settings__prepare_errors($errors)
|
|
1389 |
if ( is_array($error) ) {
|
1390 |
foreach ( $error as $key => $error_info ) {
|
1391 |
if ( is_string($key) ) {
|
1392 |
-
$prepared_errors[$type][$key] = end($error_info);
|
1393 |
} else {
|
1394 |
$prepared_errors[$type] = $error_info;
|
1395 |
}
|
@@ -2961,3 +2966,38 @@ function apbct__send_local_settings_to_api($settings)
|
|
2961 |
|
2962 |
\Cleantalk\ApbctWP\API::methodSendLocalSettings($api_key, $hostname, $settings);
|
2963 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
669 |
'cleantalk-spam-protect'
|
670 |
),
|
671 |
),
|
672 |
+
'sfw__custom_logo' => array(
|
673 |
+
'callback' => 'apbct_settings__custom_logo',
|
674 |
+
'title' => __('Custom logo on SpamFireWall blocking pages', 'cleantalk-spam-protect'),
|
675 |
+
'parent' => 'sfw__enabled',
|
676 |
+
),
|
677 |
'sfw__anti_crawler' => array(
|
678 |
'type' => 'checkbox',
|
679 |
'title' => 'Anti-Crawler' . $additional_ac_title, // Do not to localize this phrase
|
1394 |
if ( is_array($error) ) {
|
1395 |
foreach ( $error as $key => $error_info ) {
|
1396 |
if ( is_string($key) ) {
|
1397 |
+
$prepared_errors[$type][$key] = is_array($error_info) ? end($error_info) : $error_info;
|
1398 |
} else {
|
1399 |
$prepared_errors[$type] = $error_info;
|
1400 |
}
|
2966 |
|
2967 |
\Cleantalk\ApbctWP\API::methodSendLocalSettings($api_key, $hostname, $settings);
|
2968 |
}
|
2969 |
+
|
2970 |
+
/**
|
2971 |
+
* Custom logo for die pages setting
|
2972 |
+
*/
|
2973 |
+
function apbct_settings__custom_logo()
|
2974 |
+
{
|
2975 |
+
global $apbct;
|
2976 |
+
|
2977 |
+
$value = isset($apbct->settings['cleantalk_custom_logo']) ? $apbct->settings['cleantalk_custom_logo'] : false;
|
2978 |
+
$default = APBCT_IMG_ASSETS_PATH . '/placeholder.png';
|
2979 |
+
|
2980 |
+
if ($value && ($image_attributes = wp_get_attachment_image_src($value, array(150, 110)))) {
|
2981 |
+
$src = $image_attributes[0];
|
2982 |
+
} else {
|
2983 |
+
$src = $default;
|
2984 |
+
}
|
2985 |
+
?>
|
2986 |
+
<div class="apbct_settings-field_wrapper apbct_settings-field_wrapper">
|
2987 |
+
<h4 class="apbct_settings-field_title apbct_settings-field_title--radio">
|
2988 |
+
<?php echo esc_html__('Custom logo on SpamFireWall blocking pages', 'cleantalk-spam-protect'); ?>
|
2989 |
+
</h4>
|
2990 |
+
<div class="apbct_settings-field_content apbct_settings-field_content--radio">
|
2991 |
+
<img data-src="<?php echo esc_url($default); ?>" src="<?php echo esc_url($src); ?>" width="150" alt="" />
|
2992 |
+
<div>
|
2993 |
+
<input type="hidden" name="cleantalk_settings[cleantalk_custom_logo]" id="cleantalk_custom_logo" value="<?php echo esc_url($value); ?>" />
|
2994 |
+
<button type="button" id="apbct-custom-logo-open-gallery" class="button">
|
2995 |
+
<?php echo esc_html__('Image', 'cleantalk-spam-protect'); ?>
|
2996 |
+
</button>
|
2997 |
+
<button type="button" id="apbct-custom-logo-remove-image" class="button">×</button>
|
2998 |
+
</div>
|
2999 |
+
|
3000 |
+
</div>
|
3001 |
+
</div>
|
3002 |
+
<?php
|
3003 |
+
}
|
inc/images/placeholder.png
ADDED
Binary file
|
js/apbct-disable-comments.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"apbct-disable-comments.min.js","sources":["apbct-disable-comments.js"],"sourcesContent":["\"use strict\";\nwp.domReady(function () {\n\tif (wp.blocks) {\n\t\twp.blocks.getBlockTypes().forEach(function (block) {\n\t\t\tif (apbctDisableComments.disabled_blocks.includes(block.name)) {\n\t\t\t\twp.blocks.unregisterBlockType(block.name);\n\t\t\t}\n\t\t});\n\t}\n});\n"],"names":["wp","domReady","blocks","getBlockTypes","forEach","block","apbctDisableComments","disabled_blocks","includes","name","unregisterBlockType"],"mappings":"aACAA,GAAGC,SAAS,WACPD,GAAGE,QACNF,GAAGE,OAAOC,
|
1 |
+
{"version":3,"file":"apbct-disable-comments.min.js","sources":["apbct-disable-comments.js"],"sourcesContent":["\"use strict\";\nwp.domReady(function () {\n\tif (wp.blocks) {\n\t\twp.blocks.getBlockTypes().forEach(function (block) {\n\t\t\tif (apbctDisableComments.disabled_blocks.includes(block.name)) {\n\t\t\t\twp.blocks.unregisterBlockType(block.name);\n\t\t\t}\n\t\t});\n\t}\n});\n"],"names":["wp","domReady","blocks","getBlockTypes","forEach","block","apbctDisableComments","disabled_blocks","includes","name","unregisterBlockType"],"mappings":"AAAA,aACAA,GAAGC,SAAS,WACPD,GAAGE,QACNF,GAAGE,OAAOC,cAAc,EAAEC,QAAQ,SAAUC,GACvCC,qBAAqBC,gBAAgBC,SAASH,EAAMI,IAAI,GAC3DT,GAAGE,OAAOQ,oBAAoBL,EAAMI,IAAI,CAE1C,CAAC,CAEH,CAAC"}
|
js/apbct-public--3--cleantalk-modal.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,n,a){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e="";for(key in this.styles)e+=key+":"+this.styles[key]+";";return e}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},n={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},a={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},o={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},l={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},d={styles:{overflow:"hidden"},toString:e},i=document.createElement("style"),d=(i.setAttribute("id","cleantalk-modal-styles"),i.innerHTML="body.cleantalk-modal-opened{"+d+"}",i.innerHTML+="#cleantalk-modal-overlay{"+t+"}",i.innerHTML+="#cleantalk-modal-close{"+a+"}",i.innerHTML+="#cleantalk-modal-close:before{"+o+"}",i.innerHTML+="#cleantalk-modal-close:after{"+l+"}",document.body.append(i),document.createElement("div")),t=(d.setAttribute("id","cleantalk-modal-overlay"),document.body.append(d),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),a=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",n),d.append(t),document.createElement("div")),o=(a.setAttribute("id","cleantalk-modal-close"),t.append(a),document.createElement("div"));this.loaded?o.innerHTML=this.loaded:(o.innerHTML="Loading...",this.load("get_options_template")),o.setAttribute("id","cleantalk-modal-content"),t.append(o),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}}
|
2 |
//# sourceMappingURL=apbct-public--3--cleantalk-modal.min.js.map
|
1 |
+
let cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,n,a){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e="";for(key in this.styles)e+=key+":"+this.styles[key]+";";return e}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},n={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},a={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},o={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},l={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},d={styles:{overflow:"hidden"},toString:e},i=document.createElement("style"),d=(i.setAttribute("id","cleantalk-modal-styles"),i.innerHTML="body.cleantalk-modal-opened{"+d+"}",i.innerHTML+="#cleantalk-modal-overlay{"+t+"}",i.innerHTML+="#cleantalk-modal-close{"+a+"}",i.innerHTML+="#cleantalk-modal-close:before{"+o+"}",i.innerHTML+="#cleantalk-modal-close:after{"+l+"}",document.body.append(i),document.createElement("div")),t=(d.setAttribute("id","cleantalk-modal-overlay"),document.body.append(d),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),a=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",n),d.append(t),document.createElement("div")),o=(a.setAttribute("id","cleantalk-modal-close"),t.append(a),document.createElement("div"));this.loaded?o.innerHTML=this.loaded:(o.innerHTML="Loading...",this.load("get_options_template")),o.setAttribute("id","cleantalk-modal-content"),t.append(o),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}};document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)});
|
2 |
//# sourceMappingURL=apbct-public--3--cleantalk-modal.min.js.map
|
js/apbct-public--3--cleantalk-modal.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"apbct-public--3--cleantalk-modal.min.js","sources":["apbct-public--3--cleantalk-modal.js"],"sourcesContent":["/* Cleantalk Modal object */\ncleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});"],"names":["cleantalkModal","loaded","loading","opened","opening","load","action","this","callback","result","data","params","obj","document","dispatchEvent","CustomEvent","bubbles","apbct_admin_sendAJAX","apbct_public_sendAJAX","notJson","open","renderCss","cssStr","key","styles","overlayCss","z-index","position","top","left","width","height","background","display","justify-content","align-items","toString","innerCss","padding","border","border-radius","box-shadow","closeCss","cursor","right","box-sizing","closeCssBefore","content","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","createElement","overlay","setAttribute","innerHTML","body","append","inner","classList","add","close","remove","getElementById","addEventListener","e","target","id"],"mappings":"AACAA,eAAiB,CAGbC,QAAQ,EACRC,SAAS,EACTC,QAAQ,EACRC,SAAS,EAGTC,KAAM,SAAUC,GACNC,KAAKN,SACPM,KAAKL,SAAU,EACfM,SAAW,SAAUC,EAAQC,EAAMC,EAAQC,GACvCZ,eAAeE,SAAU,EACzBF,eAAeC,OAASQ,EACxBI,SAASC,cACL,IAAIC,YAAa,8BAA+B,CAC5CC,SAAS,OAIe,mBAAzBC,qBACPA,qBAEAC,uBAFsB,CAAEZ,OAAWA,GAAU,CAAEE,SAAYA,SAAUW,SAAW,MAQ5FC,KAAM,WAEc,SAAZC,IACA,IAAIC,EAAS,GACb,IAAMC,OAAOhB,KAAKiB,OACdF,GAAUC,IAAM,IAAMhB,KAAKiB,OAAOD,KAAO,IAE7C,OAAO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,2BAC5B1C,SAAS4C,KAAKC,OAAQJ,GAEtBzC,SAAS4C,KAAKG,UAAUC,IAAK,0BAEjBhD,SAASwC,cAAe,QAKhCS,GAJJH,EAAMJ,aAAc,KAAM,yBAC1BI,EAAMJ,aAAc,QAASlB,GAC7BiB,EAAQI,OAAQC,GAEJ9C,SAASwC,cAAe,QAIhCN,GAHJe,EAAMP,aAAc,KAAM,yBAC1BI,EAAMD,OAAQI,GAEAjD,SAASwC,cAAe,QACjC9C,KAAKN,OACN8C,EAAQS,UAAYjD,KAAKN,QAEzB8C,EAAQS,UAAY,aAEpBjD,KAAKF,KAAM,yBAEf0C,EAAQQ,aAAc,KAAM,2BAC5BI,EAAMD,OAAQX,GAEdxC,KAAKJ,QAAS,GAGlB2D,MAAO,WACHjD,SAAS4C,KAAKG,UAAUG,OAAQ,0BAChClD,SAASmD,eAAgB,2BAA4BD,SACrDlD,SAASmD,eAAgB,0BAA2BD,SACpDlD,SAASC,cACL,IAAIC,YAAa,uBAAwB,CACrCC,SAAS,OAQzBH,SAASoD,iBAAiB,QAAQ,SAAUC,IACpCA,EAAEC,QAA0B,4BAAhBD,EAAEC,OAAOC,IAAoD,0BAAhBF,EAAEC,OAAOC,KAClEpE,eAAe8D,UAGvBjD,SAASoD,iBAAiB,8BAA+B,SAAUC,GAC3DlE,eAAeG,QAAUH,eAAeC,SACxCY,SAASmD,eAAgB,2BAA4BR,UAAYxD,eAAeC"}
|
1 |
+
{"version":3,"file":"apbct-public--3--cleantalk-modal.min.js","sources":["apbct-public--3--cleantalk-modal.js"],"sourcesContent":["/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});"],"names":["let","cleantalkModal","loaded","loading","opened","opening","load","action","this","callback","result","data","params","obj","document","dispatchEvent","CustomEvent","bubbles","apbct_admin_sendAJAX","apbct_public_sendAJAX","notJson","open","renderCss","cssStr","key","styles","overlayCss","z-index","position","top","left","width","height","background","display","justify-content","align-items","toString","innerCss","padding","border","border-radius","box-shadow","closeCss","cursor","right","box-sizing","closeCssBefore","content","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","createElement","overlay","setAttribute","innerHTML","body","append","inner","classList","add","close","remove","getElementById","addEventListener","e","target","id"],"mappings":"AACAA,IAAIC,eAAiB,CAGjBC,OAAQ,CAAA,EACRC,QAAS,CAAA,EACTC,OAAQ,CAAA,EACRC,QAAS,CAAA,EAGTC,KAAM,SAAUC,GACNC,KAAKN,SACPM,KAAKL,QAAU,CAAA,EACfM,SAAW,SAAUC,EAAQC,EAAMC,EAAQC,GACvCZ,eAAeE,QAAU,CAAA,EACzBF,eAAeC,OAASQ,EACxBI,SAASC,cACL,IAAIC,YAAa,8BAA+B,CAC5CC,QAAS,CAAA,CACb,CAAE,CACN,CACJ,GACoC,YAAhC,OAAOC,qBACPA,qBAEAC,uBAFsB,CAAEZ,OAAWA,CAAO,EAAG,CAAEE,SAAYA,SAAUW,QAAW,CAAA,CAAK,CAAE,EAMnG,EAEAC,KAAM,WAEc,SAAZC,IACA,IAAIC,EAAS,GACb,IAAMC,OAAOhB,KAAKiB,OACdF,GAAUC,IAAM,IAAMhB,KAAKiB,OAAOD,KAAO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class ApbctCore{ajax_parameters={};rest_parameters={};#selector=null;elements=[];#eventCallback;#eventSelector;#event;constructor(e){this.select(e)}select(e){return e instanceof HTMLCollection?(this.#selector=null,this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"==typeof e?(this.#selector=null,this.elements=[],this.elements[0]=e):"string"==typeof e?(this.#selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.#deselect(),this}#addElement(e){"object"==typeof e?this.elements.push(e):"string"==typeof e?(this.#selector=e,this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):this.#deselect()}#push(e){this.elements.push(e)}#reduce(){this.elements=this.elements.slice(0,-1)}#deselect(){this.elements=[]}css(o,t){if(t|=!1,"object"==typeof o){for(let t in o){var n=t.replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_",""));for(let e=0;e<this.elements.length;e++)this.elements[e].style[n]=o[t]}return this}if("string"==typeof o){let e=getComputedStyle(this.elements[0])[o];return(console.log(e),void 0===e||t)?e:(e=e.replace(/(\d)(em|pt|%|px){1,2}$/,"$1"),e=Number(e)==e?Number(e):e)}}hide(){this.prop("prev-display",this.css("display")),this.css({display:"none"})}show(){this.css({display:this.prop("prev-display")})}addClass(){for(let e=0;e<this.elements.length;e++)this.elements[e].classList.add(className)}removeClass(){for(let e=0;e<this.elements.length;e++)this.elements[e].classList.remove(className)}toggleClass(t){for(let e=0;e<this.elements.length;e++)this.elements[e].classList.toggle(t)}ajax(e){return this.ajax_parameters=e,new ApbctAjax(e)}rest(e){return this.rest_parameters=e,new ApbctRest(e)}on(...e){this.#event=e[0],this.#eventCallback=e[2]||e[1],this.#eventSelector="string"==typeof e[1]?e[1]:null;for(let e=0;e<this.elements.length;e++)this.elements[e].addEventListener(this.#event,null!==this.#eventSelector?this.#onChecker.bind(this):this.#eventCallback)}#onChecker(e){if(e.target===document.querySelector(this.#eventSelector))return e.stopPropagation(),this.#eventCallback(e)}ready(e){document.addEventListener("DOMContentLoaded",e)}change(e){this.on("change",e)}attr(t){let o=[];for(let e=0;e<this.elements.length;e++)this.elements[e][t],o.push(this.elements[e][t]);return 1===o.length?o[0]:o}prop(o,t){if(void 0!==t){for(let e=0;e<this.elements.length;e++)this.elements[e][o]=t;return this}{let t=[];for(let e=0;e<this.elements.length;e++)t.push(this.elements[e][o]);return 1===t.length?t[0]:t}}html(e){return void 0!==e?this.prop("innerHTML",e):this.prop("innerHTML")}val(e){return void 0!==e?this.prop("value",e):this.prop("value")}data(e,t){return void 0!==t?this.prop("apbct-data",e,t):this.prop("apbct-data")}is(e){let t=!1;for(var o of this.elements)t||=this.#isElem(o,e);return t}#isElem(e,t){let o=!1;return"function"==typeof t&&(o||=t.call(this,e)),"string"==typeof t&&(t.match(/^[a-z]/)&&function(e){e=document.createElement(e).constructor;return!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))}(t)?o||=e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||=Boolean(e[t]):o||=null!==this.#selector?null!==document.querySelector(this.#selector+t):this.#isWithoutSelector(e,t)),o}#isWithoutSelector(e,t){var o;let n=!1;for(o of document.querySelectorAll(t))n||=e===o;return n}filter(t){this.#selector=null;for(let e=this.elements.length-1;0<=e;e--)this.#isElem(this.elements[e],t)||this.elements.splice(Number(e),1);return this}parent(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||this.#deselect(),this}parents(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)this.#push(this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}children(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}siblings(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}remove(){for(var e of this.elements)e.remove()}after(e){for(var t of this.elements)t.after(e)}append(e){for(var t of this.elements)t.append(e)}fadeIn(o){for(let t of this.elements){t.style.opacity=0,t.style.display="block";let e=+new Date;const n=function(){t.style.opacity=+t.style.opacity+(new Date-e)/o,e=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(n)||setTimeout(n,16))};n()}}fadeOut(o){for(let t of this.elements){t.style.opacity=1;let e=+new Date;const n=function(){t.style.opacity=+t.style.opacity-(new Date-e)/o,e=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(n)||setTimeout(n,16):t.style.display="none"};n()}}}function apbct(e){return(new ApbctCore).select(e)}class ApbctXhr{#xhr=new XMLHttpRequest;method="POST";url="";async=!0;user=null;password=null;data={};button=null;spinner=null;progressbar=null;context=this;callback=null;onErrorCallback=null;responseType="json";headers={};timeout=15e3;#methods_to_convert_data_to_URL=["GET","HEAD"];#body=null;#http_code=0;#status_text="";constructor(e){for(var t in console.log("%cXHR%c started","color: red; font-weight: bold;","color: grey; font-weight: normal;"),e)void 0!==this[t]&&(this[t]=e[t]);if(this.#prepare(),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;this.#xhr.open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),this.#xhr.responseType=this.responseType,this.#xhr.timeout=this.timeout,this.#xhr.onreadystatechange=function(){this.onReadyStateChange()}.bind(this),this.#xhr.onload=function(){this.onLoad()}.bind(this),this.#xhr.onprogress=function(e){this.onProgress(e)}.bind(this),this.#xhr.onerror=function(){this.onError()}.bind(this),this.#xhr.ontimeout=function(){this.onTimeout()}.bind(this),this.#xhr.send(this.#body)}#prepare(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}#complete(){this.#http_code=this.#xhr.status,this.#status_text=this.#xhr.statusText,this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}onReadyStateChange(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}onProgress(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}onError(){console.log("error"),this.#complete(),this.#error(this.#http_code,this.#status_text),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(this.#status_text)}onTimeout(){this.#complete(),this.#error(0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}onLoad(){if(this.#complete(),"json"===this.responseType){if(null===this.#xhr.response)return this.#error(this.#http_code,this.#status_text,"No response"),!1;if(void 0!==this.#xhr.response.error)return this.#error(this.#http_code,this.#status_text,this.#xhr.response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,this.#xhr.response,this.data)}#error(e,t,o){let n="";"timeout"===t?n+="Server response timeout":200===e?"parsererror"===t?n+="Unexpected response from server. See console for details.":(n+="Unexpected error. Status: "+t+".",void 0!==o&&(n+=" Additional error info: "+o)):n+=500===e?"Internal server error.":"Unexpected response code:"+e,this.errorOutput(n)}errorOutput(e){console.log("%c ctXHR error: %c"+e,"color: red;","color: grey;")}setHeaders(){for(var e in this.headers)void 0!==this.headers[e]&&this.#xhr.setRequestHeader(e,this.headers[e])}convertData(){return~this.#methods_to_convert_data_to_URL.indexOf(this.method)?this.convertDataToURL():this.convertDataToBody()}convertDataToURL(){var e=new URLSearchParams(this.data).toString(),t=this.url.match(/^(https?:\/{2})?[a-z0-9.]+\?/)?"&":"?";return this.url+=t+e,this.url}convertDataToBody(){for(var e in this.#body=new FormData,this.data)this.#body.append(e,"object"==typeof this.data[e]?JSON.stringify(this.data[e]):this.data[e]);return this.#body}deleteDoubleJSONEncoding(e){if("object"==typeof e)for(var t in e){var o;"object"==typeof e[t]&&(e[t]=this.deleteDoubleJSONEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"==typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}}class ApbctAjax extends ApbctXhr{constructor(...e){super(e[0])}}class ApbctRest extends ApbctXhr{static default_route=ctPublicFunctions._rest_url+"cleantalk-antispam/v1/";route="";constructor(...e){(e=e[0]).url=ApbctRest.default_route+e.route,e.headers={"X-WP-Nonce":ctPublicFunctions._rest_nonce},super(e)}}function ctSetCookie(e,t,o){var n;if(("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){apbctLocalStorage.set(e[0],encodeURIComponent(e[1]))}),ctNoCookieAttachHiddenFieldsToForms();else if("native"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",i="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+i});else if("alternative"===ctPublicFunctions.data__cookies_type&&!n){"function"==typeof getJavascriptClientData?e=getJavascriptClientData(e):console.log("APBCT ERROR: getJavascriptClientData() is not loaded");try{JSON.parse(e)}catch(e){return void console.log("APBCT ERROR: JSON parse error:"+e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})}}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(e,t,o){let n=[];n.callback=t.callback||null,n.onErrorCallback=t.onErrorCallback||null,n.callback_context=t.callback_context||null,n.callback_params=t.callback_params||null,n.async=t.async||!0,n.notJson=t.notJson||null,n.timeout=t.timeout||15e3,n.obj=o||null,n.button=t.button||null,n.progressbar=t.progressbar||null,n.silent=t.silent||null,n.no_nonce=t.no_nonce||null,n.data=e,n.url=ctPublicFunctions._ajax_url,"string"==typeof e?(n.no_nonce||(n.data=n.data+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce),n.data=n.data+"&no_cache="+Math.random()):(n.no_nonce||(n.data._ajax_nonce=ctPublicFunctions._ajax_nonce),n.data.no_cache=Math.random()),(new ApbctCore).ajax(n)}function apbct_public_sendREST(e,t){let o=[];o.route=e,o.callback=t.callback||null,o.onErrorCallback=t.onErrorCallback||null,o.data=t.data||[],o.method=t.method||"POST",(new ApbctCore).rest(o)}apbctLocalStorage={get:function(t,e){void 0===e&&(e="value");t=localStorage.getItem(t);if(null!==t)try{const o=JSON.parse(t);return o.hasOwnProperty(e)?JSON.parse(o[e]):o}catch(e){return t}return!1},set:function(e,t,o=!0){o?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){let o={};for(let t=0;t<localStorage.length;t++){let e=localStorage.key(t);-1===e.indexOf("ct_")&&-1===e.indexOf("apbct_")||(o[e.toString()]=apbctLocalStorage.get(e))}return o}};var ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter&&ctMouseStopData())};function ctMouseStopData(){apbct_remove_event_handler(window,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(window,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(t){if(ctSetCookie("apbct_pixel_url",t),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")){let e=document.createElement("img");e.setAttribute("alt","CleanTalk Pixel"),e.setAttribute("id","apbct_pixel"),e.setAttribute("style","display: none; left: 99999px;"),e.setAttribute("src",t),apbct("body").append(e)}}function ctGetPixelUrl(){var e=apbctLocalStorage.get("apbct_pixel_url");if(!1!==e){if(!apbctLocalStorage.isAlive("apbct_pixel_url",10800))return void ctSetPixelImg(e);apbctLocalStorage.delete("apbct_pixel_url")}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function ctPreloadLocalStorage(){if(ctPublic.data__to_local_storage){let e=Object.entries(ctPublic.data__to_local_storage);e.forEach(([e,t])=>{apbctLocalStorage.set(e,t)})}}function apbct_ready(){ctPreloadLocalStorage();var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if(apbctLocalStorage.set("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),apbctLocalStorage.set("ct_fkp_timestamp","0"),apbctLocalStorage.set("ct_pointer_data","0"),apbctLocalStorage.set("ct_timezone",ct_date.getTimezoneOffset()/60*-1),apbctLocalStorage.set("ct_screen_info",apbctGetScreenInfo()),apbctLocalStorage.set("apbct_headless",navigator.webdriver),"native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),apbct("input[type = 'email'], #email").on("blur",checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){ctNoCookieAttachHiddenFieldsToForms();for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"===n.id||n.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=JSON.stringify(o),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),console.log("visible_fields[0]"+t[0]),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);let i=document.querySelectorAll("[data-original-string]");if(i.length)for(let e=0;e<i.length;++e)i[e].parentElement.href||i[e].parentElement.parentElement.href||i[e].addEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler),apbctAjaxEmailDecode(e,this)}function apbctAjaxEmailDecode(e,n){const i=e.target;let t={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer};if(void 0!==n.href&&0===n.href.indexOf("mailto:"))e.preventDefault();else{i.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),i.style.cursor="progress";let e=document.createElement("div"),t=(e.setAttribute("class","apbct-tooltip"),document.createElement("div")),o=(t.setAttribute("class","apbct-tooltip--text"),document.createElement("div"));o.setAttribute("class","apbct-tooltip--arrow"),apbct(i).append(e),apbct(e).append(t),apbct(e).append(o),ctShowDecodeComment(i,ctPublicFunctions.text__wait_for_decoding)}let o=e.target.dataset.originalString;void 0!==n.href&&0===n.href.indexOf("mailto:")&&(o=n.dataset.originalString),t.encodedEmail=o,"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:t,method:"POST",callback:function(t){if(t.success)if(void 0!==n.href&&0===n.href.indexOf("mailto:")){var o=n.href.replace("mailto:","");let e=n.innerHTML;n.innerHTML=e.replace(o,t.data.decoded_email),n.href="mailto:"+t.data.decoded_email,n.click()}else setTimeout(function(){ctProcessDecodedDataResult(t.data,e.target)},3e3);setTimeout(function(){apbct(i.getElementsByClassName("apbct-tooltip")).fadeOut(700)},4e3)},onErrorCallback:function(e){i.addEventListener("click",ctFillDecodedEmailHandler),i.removeAttribute("style"),ctShowDecodeComment(i,"Error occurred: "+e)}}):(t.action="apbct_decode_email",apbct_public_sendAJAX(t,{notJson:!0,callback:function(t){if(t.success)if(void 0!==n.href&&0===n.href.indexOf("mailto:")){var o=n.href.replace("mailto:","");let e=n.innerHTML;n.innerHTML=e.replace(o,t.data.decoded_email),n.href="mailto:"+t.data.decoded_email,n.click()}else setTimeout(function(){ctProcessDecodedDataResult(t.data,e.target)},3e3);setTimeout(function(){apbct(i.getElementsByClassName("apbct-tooltip")).fadeOut(700)},4e3)},onErrorCallback:function(e){i.addEventListener("click",ctFillDecodedEmailHandler),i.removeAttribute("style"),ctShowDecodeComment(i,"Error occurred: "+e)}}))}function getJavascriptClientData(t=[]){let o={};o.apbct_headless=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless"),o.apbct_pixel_url=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),o.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),o.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),o.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),o.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),o.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),o.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),o.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone");var e=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),n=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),i=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),c=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),a=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),l=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type");if(o.ct_mouse_moved=void 0!==e?e:c,o.ct_has_scrolled=void 0!==n?n:a,o.ct_cookies_type=void 0!==i?i:l,"object"==typeof t&&t!==[])for(let e=0;e<t.length;++e)"object"==typeof t[e][1]?o[t[e][1][0]]=t[e][1][1]:o[t[e][0]]=t[e][1];else console.log("APBCT JS ERROR: Collecting data type mismatch");return o=removeDoubleJsonEncoding(o),JSON.stringify(o)}function removeDoubleJsonEncoding(e){if("object"==typeof e)for(var t in e){var o;"object"==typeof e[t]&&(e[t]=removeDoubleJsonEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"==typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),e.is_allowed&&ctFillDecodedEmail(t,e.decoded_email),e.show_comment&&ctShowDecodeComment(t,e.comment)}function ctFillDecodedEmail(e,t){apbct(e).html(apbct(e).html().replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/,t+"$1"))}function ctShowDecodeComment(e,t){t&&(apbct(e.getElementsByClassName("apbct-tooltip")).fadeIn(300),apbct(e.getElementsByClassName("apbct-tooltip--text")).html(t),setTimeout(function(){apbct(e.getElementsByClassName("apbct-tooltip")).fadeOut(700)},5e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",i=0,c="",a=0,l=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===l.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(l.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),i++):(c+=" "+e.getAttribute("name"),a++))}),c=c.trim(),{visible_fields:n=n.trim(),visible_fields_count:i,invisible_fields:c,invisible_fields_count:a}}function apbct_visible_fields_set_cookie(e,t){var o="object"==typeof e&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else"none"===ctPublic.data__cookies_type?ctSetCookie("apbct_visible_fields",JSON.stringify(o[0])):ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var i=document.querySelectorAll("[name^=ct_checkjs]"),c=0;c<i.length;c++)i[c].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}function ctParseBlockMessage(e){void 0!==e.apbct&&(e=e.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:e.comment}})),cleantalkModal.loaded=e.comment,cleantalkModal.open(),1==+e.stop_script&&window.stop())}function ctSetPixelUrlLocalstorage(e){ctSetCookie("apbct_pixel_url",e)}function ctNoCookieConstructHiddenField(){let e="";var t=apbctLocalStorage.getCleanTalkData(),t=JSON.stringify(t);return t=btoa(t),(e=document.createElement("input")).setAttribute("id","ct_no_cookie_hidden_field"),e.setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",t),e.setAttribute("type","hidden"),e}function ctNoCookieGetForms(){var e=document.forms;return e||!1}function ctNoCookieAttachHiddenFieldsToForms(){if("none"===ctPublic.data__cookies_type){var t=ctNoCookieGetForms();if(t)for(let e=0;e<t.length;e++)if(null===document.forms[e].getAttribute("method")||"post"===document.forms[e].getAttribute("method").toLowerCase()){let t=document.getElementsByName("ct_no_cookie_hidden_field");if(t)for(let e=0;e<t.length;e++)t[e].parentNode.removeChild(t[e]);document.forms[e].append(ctNoCookieConstructHiddenField())}}}apbct_attach_event_handler(window,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(window,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(window,"scroll",ctSetHasScrolled),apbct_attach_event_handler(window,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(responseText)}catch(e){return void console.log(e.toString())}ctParseBlockMessage(n)}}),cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e="";for(key in this.styles)e+=key+":"+this.styles[key]+";";return e}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},i={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},c={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},a={styles:{overflow:"hidden"},toString:e},l=document.createElement("style"),a=(l.setAttribute("id","cleantalk-modal-styles"),l.innerHTML="body.cleantalk-modal-opened{"+a+"}",l.innerHTML+="#cleantalk-modal-overlay{"+t+"}",l.innerHTML+="#cleantalk-modal-close{"+n+"}",l.innerHTML+="#cleantalk-modal-close:before{"+i+"}",l.innerHTML+="#cleantalk-modal-close:after{"+c+"}",document.body.append(l),document.createElement("div")),t=(a.setAttribute("id","cleantalk-modal-overlay"),document.body.append(a),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),a.append(t),document.createElement("div")),i=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?i.innerHTML=this.loaded:(i.innerHTML="Loading...",this.load("get_options_template")),i.setAttribute("id","cleantalk-modal-content"),t.append(i),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)});let buttons_to_handle=[],gdpr_notice_for_button="Please, apply the GDPR agreement.";function apbct_gdpr_handle_buttons(){try{if(buttons_to_handle===[])return;buttons_to_handle.forEach(e=>{var t='[id="apbct_gdpr_'+e.index+'"]',t=jQuery(t);jQuery(t).prop("checked")?(e.button.disabled=!1,jQuery(e.button).prop("title",e.old_notice)):(e.button.disabled=!0,jQuery(e.button).prop("title",gdpr_notice_for_button))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not handle form buttons "+e)}}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var n=document.forms[e];if(n.parentElement&&0<n.parentElement.classList.length&&-1!==n.parentElement.classList[0].indexOf("mewtwo"))return;if("string"==typeof n.action)if(isIntegratedForm(n)){var i=document.createElement("i"),i=(i.className="cleantalk_placeholder",i.style="display: none",n.parentElement.insertBefore(i,n),n.previousSibling),c=n.outerHTML,a=n;n.parentElement.removeChild(n);const l=document.createElement("div");l.innerHTML=c,i.after(l.firstElementChild);var c=document.createElement("input");c.name="action",c.value="cleantalk_force_ajax_check",c.type="hidden";let t=document.forms[e],o=(t.appendChild(c),t.apbctPrev=i,t.apbctFormOriginal=a,!1);if(void 0!==t.classList){let e=["newsletterform","ml-block-form"];e.forEach(function(e){t.classList.contains(e)&&(o=e)})}if(o){let e=jQuery("form."+o).find('button[type="submit"]');void 0!==e&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(e.currentTarget)})}else document.forms[e].onsubmit=function(e){e.preventDefault();jQuery(e.currentTarget).prev(),jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget)}}else-1===n.action.indexOf("http://")&&-1===n.action.indexOf("https://")||n.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((c=document.createElement("input")).name="cleantalk_hidden_action",c.value=n.action,c.type="hidden",n.appendChild(c),(i=document.createElement("input")).name="cleantalk_hidden_method",i.value=n.method,i.type="hidden",n.method="POST",n.appendChild(i),n.action=document.location)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var i=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(i.val())})})}function isIntegratedForm(e){var t=e.action;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com"))}function sendAjaxCheckingFormData(a,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(a),apbct_visible_fields_set_cookie(o),{}),o=a.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n){if(void 0===e.apbct||!+e.apbct.blocked){var i=jQuery(a).detach();let e=a.apbctPrev;var c=a.apbctFormOriginal,i=(apbct_replace_inputs_values_from_other_form(i,c),e.after(c),jQuery(c).find('input[name="apbct_visible_fields"]').remove(),jQuery(c).find('input[value="cleantalk_force_ajax_check"]').remove(),jQuery(c).find("button[type=submit]"));if(0!==i.length)return void i[0].click();if(0!==(i=jQuery(c).find("input[type=submit]")).length)return void i[0].click();if(0!==(i=jQuery(c).find('button[data-element="submit"]')).length)return void i[0].click();0!==(i=jQuery(c).find('input[type="image"][name="submit"]')).length&&i[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",apbct_public_sendAJAX(o,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.submit()}})}function ct_check_internal__is_exclude_form(t){let e=[ctPublic.blog_home+"wp-login.php",ctPublic.blog_home+"wp-comments-post.php"];return e.some(e=>null!==t.match(new RegExp("^"+e)))}document.addEventListener("DOMContentLoaded",function(){if(buttons_to_handle=[],"undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms.length&&"undefined"!=typeof jQuery)try{ctPublicGDPR.gdpr_forms.forEach(function(e,t){let o=jQuery("#"+e+", ."+e),n=(o.is("form")||(o.find("form")[0]?o=o.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?o=jQuery(".wpcf7[role=form]").children("form"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?o=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(o=jQuery(".wpforms-form"))),!1);var e=o.find('input[type|="submit"]');e.length&&(!1!==(n=e[0])&&(console.log(e),n.disabled=!0,e=jQuery(n).prop("title")?jQuery(n).prop("title"):"",buttons_to_handle.push({index:t,button:n,old_notice:e}),jQuery(n).prop("title",gdpr_notice_for_button)),!o.is("form")&&"form"!==o.attr("role")||o.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required" style=" margin-right: 10px;" onchange="apbct_gdpr_handle_buttons()">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>"))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not add GDPR notice"+e)}}),window.onload=function(){+ctPublic.settings__forms__check_external&&"undefined"!=typeof jQuery&&setTimeout(function(){ct_protect_external()},1500)},document.addEventListener("DOMContentLoaded",function(){let t="",o;if(+ctPublic.settings__forms__check_internal)for(let e=0;e<document.forms.length;e++)"string"==typeof document.forms[e].action&&(o=document.forms[e],null===(t=o.action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(ctPrevHandler=o.click,"undefined"!=typeof jQuery&&(jQuery(o).off("**"),jQuery(o).off(),jQuery(o).on("submit",function(e){return ct_check_internal(e.target),!1}))))});
|
1 |
+
"use strict";function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(e,t){var o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var n,i,a=[],r=!0,c=!1;try{for(o=o.call(e);!(r=(n=o.next()).done)&&(a.push(n.value),!t||a.length!==t);r=!0);}catch(e){c=!0,i=e}finally{try{r||null==o.return||o.return()}finally{if(c)throw i}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _createSuper(o){var n=_isNativeReflectConstruct();return function(){var e,t=_getPrototypeOf(o);return _possibleConstructorReturn(this,n?(e=_getPrototypeOf(this).constructor,Reflect.construct(t,arguments,e)):t.apply(this,arguments))}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _createForOfIteratorHelper(e,t){var o,n,i,a,r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return n=!(o=!0),{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){n=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(n)throw i}}};if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return r&&(e=r),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var o;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(o="Object"===(o=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:o)||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function _classPrivateMethodInitSpec(e,t){_checkPrivateRedeclaration(e,t),t.add(e)}function _classPrivateFieldInitSpec(e,t,o){_checkPrivateRedeclaration(e,t),t.set(e,o)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function _classPrivateFieldGet(e,t){return _classApplyDescriptorGet(e,_classExtractFieldDescriptor(e,t,"get"))}function _classApplyDescriptorGet(e,t){return t.get?t.get.call(e):t.value}function _classPrivateMethodGet(e,t,o){if(t.has(e))return o;throw new TypeError("attempted to get private field on non-instance")}function _classPrivateFieldSet(e,t,o){return _classApplyDescriptorSet(e,_classExtractFieldDescriptor(e,t,"set"),o),o}function _classExtractFieldDescriptor(e,t,o){if(t.has(e))return t.get(e);throw new TypeError("attempted to "+o+" private field on non-instance")}function _classApplyDescriptorSet(e,t,o){if(t.set)t.set.call(e,o);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=o}}var _selector=new WeakMap,_eventCallback=new WeakMap,_eventSelector=new WeakMap,_event=new WeakMap,_addElement=new WeakSet,_push=new WeakSet,_reduce=new WeakSet,_deselect=new WeakSet,_onChecker=new WeakSet,_isElem=new WeakSet,_isWithoutSelector=new WeakSet,ApbctCore=function(){function t(e){_classCallCheck(this,t),_classPrivateMethodInitSpec(this,_isWithoutSelector),_classPrivateMethodInitSpec(this,_isElem),_classPrivateMethodInitSpec(this,_onChecker),_classPrivateMethodInitSpec(this,_deselect),_classPrivateMethodInitSpec(this,_reduce),_classPrivateMethodInitSpec(this,_push),_classPrivateMethodInitSpec(this,_addElement),_defineProperty(this,"ajax_parameters",{}),_defineProperty(this,"rest_parameters",{}),_classPrivateFieldInitSpec(this,_selector,{writable:!0,value:null}),_defineProperty(this,"elements",[]),_classPrivateFieldInitSpec(this,_eventCallback,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_eventSelector,{writable:!0,value:void 0}),_classPrivateFieldInitSpec(this,_event,{writable:!0,value:void 0}),this.select(e)}return _createClass(t,[{key:"select",value:function(e){return e instanceof HTMLCollection?(_classPrivateFieldSet(this,_selector,null),this.elements=[],this.elements=Array.prototype.slice.call(e)):"object"===_typeof(e)?(_classPrivateFieldSet(this,_selector,null),this.elements=[],this.elements[0]=e):"string"==typeof e?(_classPrivateFieldSet(this,_selector,e),this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):_classPrivateMethodGet(this,_deselect,_deselect2).call(this),this}},{key:"css",value:function(e,t){if(t|=!1,"object"===_typeof(e)){for(var o in e)for(var n=o.replace(/([-_][a-z])/g,function(e){return e.toUpperCase().replace("-","").replace("_","")}),i=0;i<this.elements.length;i++)this.elements[i].style[n]=e[o];return this}var a;if("string"==typeof e)return void 0!==(a=getComputedStyle(this.elements[0])[e])&&!t&&(a=a.replace(/(\d)(em|pt|%|px){1,2}$/,"$1"),Number(a)==a)?Number(a):a}},{key:"hide",value:function(){this.prop("prev-display",this.css("display")),this.css({display:"none"})}},{key:"show",value:function(){this.css({display:this.prop("prev-display")})}},{key:"addClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.add(className)}},{key:"removeClass",value:function(){for(var e=0;e<this.elements.length;e++)this.elements[e].classList.remove(className)}},{key:"toggleClass",value:function(e){for(var t=0;t<this.elements.length;t++)this.elements[t].classList.toggle(e)}},{key:"ajax",value:function(e){return this.ajax_parameters=e,new ApbctAjax(e)}},{key:"rest",value:function(e){return this.rest_parameters=e,new ApbctRest(e)}},{key:"on",value:function(){_classPrivateFieldSet(this,_event,arguments.length<=0?void 0:arguments[0]),_classPrivateFieldSet(this,_eventCallback,(arguments.length<=2?void 0:arguments[2])||(arguments.length<=1?void 0:arguments[1])),_classPrivateFieldSet(this,_eventSelector,"string"==typeof(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:null);for(var e=0;e<this.elements.length;e++)this.elements[e].addEventListener(_classPrivateFieldGet(this,_event),null!==_classPrivateFieldGet(this,_eventSelector)?_classPrivateMethodGet(this,_onChecker,_onChecker2).bind(this):_classPrivateFieldGet(this,_eventCallback))}},{key:"ready",value:function(e){document.addEventListener("DOMContentLoaded",e)}},{key:"change",value:function(e){this.on("change",e)}},{key:"attr",value:function(e){for(var t=[],o=0;o<this.elements.length;o++)void 0!==_typeof(this.elements[o][e])?t.push(this.elements[o][e]):t.push(this.elements[o].getAttribute(e));return 1===t.length?t[0]:t}},{key:"prop",value:function(e,t){if(void 0!==t){for(var o=0;o<this.elements.length;o++)this.elements[o][e]=t;return this}for(var n=[],i=0;i<this.elements.length;i++)n.push(this.elements[i][e]);return 1===n.length?n[0]:n}},{key:"html",value:function(e){return void 0!==e?this.prop("innerHTML",e):this.prop("innerHTML")}},{key:"val",value:function(e){return void 0!==e?this.prop("value",e):this.prop("value")}},{key:"data",value:function(e,t){return void 0!==t?this.prop("apbct-data",e,t):this.prop("apbct-data")}},{key:"is",value:function(e){var t,o=!1,n=_createForOfIteratorHelper(this.elements);try{for(n.s();!(t=n.n()).done;)var i=t.value,o=o||_classPrivateMethodGet(this,_isElem,_isElem2).call(this,i,e)}catch(e){n.e(e)}finally{n.f()}return o}},{key:"filter",value:function(e){_classPrivateFieldSet(this,_selector,null);for(var t=this.elements.length-1;0<=t;t--)_classPrivateMethodGet(this,_isElem,_isElem2).call(this,this.elements[t],e)||this.elements.splice(Number(t),1);return this}},{key:"parent",value:function(e){return this.select(this.elements[0].parentElement),void 0===e||this.is(e)||_classPrivateMethodGet(this,_deselect,_deselect2).call(this),this}},{key:"parents",value:function(e){for(this.select(this.elements[0]);null!==this.elements[this.elements.length-1].parentElement;)_classPrivateMethodGet(this,_push,_push2).call(this,this.elements[this.elements.length-1].parentElement);return this.elements.splice(0,1),void 0!==e&&this.filter(e),this}},{key:"children",value:function(e){return this.select(this.elements[0].children),void 0!==e&&this.filter(e),this}},{key:"siblings",value:function(e){var t=this.elements[0];return this.parent(),this.children(e),this.elements.splice(this.elements.indexOf(t),1),this}},{key:"remove",value:function(){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)e.value.remove()}catch(e){t.e(e)}finally{t.f()}}},{key:"after",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.after(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"append",value:function(e){var t,o=_createForOfIteratorHelper(this.elements);try{for(o.s();!(t=o.n()).done;)t.value.append(e)}catch(e){o.e(e)}finally{o.f()}}},{key:"fadeIn",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=0,t.style.display="block",+new Date);(function e(){t.style.opacity=+t.style.opacity+(new Date-o)/n,o=+new Date,+t.style.opacity<1&&(window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16))})()}()}catch(e){t.e(e)}finally{t.f()}}},{key:"fadeOut",value:function(n){var e,t=_createForOfIteratorHelper(this.elements);try{for(t.s();!(e=t.n()).done;)!function(){var t=e.value,o=(t.style.opacity=1,+new Date);(function e(){t.style.opacity=+t.style.opacity-(new Date-o)/n,o=+new Date,0<+t.style.opacity?window.requestAnimationFrame&&requestAnimationFrame(e)||setTimeout(e,16):t.style.display="none"})()}()}catch(e){t.e(e)}finally{t.f()}}}]),t}();function _addElement2(e){"object"===_typeof(e)?this.elements.push(e):"string"==typeof e?(_classPrivateFieldSet(this,_selector,e),this.elements=Array.prototype.slice.call(document.querySelectorAll(e))):_classPrivateMethodGet(this,_deselect,_deselect2).call(this)}function _push2(e){this.elements.push(e)}function _reduce2(){this.elements=this.elements.slice(0,-1)}function _deselect2(){this.elements=[]}function _onChecker2(e){if(e.target===document.querySelector(_classPrivateFieldGet(this,_eventSelector)))return e.stopPropagation(),_classPrivateFieldGet(this,_eventCallback).call(this,e)}function _isElem2(e,t){var o=!1;return"function"==typeof t&&(o=o||t.call(this,e)),o="string"==typeof t?t.match(/^[a-z]/)&&function(e){e=document.createElement(e).constructor;return!Boolean(~[HTMLElement,HTMLUnknownElement].indexOf(e))}(t)?o||e.tagName.toLowerCase()===t.toLowerCase():t.match(/^[a-z]/)?o||Boolean(e[t]):o||(null!==_classPrivateFieldGet(this,_selector)?null!==document.querySelector(_classPrivateFieldGet(this,_selector)+t):_classPrivateMethodGet(this,_isWithoutSelector,_isWithoutSelector2).call(this,e,t)):o}function _isWithoutSelector2(e,t){var o,n=!1,i=_createForOfIteratorHelper(document.querySelectorAll(t));try{for(i.s();!(o=i.n()).done;)var a=o.value,n=n||e===a}catch(e){i.e(e)}finally{i.f()}return n}function apbct(e){return(new ApbctCore).select(e)}var _xhr=new WeakMap,_methods_to_convert_data_to_URL=new WeakMap,_body=new WeakMap,_http_code=new WeakMap,_status_text=new WeakMap,_prepare=new WeakSet,_complete=new WeakSet,_error=new WeakSet,ApbctXhr=function(){function o(e){for(var t in _classCallCheck(this,o),_classPrivateMethodInitSpec(this,_error),_classPrivateMethodInitSpec(this,_complete),_classPrivateMethodInitSpec(this,_prepare),_classPrivateFieldInitSpec(this,_xhr,{writable:!0,value:new XMLHttpRequest}),_defineProperty(this,"method","POST"),_defineProperty(this,"url",""),_defineProperty(this,"async",!0),_defineProperty(this,"user",null),_defineProperty(this,"password",null),_defineProperty(this,"data",{}),_defineProperty(this,"button",null),_defineProperty(this,"spinner",null),_defineProperty(this,"progressbar",null),_defineProperty(this,"context",this),_defineProperty(this,"callback",null),_defineProperty(this,"onErrorCallback",null),_defineProperty(this,"responseType","json"),_defineProperty(this,"headers",{}),_defineProperty(this,"timeout",15e3),_classPrivateFieldInitSpec(this,_methods_to_convert_data_to_URL,{writable:!0,value:["GET","HEAD"]}),_classPrivateFieldInitSpec(this,_body,{writable:!0,value:null}),_classPrivateFieldInitSpec(this,_http_code,{writable:!0,value:0}),_classPrivateFieldInitSpec(this,_status_text,{writable:!0,value:""}),console.log("%cXHR%c started","color: red; font-weight: bold;","color: grey; font-weight: normal;"),e)void 0!==this[t]&&(this[t]=e[t]);if(_classPrivateMethodGet(this,_prepare,_prepare2).call(this),Object.keys(this.data).length&&(this.deleteDoubleJSONEncoding(this.data),this.convertData()),!this.url)return console.log("%cXHR%c not URL provided","color: red; font-weight: bold;","color: grey; font-weight: normal;"),!1;_classPrivateFieldGet(this,_xhr).open(this.method,this.url,this.async,this.user,this.password),this.setHeaders(),_classPrivateFieldGet(this,_xhr).responseType=this.responseType,_classPrivateFieldGet(this,_xhr).timeout=this.timeout,_classPrivateFieldGet(this,_xhr).onreadystatechange=function(){this.onReadyStateChange()}.bind(this),_classPrivateFieldGet(this,_xhr).onload=function(){this.onLoad()}.bind(this),_classPrivateFieldGet(this,_xhr).onprogress=function(e){this.onProgress(e)}.bind(this),_classPrivateFieldGet(this,_xhr).onerror=function(){this.onError()}.bind(this),_classPrivateFieldGet(this,_xhr).ontimeout=function(){this.onTimeout()}.bind(this),_classPrivateFieldGet(this,_xhr).send(_classPrivateFieldGet(this,_body))}return _createClass(o,[{key:"onReadyStateChange",value:function(){null!==this.on_ready_state_change&&"function"==typeof this.on_ready_state_change&&this.on_ready_state_change()}},{key:"onProgress",value:function(e){null!==this.on_progress&&"function"==typeof this.on_progress&&this.on_progress()}},{key:"onError",value:function(){console.log("error"),_classPrivateMethodGet(this,_complete,_complete2).call(this),_classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text)),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback(_classPrivateFieldGet(this,_status_text))}},{key:"onTimeout",value:function(){_classPrivateMethodGet(this,_complete,_complete2).call(this),_classPrivateMethodGet(this,_error,_error2).call(this,0,"timeout"),null!==this.onErrorCallback&&"function"==typeof this.onErrorCallback&&this.onErrorCallback("Timeout")}},{key:"onLoad",value:function(){if(_classPrivateMethodGet(this,_complete,_complete2).call(this),"json"===this.responseType){if(null===_classPrivateFieldGet(this,_xhr).response)return _classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text),"No response"),!1;if(void 0!==_classPrivateFieldGet(this,_xhr).response.error)return _classPrivateMethodGet(this,_error,_error2).call(this,_classPrivateFieldGet(this,_http_code),_classPrivateFieldGet(this,_status_text),_classPrivateFieldGet(this,_xhr).response.error),!1}null!==this.callback&&"function"==typeof this.callback&&this.callback.call(this.context,_classPrivateFieldGet(this,_xhr).response,this.data)}},{key:"errorOutput",value:function(e){console.log("%c ctXHR error: %c"+e,"color: red;","color: grey;")}},{key:"setHeaders",value:function(){for(var e in this.headers)void 0!==this.headers[e]&&_classPrivateFieldGet(this,_xhr).setRequestHeader(e,this.headers[e])}},{key:"convertData",value:function(){return~_classPrivateFieldGet(this,_methods_to_convert_data_to_URL).indexOf(this.method)?this.convertDataToURL():this.convertDataToBody()}},{key:"convertDataToURL",value:function(){var e=new URLSearchParams(this.data).toString(),t=this.url.match(/^(https?:\/{2})?[a-z0-9.]+\?/)?"&":"?";return this.url+=t+e,this.url}},{key:"convertDataToBody",value:function(){for(var e in _classPrivateFieldSet(this,_body,new FormData),this.data)_classPrivateFieldGet(this,_body).append(e,"object"===_typeof(this.data[e])?JSON.stringify(this.data[e]):this.data[e]);return _classPrivateFieldGet(this,_body)}},{key:"deleteDoubleJSONEncoding",value:function(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=this.deleteDoubleJSONEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}}]),o}();function _prepare2(){this.button&&(this.button.setAttribute("disabled","disabled"),this.button.style.cursor="not-allowed"),this.spinner&&(this.spinner.style.display="inline")}function _complete2(){_classPrivateFieldSet(this,_http_code,_classPrivateFieldGet(this,_xhr).status),_classPrivateFieldSet(this,_status_text,_classPrivateFieldGet(this,_xhr).statusText),this.button&&(this.button.removeAttribute("disabled"),this.button.style.cursor="auto"),this.spinner&&(this.spinner.style.display="none"),this.progressbar&&this.progressbar.fadeOut("slow")}function _error2(e,t,o){var n="";"timeout"===t?n+="Server response timeout":200===e?"parsererror"===t?n+="Unexpected response from server. See console for details.":(n+="Unexpected error. Status: "+t+".",void 0!==o&&(n+=" Additional error info: "+o)):n+=500===e?"Internal server error.":"Unexpected response code:"+e,this.errorOutput(n)}var ApbctAjax=function(){_inherits(t,ApbctXhr);var e=_createSuper(t);function t(){return _classCallCheck(this,t),e.call(this,arguments.length<=0?void 0:arguments[0])}return _createClass(t)}(),ApbctRest=function(){_inherits(a,ApbctXhr);var i=_createSuper(a);function a(){for(var e,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];return _classCallCheck(this,a),(o=o[0]).url=a.default_route+o.route,o.headers={"X-WP-Nonce":ctPublicFunctions._rest_nonce},_defineProperty(_assertThisInitialized(e=i.call(this,o)),"route",""),e}return _createClass(a)}();function ctSetCookie(e,t,o){var n;if(("string"==typeof e&&"string"==typeof t||"number"==typeof t)&&(n="ct_pointer_data"===e,e=[[e,t,o]]),"none"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){apbctLocalStorage.set(e[0],encodeURIComponent(e[1]))}),ctNoCookieAttachHiddenFieldsToForms();else if("native"===ctPublicFunctions.data__cookies_type)e.forEach(function(e,t,o){var n=void 0!==e[2]?"expires="+n+"; ":"",i="https:"===location.protocol?"; secure":"";document.cookie=ctPublicFunctions.cookiePrefix+e[0]+"="+encodeURIComponent(e[1])+"; "+n+"path=/; samesite=lax"+i});else if("alternative"===ctPublicFunctions.data__cookies_type&&!n){"function"==typeof getJavascriptClientData?e=getJavascriptClientData(e):console.log("APBCT ERROR: getJavascriptClientData() is not loaded");try{JSON.parse(e)}catch(e){return void console.log("APBCT ERROR: JSON parse error:"+e)}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("alt_sessions",{method:"POST",data:{cookies:e}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_alt_session__save__AJAX",cookies:e},{notJson:1})}}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}function ctDeleteCookie(e){var t;"none"!==ctPublicFunctions.data__cookies_type&&("native"===ctPublicFunctions.data__cookies_type?(t="https:"===location.protocol?"; secure":"",document.cookie=e+'=""; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax'+t):ctPublicFunctions.data__cookies_type)}function apbct_public_sendAJAX(e,t,o){var n=[];n.callback=t.callback||null,n.onErrorCallback=t.onErrorCallback||null,n.callback_context=t.callback_context||null,n.callback_params=t.callback_params||null,n.async=t.async||!0,n.notJson=t.notJson||null,n.timeout=t.timeout||15e3,n.obj=o||null,n.button=t.button||null,n.progressbar=t.progressbar||null,n.silent=t.silent||null,n.no_nonce=t.no_nonce||null,n.data=e,n.url=ctPublicFunctions._ajax_url,"string"==typeof e?(n.no_nonce||(n.data=n.data+"&_ajax_nonce="+ctPublicFunctions._ajax_nonce),n.data=n.data+"&no_cache="+Math.random()):(n.no_nonce||(n.data._ajax_nonce=ctPublicFunctions._ajax_nonce),n.data.no_cache=Math.random()),(new ApbctCore).ajax(n)}function apbct_public_sendREST(e,t){var o=[];o.route=e,o.callback=t.callback||null,o.onErrorCallback=t.onErrorCallback||null,o.data=t.data||[],o.method=t.method||"POST",(new ApbctCore).rest(o)}_defineProperty(ApbctRest,"default_route",ctPublicFunctions._rest_url+"cleantalk-antispam/v1/");var apbctLocalStorage={get:function(t,e){void 0===e&&(e="value");t=localStorage.getItem(t);if(null!==t)try{var o=JSON.parse(t);return o.hasOwnProperty(e)?JSON.parse(o[e]):o}catch(e){return t}return!1},set:function(e,t){var o;!(2<arguments.length&&void 0!==arguments[2])||arguments[2]?(o={value:JSON.stringify(t),timestamp:Math.floor((new Date).getTime()/1e3)},localStorage.setItem(e,JSON.stringify(o))):localStorage.setItem(e,t)},isAlive:function(e,t){return void 0===t&&(t=86400),this.get(e,"timestamp")+t>Math.floor((new Date).getTime()/1e3)},isSet:function(e){return null!==localStorage.getItem(e)},delete:function(e){localStorage.removeItem(e)},getCleanTalkData:function(){for(var e={},t=0;t<localStorage.length;t++){var o=localStorage.key(t);-1===o.indexOf("ct_")&&-1===o.indexOf("apbct_")||(e[o.toString()]=apbctLocalStorage.get(o))}return e}},ct_date=new Date,ctTimeMs=(new Date).getTime(),ctMouseEventTimerFlag=!0,ctMouseData=[],ctMouseDataCounter=0,ctCheckedEmails={};function apbct_attach_event_handler(e,t,o){"function"==typeof window.addEventListener?e.addEventListener(t,o):e.attachEvent(t,o)}function apbct_remove_event_handler(e,t,o){"function"==typeof window.removeEventListener?e.removeEventListener(t,o):e.detachEvent(t,o)}var ctFunctionFirstKey=function(e){ctSetCookie("ct_fkp_timestamp",Math.floor((new Date).getTime()/1e3)),ctKeyStopStopListening()},ctMouseReadInterval=setInterval(function(){ctMouseEventTimerFlag=!0},150),ctMouseWriteDataInterval=setInterval(function(){ctSetCookie("ct_pointer_data",JSON.stringify(ctMouseData))},1200),ctFunctionMouseMove=function(e){ctSetMouseMoved(),!0===ctMouseEventTimerFlag&&(ctMouseData.push([Math.round(e.clientY),Math.round(e.clientX),Math.round((new Date).getTime()-ctTimeMs)]),ctMouseEventTimerFlag=!1,50<=++ctMouseDataCounter&&ctMouseStopData())};function ctMouseStopData(){apbct_remove_event_handler(window,"mousemove",ctFunctionMouseMove),clearInterval(ctMouseReadInterval),clearInterval(ctMouseWriteDataInterval)}function ctKeyStopStopListening(){apbct_remove_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_remove_event_handler(window,"keydown",ctFunctionFirstKey)}function checkEmail(e){var t=e.target.value;!t||t in ctCheckedEmails||("rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("check_email_before_post",{method:"POST",data:{email:t},callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}):"admin_ajax"===ctPublicFunctions.data__ajax_type&&apbct_public_sendAJAX({action:"apbct_email_check_before_post",email:t},{callback:function(e){e.result&&(ctCheckedEmails[t]={result:e.result,timestamp:Date.now()/1e3|0},ctSetCookie("ct_checked_emails",JSON.stringify(ctCheckedEmails)))}}))}function ctSetPixelImg(e){var t;ctSetCookie("apbct_pixel_url",e),+ctPublic.pixel__enabled&&!document.getElementById("apbct_pixel")&&((t=document.createElement("img")).setAttribute("alt","CleanTalk Pixel"),t.setAttribute("id","apbct_pixel"),t.setAttribute("style","display: none; left: 99999px;"),t.setAttribute("src",e),apbct("body").append(t))}function ctGetPixelUrl(){var e=apbctLocalStorage.get("apbct_pixel_url");if(!1!==e){if(!apbctLocalStorage.isAlive("apbct_pixel_url",10800))return void ctSetPixelImg(e);apbctLocalStorage.delete("apbct_pixel_url")}"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_get_pixel_url",{method:"POST",callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}}):apbct_public_sendAJAX({action:"apbct_get_pixel_url"},{notJson:!0,callback:function(e){e&&(apbctLocalStorage.get("apbct_pixel_url")||(apbctLocalStorage.set("apbct_pixel_url",e),ctNoCookieAttachHiddenFieldsToForms()),ctSetPixelImg(e))}})}function ctSetHasScrolled(){apbctLocalStorage.isSet("ct_has_scrolled")&&apbctLocalStorage.get("ct_has_scrolled")||(ctSetCookie("ct_has_scrolled","true"),apbctLocalStorage.set("ct_has_scrolled",!0))}function ctSetMouseMoved(){apbctLocalStorage.isSet("ct_mouse_moved")&&apbctLocalStorage.get("ct_mouse_moved")||(ctSetCookie("ct_mouse_moved","true"),apbctLocalStorage.set("ct_mouse_moved",!0))}function ctPreloadLocalStorage(){ctPublic.data__to_local_storage&&Object.entries(ctPublic.data__to_local_storage).forEach(function(e){var e=_slicedToArray(e,2),t=e[0],e=e[1];apbctLocalStorage.set(t,e)})}function apbct_ready(){ctPreloadLocalStorage();var e=apbctLocalStorage.get("ct_cookies_type"),e=(e&&e===ctPublic.data__cookies_type||(apbctLocalStorage.set("ct_cookies_type",ctPublic.data__cookies_type),apbctLocalStorage.delete("ct_mouse_moved"),apbctLocalStorage.delete("ct_has_scrolled")),[["ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)],["ct_fkp_timestamp","0"],["ct_pointer_data","0"],["ct_timezone",ct_date.getTimezoneOffset()/60*-1],["ct_screen_info",apbctGetScreenInfo()],["apbct_headless",navigator.webdriver]]);if(apbctLocalStorage.set("ct_ps_timestamp",Math.floor((new Date).getTime()/1e3)),apbctLocalStorage.set("ct_fkp_timestamp","0"),apbctLocalStorage.set("ct_pointer_data","0"),apbctLocalStorage.set("ct_timezone",ct_date.getTimezoneOffset()/60*-1),apbctLocalStorage.set("ct_screen_info",apbctGetScreenInfo()),apbctLocalStorage.set("apbct_headless",navigator.webdriver),"native"!==ctPublic.data__cookies_type)e.push(["apbct_visible_fields","0"]);else{var t=document.cookie.split(";");if(0!==t.length)for(var o=0;o<t.length;o++){var n=t[o].trim().split("=")[0];0===n.indexOf("apbct_visible_fields_")&&ctDeleteCookie(n)}}+ctPublic.pixel__setting&&(+ctPublic.pixel__enabled?ctGetPixelUrl():e.push(["apbct_pixel_url",ctPublic.pixel__url])),+ctPublic.data__email_check_before_post&&(e.push(["ct_checked_emails","0"]),apbct("input[type = 'email'], #email").on("blur",checkEmail)),apbctLocalStorage.isSet("ct_checkjs")?e.push(["ct_checkjs",apbctLocalStorage.get("ct_checkjs")]):e.push(["ct_checkjs",0]),ctSetCookie(e),setTimeout(function(){ctNoCookieAttachHiddenFieldsToForms();for(var e=0;e<document.forms.length;e++){var t,o,n=document.forms[e];0==+ctPublic.data__visible_fields_required||"get"===n.method.toString().toLowerCase()||n.classList.contains("slp_search_form")||n.parentElement.classList.contains("mec-booking")||-1!==n.action.toString().indexOf("activehosted.com")||n.id&&"caspioform"===n.id||n.classList&&n.classList.contains("tinkoffPayRow")||n.classList&&n.classList.contains("give-form")||n.id&&"ult-forgot-password-form"===n.id||n.id&&-1!==n.id.toString().indexOf("calculatedfields")||n.id&&-1!==n.id.toString().indexOf("sac-form")||n.id&&-1!==n.id.toString().indexOf("cp_tslotsbooking_pform")||n.name&&-1!==n.name.toString().indexOf("cp_tslotsbooking_pform")||"https://epayment.epymtservice.com/epay.jhtml"===n.action.toString()||n.name&&-1!==n.name.toString().indexOf("tribe-bar-form")||((t=document.createElement("input")).setAttribute("type","hidden"),t.setAttribute("id","apbct_visible_fields_"+e),t.setAttribute("name","apbct_visible_fields"),(o={})[0]=apbct_collect_visible_fields(n),t.value=JSON.stringify(o),n.append(t),n.onsubmit_prev=n.onsubmit,n.ctFormIndex=e,n.onsubmit=function(e){var t;"native"!==ctPublic.data__cookies_type&&void 0!==e.target.ctFormIndex&&((t={})[0]=apbct_collect_visible_fields(this),apbct_visible_fields_set_cookie(t,e.target.ctFormIndex)),e.target.onsubmit_prev instanceof Function&&setTimeout(function(){e.target.onsubmit_prev.call(e.target,e)},500)})}},1e3);var i=document.querySelectorAll("[data-original-string]");if(i.length)for(var a=0;a<i.length;++a)i[a].parentElement.href||i[a].parentElement.parentElement.href||i[a].addEventListener("click",ctFillDecodedEmailHandler)}function ctFillDecodedEmailHandler(e){this.removeEventListener("click",ctFillDecodedEmailHandler),apbctAjaxEmailDecode(e,this)}function apbctAjaxEmailDecode(n,i){var a=n.target,e={event_javascript_data:getJavascriptClientData(),post_url:document.location.href,referrer:document.referrer},t=(void 0!==i.href&&0===i.href.indexOf("mailto:")&&n.preventDefault(),a.setAttribute("title",ctPublicFunctions.text__wait_for_decoding),a.style.cursor="progress",document.createElement("div")),o=(t.setAttribute("class","apbct-tooltip"),document.createElement("div")),r=(o.setAttribute("class","apbct-tooltip--text"),document.createElement("div")),o=(r.setAttribute("class","apbct-tooltip--arrow"),apbct(a).append(t),apbct(t).append(o),apbct(t).append(r),ctShowDecodeComment(a,ctPublicFunctions.text__wait_for_decoding),n.target.dataset.originalString);void 0!==i.href&&0===i.href.indexOf("mailto:")&&(o=i.dataset.originalString),e.encodedEmail=o,"rest"===ctPublicFunctions.data__ajax_type?apbct_public_sendREST("apbct_decode_email",{data:e,method:"POST",callback:function(e){var t,o;e.success&&(void 0!==i.href&&0===i.href.indexOf("mailto:")?(a.style.cursor="default",a.getElementsByClassName("apbct-tooltip")[0].style.display="none",t=i.href.replace("mailto:",""),o=i.innerHTML,i.innerHTML=o.replace(t,e.data.decoded_email),i.href="mailto:"+e.data.decoded_email,i.click()):setTimeout(function(){ctProcessDecodedDataResult(e.data,n.target)},3e3)),setTimeout(function(){apbct(a.getElementsByClassName("apbct-tooltip")).fadeOut(700)},4e3)},onErrorCallback:function(e){a.addEventListener("click",ctFillDecodedEmailHandler),a.removeAttribute("style"),ctShowDecodeComment(a,"Error occurred: "+e)}}):(e.action="apbct_decode_email",apbct_public_sendAJAX(e,{notJson:!0,callback:function(e){var t,o;e.success&&(void 0!==i.href&&0===i.href.indexOf("mailto:")?(t=i.href.replace("mailto:",""),o=i.innerHTML,i.innerHTML=o.replace(t,e.data.decoded_email),i.href="mailto:"+e.data.decoded_email,i.click()):setTimeout(function(){ctProcessDecodedDataResult(e.data,n.target)},3e3)),setTimeout(function(){apbct(a.getElementsByClassName("apbct-tooltip")).fadeOut(700)},4e3)},onErrorCallback:function(e){a.addEventListener("click",ctFillDecodedEmailHandler),a.removeAttribute("style"),ctShowDecodeComment(a,"Error occurred: "+e)}}))}function getJavascriptClientData(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],t={},o=(t.apbct_headless=!!ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_headless"),t.apbct_pixel_url=ctGetCookie(ctPublicFunctions.cookiePrefix+"apbct_pixel_url"),t.ct_checked_emails=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checked_emails"),t.ct_checkjs=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_checkjs"),t.ct_fkp_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_fkp_timestamp"),t.ct_pointer_data=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_pointer_data"),t.ct_ps_timestamp=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_ps_timestamp"),t.ct_screen_info=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_screen_info"),t.ct_timezone=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_timezone"),apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_mouse_moved")),n=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),i=apbctLocalStorage.get(ctPublicFunctions.cookiePrefix+"ct_cookies_type"),a=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_mouse_moved"),r=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_has_scrolled"),c=ctGetCookie(ctPublicFunctions.cookiePrefix+"ct_cookies_type");if(t.ct_mouse_moved=void 0!==o?o:a,t.ct_has_scrolled=void 0!==n?n:r,t.ct_cookies_type=void 0!==i?i:c,"object"===_typeof(e)&&e!==[])for(var l=0;l<e.length;++l)"object"===_typeof(e[l][1])?t[e[l][1][0]]=e[l][1][1]:t[e[l][0]]=e[l][1];else console.log("APBCT JS ERROR: Collecting data type mismatch");return t=removeDoubleJsonEncoding(t),JSON.stringify(t)}function removeDoubleJsonEncoding(e){if("object"===_typeof(e))for(var t in e){var o;"object"===_typeof(e[t])&&(e[t]=removeDoubleJsonEncoding(e[t])),"string"!=typeof e[t]||null===e[t].match(/^[\[{].*?[\]}]$/)||"object"===_typeof(o=JSON.parse(e[t]))&&(e[t]=o)}return e}function ctProcessDecodedDataResult(e,t){t.setAttribute("title",""),t.removeAttribute("style"),e.is_allowed&&ctFillDecodedEmail(t,e.decoded_email),e.show_comment&&ctShowDecodeComment(t,e.comment)}function ctFillDecodedEmail(e,t){apbct(e).html(apbct(e).html().replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/,t+"$1"))}function ctShowDecodeComment(e,t){t&&(apbct(e.getElementsByClassName("apbct-tooltip")).fadeIn(300),apbct(e.getElementsByClassName("apbct-tooltip--text")).html(t),setTimeout(function(){apbct(e.getElementsByClassName("apbct-tooltip")).fadeOut(700)},5e3))}function apbct_collect_visible_fields(e){var t,o=[],n="",i=0,a="",r=0,c=[];for(t in e.elements)isNaN(+t)||(o[t]=e.elements[t]);return(o=o.filter(function(e){return-1===c.indexOf(e.getAttribute("name"))&&(-1===["radio","checkbox"].indexOf(e.getAttribute("type"))||(c.push(e.getAttribute("name")),!1))})).forEach(function(e,t,o){"submit"!==e.getAttribute("type")&&null!==e.getAttribute("name")&&"ct_checkjs"!==e.getAttribute("name")&&("none"!==getComputedStyle(e).display&&"hidden"!==getComputedStyle(e).visibility&&"0"!==getComputedStyle(e).opacity&&"hidden"!==e.getAttribute("type")||e.classList.contains("wp-editor-area")?(n+=" "+e.getAttribute("name"),i++):(a+=" "+e.getAttribute("name"),r++))}),a=a.trim(),{visible_fields:n=n.trim(),visible_fields_count:i,invisible_fields:a,invisible_fields_count:r}}function apbct_visible_fields_set_cookie(e,t){var o="object"===_typeof(e)&&null!==e?e:{};if("native"===ctPublic.data__cookies_type)for(var n in o){if(10<n)return;ctSetCookie("apbct_visible_fields_"+(void 0!==t?t:n),JSON.stringify(o[n]))}else"none"===ctPublic.data__cookies_type?ctSetCookie("apbct_visible_fields",JSON.stringify(o[0])):ctSetCookie("apbct_visible_fields",JSON.stringify(o))}function apbct_js_keys__set_input_value(e,t,o,n){if(0<document.querySelectorAll("[name^=ct_checkjs]").length)for(var i=document.querySelectorAll("[name^=ct_checkjs]"),a=0;a<i.length;a++)i[a].value=e.js_key}function apbctGetScreenInfo(){return JSON.stringify({fullWidth:document.documentElement.scrollWidth,fullHeight:Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),visibleWidth:document.documentElement.clientWidth,visibleHeight:document.documentElement.clientHeight})}function ctParseBlockMessage(e){void 0!==e.apbct&&(e=e.apbct).blocked&&(document.dispatchEvent(new CustomEvent("apbctAjaxBockAlert",{bubbles:!0,detail:{message:e.comment}})),cleantalkModal.loaded=e.comment,cleantalkModal.open(),1==+e.stop_script&&window.stop())}function ctSetPixelUrlLocalstorage(e){ctSetCookie("apbct_pixel_url",e)}function ctNoCookieConstructHiddenField(){var e="",t=apbctLocalStorage.getCleanTalkData(),t=JSON.stringify(t);return t=btoa(t),(e=document.createElement("input")).setAttribute("id","ct_no_cookie_hidden_field"),e.setAttribute("name","ct_no_cookie_hidden_field"),e.setAttribute("value",t),e.setAttribute("type","hidden"),e}function ctNoCookieGetForms(){var e=document.forms;return e||!1}function ctNoCookieAttachHiddenFieldsToForms(){if("none"===ctPublic.data__cookies_type){var e=ctNoCookieGetForms();if(e)for(var t=0;t<e.length;t++)if(null===document.forms[t].getAttribute("method")||"post"===document.forms[t].getAttribute("method").toLowerCase()){var o=document.getElementsByName("ct_no_cookie_hidden_field");if(o)for(var n=0;n<o.length;n++)o[n].parentNode.removeChild(o[n]);document.forms[t].append(ctNoCookieConstructHiddenField())}}}apbct_attach_event_handler(window,"mousemove",ctFunctionMouseMove),apbct_attach_event_handler(window,"mousedown",ctFunctionFirstKey),apbct_attach_event_handler(window,"keydown",ctFunctionFirstKey),apbct_attach_event_handler(window,"scroll",ctSetHasScrolled),apbct_attach_event_handler(window,"DOMContentLoaded",apbct_ready),"undefined"!=typeof jQuery&&jQuery(document).ajaxComplete(function(e,t,o){if(t.responseText&&-1!==t.responseText.indexOf('"apbct')){try{var n=JSON.parse(t.responseText)}catch(e){return void console.log(e.toString())}ctParseBlockMessage(n)}});var cleantalkModal={loaded:!1,loading:!1,opened:!1,opening:!1,load:function(e){this.loaded||(this.loading=!0,callback=function(e,t,o,n){cleantalkModal.loading=!1,cleantalkModal.loaded=e,document.dispatchEvent(new CustomEvent("cleantalkModalContentLoaded",{bubbles:!0}))},("function"==typeof apbct_admin_sendAJAX?apbct_admin_sendAJAX:apbct_public_sendAJAX)({action:e},{callback:callback,notJson:!0}))},open:function(){function e(){var e="";for(key in this.styles)e+=key+":"+this.styles[key]+";";return e}var t={styles:{"z-index":"9999",position:"fixed",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0,0,0,0.5)",display:"flex","justify-content":"center","align-items":"center"},toString:e},o={styles:{position:"relative",padding:"30px",background:"#FFF",border:"1px solid rgba(0,0,0,0.75)","border-radius":"4px","box-shadow":"7px 7px 5px 0px rgba(50,50,50,0.75)"},toString:e},n={styles:{position:"absolute",background:"#FFF",width:"20px",height:"20px",border:"2px solid rgba(0,0,0,0.75)","border-radius":"15px",cursor:"pointer",top:"-8px",right:"-8px","box-sizing":"content-box"},toString:e},i={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(45deg)"},toString:e},a={styles:{content:'""',display:"block",position:"absolute",background:"#000","border-radius":"1px",width:"2px",height:"16px",top:"2px",left:"9px",transform:"rotate(-45deg)"},toString:e},r={styles:{overflow:"hidden"},toString:e},c=document.createElement("style"),r=(c.setAttribute("id","cleantalk-modal-styles"),c.innerHTML="body.cleantalk-modal-opened{"+r+"}",c.innerHTML+="#cleantalk-modal-overlay{"+t+"}",c.innerHTML+="#cleantalk-modal-close{"+n+"}",c.innerHTML+="#cleantalk-modal-close:before{"+i+"}",c.innerHTML+="#cleantalk-modal-close:after{"+a+"}",document.body.append(c),document.createElement("div")),t=(r.setAttribute("id","cleantalk-modal-overlay"),document.body.append(r),document.body.classList.add("cleantalk-modal-opened"),document.createElement("div")),n=(t.setAttribute("id","cleantalk-modal-inner"),t.setAttribute("style",o),r.append(t),document.createElement("div")),i=(n.setAttribute("id","cleantalk-modal-close"),t.append(n),document.createElement("div"));this.loaded?i.innerHTML=this.loaded:(i.innerHTML="Loading...",this.load("get_options_template")),i.setAttribute("id","cleantalk-modal-content"),t.append(i),this.opened=!0},close:function(){document.body.classList.remove("cleantalk-modal-opened"),document.getElementById("cleantalk-modal-overlay").remove(),document.getElementById("cleantalk-modal-styles").remove(),document.dispatchEvent(new CustomEvent("cleantalkModalClosed",{bubbles:!0}))}},buttons_to_handle=(document.addEventListener("click",function(e){(e.target&&"cleantalk-modal-overlay"===e.target.id||"cleantalk-modal-close"===e.target.id)&&cleantalkModal.close()}),document.addEventListener("cleantalkModalContentLoaded",function(e){cleantalkModal.opened&&cleantalkModal.loaded&&(document.getElementById("cleantalk-modal-content").innerHTML=cleantalkModal.loaded)}),[]),gdpr_notice_for_button="Please, apply the GDPR agreement.";function apbct_gdpr_handle_buttons(){try{buttons_to_handle!==[]&&buttons_to_handle.forEach(function(e){var t='[id="apbct_gdpr_'+e.index+'"]',t=jQuery(t);jQuery(t).prop("checked")?(e.button.disabled=!1,jQuery(e.button).prop("title",e.old_notice)):(e.button.disabled=!0,jQuery(e.button).prop("title",gdpr_notice_for_button))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not handle form buttons "+e)}}function ct_protect_external(){for(var e=0;e<document.forms.length;e++)if(void 0===document.forms[e].cleantalk_hidden_action&&void 0===document.forms[e].cleantalk_hidden_method){var t,o=document.forms[e];if(o.parentElement&&0<o.parentElement.classList.length&&-1!==o.parentElement.classList[0].indexOf("mewtwo"))return;"string"==typeof o.action&&(isIntegratedForm(o)?apbctProcessExternalForm(o,e,document):-1===o.action.indexOf("http://")&&-1===o.action.indexOf("https://")||o.action.split("//")[1].split("/")[0].toLowerCase()!==location.hostname.toLowerCase()&&((t=document.createElement("input")).name="cleantalk_hidden_action",t.value=o.action,t.type="hidden",o.appendChild(t),(t=document.createElement("input")).name="cleantalk_hidden_method",t.value=o.method,t.type="hidden",o.method="POST",o.appendChild(t),o.action=document.location))}var n=document.getElementsByTagName("iframe");if(0<n.length)for(var i=0;i<n.length;i++)if(null!=n[i].contentDocument){var a=n[i].contentDocument.forms;if(0===a.length)return;for(var r=0;r<a.length;r++)apbctProcessExternalForm(a[r],r,n[i].contentDocument)}}function apbctProcessExternalForm(e,t,o){var n=document.createElement("i"),n=(n.className="cleantalk_placeholder",n.style="display: none",e.parentElement.insertBefore(n,e),e.previousSibling),i=e.outerHTML,a=e,e=(e.parentElement.removeChild(e),document.createElement("div")),i=(e.innerHTML=i,n.after(e.firstElementChild),document.createElement("input")),r=(i.name="action",i.value="cleantalk_force_ajax_check",i.type="hidden",o.forms[t]),c=(r.appendChild(i),r.apbctPrev=n,r.apbctFormOriginal=a,!1);void 0!==r.classList&&["newsletterform","ml-block-form"].forEach(function(e){r.classList.contains(e)&&(c=e)}),c?void 0!==(e=jQuery("form."+c).find('button[type="submit"]'))&&e.click(function(e){e.preventDefault(),sendAjaxCheckingFormData(e.currentTarget)}):o.forms[t].onsubmit=function(e){e.preventDefault();jQuery(e.currentTarget).prev(),jQuery(e.currentTarget).clone();sendAjaxCheckingFormData(e.currentTarget)}}function apbct_replace_inputs_values_from_other_form(e,t){var e=jQuery(e).find("button, input, textarea, select"),o=jQuery(t).find("button, input, textarea, select");e.each(function(e,n){var i=jQuery(n);o.each(function(e,t){var o=jQuery(t);n.outerHTML===t.outerHTML&&o.val(i.val())})})}function isIntegratedForm(e){var t=e.action,o=e.id;return!!(-1!==t.indexOf("activehosted.com")||-1!==t.indexOf("app.convertkit.com")||void 0!==e.firstChild.classList&&e.firstChild.classList.contains("cb-form-group")||-1!==t.indexOf("mailerlite.com")||-1!==t.indexOf("colcolmail.co.uk")||-1!==t.indexOf("paypal.com")||-1!==t.indexOf("infusionsoft.com")||-1!==t.indexOf("webto.salesforce.com")||-1!==t.indexOf("secure2.convio.net")||-1!==t.indexOf("hookb.in")||-1!==t.indexOf("external.url")||-1!==t.indexOf("tp.media")||-1!==t.indexOf("flodesk.com")||-1!==t.indexOf("sendfox.com")||-1!==t.indexOf("aweber.com")||-1!==t.indexOf("secure.payu.com")||-1!==t.indexOf("mautic")||-1!==o.indexOf("mauticform_"))}function sendAjaxCheckingFormData(c,e,t){var o={},n=(o[0]=apbct_collect_visible_fields(c),apbct_visible_fields_set_cookie(o),{}),o=c.elements;(o=Array.prototype.slice.call(o)).forEach(function(e,t){""===e.name?n["input_"+t]=e.value:n[e.name]=e.value}),apbct_public_sendAJAX(n,{async:!1,callback:function(e,t,o,n){if(void 0===e.apbct||!+e.apbct.blocked){var i=jQuery(c).detach(),a=c.apbctPrev,r=c.apbctFormOriginal,i=(apbct_replace_inputs_values_from_other_form(i,r),a.after(r),jQuery(r).find('input[name="apbct_visible_fields"]').remove(),jQuery(r).find('input[value="cleantalk_force_ajax_check"]').remove(),jQuery(r).find("button[type=submit]"));if(0!==i.length)return void i[0].click();if(0!==(i=jQuery(r).find("input[type=submit]")).length)return void i[0].click();if(0!==(i=jQuery(r).find('button[data-element="submit"]')).length)return void i[0].click();0!==(i=jQuery(r).find('input[type="image"][name="submit"]')).length&&i[0].click()}void 0!==e.apbct&&+e.apbct.blocked&&ctParseBlockMessage(e)}})}function ct_check_internal(t){var e,o={},n=t.elements;for(e in n)"submit"!=n[e].type&&null!=n[e].value&&""!=n[e].value&&(o[n[e].name]=t.elements[e].value);o.action="ct_check_internal",apbct_public_sendAJAX(o,{url:ctPublicFunctions._ajax_url,callback:function(e){if(!0!==e.success)return alert(e.data),!1;t.submit()}})}function ct_check_internal__is_exclude_form(t){return["wp-login.php","wp-comments-post.php"].some(function(e){return null!==t.match(new RegExp(ctPublic.blog_home+".*"+e))})}document.addEventListener("DOMContentLoaded",function(){if(buttons_to_handle=[],"undefined"!=typeof ctPublicGDPR&&ctPublicGDPR.gdpr_forms.length&&"undefined"!=typeof jQuery)try{ctPublicGDPR.gdpr_forms.forEach(function(e,t){var o=jQuery("#"+e+", ."+e),e=(o.is("form")||(o.find("form")[0]?o=o.children("form").first():jQuery(".wpcf7[role=form]")[0]&&-1!==jQuery(".wpcf7[role=form]").attr("id").indexOf("wpcf7-f"+e)?o=jQuery(".wpcf7[role=form]").children("form"):jQuery(".frm_forms")[0]&&-1!==jQuery(".frm_forms").first().attr("id").indexOf("frm_form_"+e)?o=jQuery(".frm_forms").first().children("form"):jQuery(".wpforms-form")[0]&&-1!==jQuery(".wpforms-form").first().attr("id").indexOf("wpforms-form-"+e)&&(o=jQuery(".wpforms-form"))),!1),n=o.find('input[type|="submit"]');n.length&&(!1!==(e=n[0])&&(e.disabled=!0,n=jQuery(e).prop("title")?jQuery(e).prop("title"):"",buttons_to_handle.push({index:t,button:e,old_notice:n}),jQuery(e).prop("title",gdpr_notice_for_button)),!o.is("form")&&"form"!==o.attr("role")||o.append('<input id="apbct_gdpr_'+t+'" type="checkbox" required="required" style=" margin-right: 10px;" onchange="apbct_gdpr_handle_buttons()">').append('<label style="display: inline;" for="apbct_gdpr_'+t+'">'+ctPublicGDPR.gdpr_text+"</label>"))})}catch(e){console.info("APBCT GDPR JS ERROR: Can not add GDPR notice"+e)}}),window.onload=function(){+ctPublic.settings__forms__check_external&&"undefined"!=typeof jQuery&&setTimeout(function(){ct_protect_external()},1500)},document.addEventListener("DOMContentLoaded",function(){var e,t="";if(+ctPublic.settings__forms__check_internal)for(var o=0;o<document.forms.length;o++)"string"!=typeof document.forms[o].action||null===(t=(e=document.forms[o]).action).indexOf("https?://")||null===t.match(ctPublic.blog_home+".*?.php")||ct_check_internal__is_exclude_form(t)||(e.click,"undefined"!=typeof jQuery&&(jQuery(e).off("**"),jQuery(e).off(),jQuery(e).on("submit",function(e){return ct_check_internal(e.target),!1})))});
|
js/apbct-public-bundle.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"apbct-public-bundle.min.js","sources":["apbct-public-bundle.js"],"sourcesContent":["class ApbctCore{\n\n ajax_parameters = {};\n rest_parameters = {};\n\n #selector = null;\n elements = [];\n\n // Event properties\n #eventCallback;\n #eventSelector;\n #event;\n\n /**\n * Default constructor\n */\n constructor(selector){\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param selector\n * @returns {*}\n */\n select(selector) {\n\n if(selector instanceof HTMLCollection){\n this.#selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n }else if( typeof selector === 'object' ){\n this.#selector = null;\n this.elements = [];\n this.elements[0] = selector;\n }else if( typeof selector === 'string' ){\n this.#selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n }else{\n this.#deselect();\n }\n\n return this;\n }\n\n #addElement(elemToAdd){\n if( typeof elemToAdd === 'object' ){\n this.elements.push(elemToAdd);\n }else if( typeof elemToAdd === 'string' ){\n this.#selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n }else{\n this.#deselect();\n }\n }\n\n #push(elem){\n this.elements.push(elem);\n }\n\n #reduce(){\n this.elements = this.elements.slice(0,-1);\n }\n\n #deselect(){\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param style\n * @param getRaw\n *\n * @returns {boolean|*}\n */\n css(style, getRaw){\n\n getRaw = getRaw | false;\n\n // Set style\n if(typeof style === \"object\"){\n\n const stringToCamelCase = str =>\n str.replace(/([-_][a-z])/g, group =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', '')\n );\n\n // Apply multiple styles\n for(let style_name in style){\n let DOM_style_name = stringToCamelCase(style_name);\n\n // Apply to multiple elements (currently selected)\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].style[DOM_style_name] = style[style_name];\n }\n }\n\n return this;\n }\n\n // Get style of first currently selected element\n if(typeof style === 'string'){\n\n let computedStyle = getComputedStyle(this.elements[0])[style];\n\n console.log(computedStyle);\n\n // Process\n if( typeof computedStyle !== 'undefined' && ! getRaw){\n computedStyle = computedStyle.replace(/(\\d)(em|pt|%|px){1,2}$/, '$1'); // Cut of units\n computedStyle = Number(computedStyle) == computedStyle ? Number(computedStyle) : computedStyle; // Cast to INT\n return computedStyle;\n }\n\n // Return unprocessed\n return computedStyle;\n }\n }\n\n hide(){\n this.prop('prev-display', this.css('display'));\n this.css({'display': 'none'});\n }\n\n show(){\n this.css({'display': this.prop('prev-display')});\n }\n\n addClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.add(className);\n }\n }\n\n removeClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.remove(className);\n }\n }\n\n toggleClass(className){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.toggle(className);\n }\n }\n\n /**\n * Wrapper for apbctAJAX class\n *\n * @param ajax_parameters\n * @returns {ApbctAjax}\n */\n ajax(ajax_parameters){\n this.ajax_parameters = ajax_parameters;\n return new ApbctAjax(ajax_parameters);\n }\n\n /**\n * Wrapper for apbctREST class\n *\n * @param rest_parameters\n * @returns {ApbctRest}\n */\n rest(rest_parameters){\n this.rest_parameters = rest_parameters;\n return new ApbctRest(rest_parameters);\n }\n\n /************** EVENTS **************/\n\n /**\n *\n * Why the mess with arguments?\n *\n * Because we need to support the following function signatures:\n * on('click', function(){ alert('some'); });\n * on('click', 'inner_selector', function(){ alert('some'); });\n *\n * @param args\n */\n on(...args){\n\n this.#event = args[0];\n this.#eventCallback = args[2] || args[1];\n this.#eventSelector = typeof args[1] === \"string\" ? args[1] : null;\n\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].addEventListener(\n this.#event,\n this.#eventSelector !== null\n ? this.#onChecker.bind(this)\n : this.#eventCallback\n );\n }\n }\n\n /**\n * Check if a selector of an event matches current target\n *\n * @param event\n * @returns {*}\n */\n #onChecker(event){\n if(event.target === document.querySelector(this.#eventSelector)){\n event.stopPropagation();\n return this.#eventCallback(event);\n }\n }\n\n ready(callback){\n document.addEventListener('DOMContentLoaded', callback);\n }\n\n change(callback){\n this.on('change', callback);\n }\n\n /************** ATTRIBUTES **************/\n\n /**\n * Get an attribute or property of an element\n *\n * @param attrName\n * @returns {*|*[]}\n */\n attr(attrName){\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n\n // Use property instead of attribute if possible\n if(typeof this.elements[i][attrName] !== undefined){\n outputValue.push(this.elements[i][attrName]);\n }else{\n outputValue.push(this.elements[i].getAttribute(attrName));\n }\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n\n prop(propName, value){\n\n // Setting values\n if(typeof value !== \"undefined\"){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i][propName] = value;\n }\n\n return this;\n\n // Getting values\n }else{\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n outputValue.push(this.elements[i][propName]);\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n }\n\n /**\n * Set or get inner HTML\n *\n * @param value\n * @returns {*|*[]}\n */\n html(value){\n return typeof value !== 'undefined'\n ? this.prop('innerHTML', value)\n : this.prop('innerHTML');\n }\n\n /**\n * Set or get value of input tags\n *\n * @param value\n * @returns {*|*[]|undefined}\n */\n val(value){\n return typeof value !== 'undefined'\n ? this.prop('value', value)\n : this.prop('value');\n }\n\n data(name, value){\n return typeof value !== 'undefined'\n ? this.prop('apbct-data', name, value)\n : this.prop('apbct-data');\n }\n\n /************** END OF ATTRIBUTES **************/\n\n /************** FILTERS **************/\n\n /**\n * Check if the current elements are corresponding to filter\n *\n * @param filter\n * @returns {boolean}\n */\n is(filter){\n\n let outputValue = false;\n\n for(let elem of this.elements){\n outputValue ||= this.#isElem(elem, filter);\n }\n\n return outputValue;\n }\n\n #isElem(elemToCheck, filter){\n\n let is = false;\n let isRegisteredTagName = function(name){\n let newlyCreatedElement = document.createElement(name).constructor;\n return ! Boolean( ~[HTMLElement, HTMLUnknownElement].indexOf(newlyCreatedElement) );\n };\n\n // Check for filter function\n if(typeof filter === 'function') {\n is ||= filter.call(this, elemToCheck);\n }\n\n // Check for filter function\n if(typeof filter === 'string') {\n\n // Filter is tag name\n if( filter.match(/^[a-z]/) && isRegisteredTagName(filter) ){\n is ||= elemToCheck.tagName.toLowerCase() === filter.toLowerCase();\n\n // Filter is property\n }else if( filter.match(/^[a-z]/) ){\n is ||= Boolean(elemToCheck[filter]);\n\n // Filter is CSS selector\n }else {\n is ||= this.#selector !== null\n ? document.querySelector(this.#selector + filter) !== null // If possible\n : this.#isWithoutSelector(elemToCheck, filter); // Search through all elems with such selector\n }\n }\n\n return is;\n }\n\n #isWithoutSelector(elemToCheck, filter){\n\n let elems = document.querySelectorAll(filter);\n let outputValue = false;\n\n for(let elem of elems){\n outputValue ||= elemToCheck === elem;\n }\n\n return outputValue;\n }\n\n filter(filter){\n\n this.#selector = null;\n\n for( let i = this.elements.length - 1; i >= 0; i-- ){\n if( ! this.#isElem(this.elements[i], filter) ){\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /************** NODES **************/\n\n parent(filter){\n\n this.select(this.elements[0].parentElement);\n\n if( typeof filter !== 'undefined' && ! this.is(filter) ){\n this.#deselect();\n }\n\n return this;\n }\n\n parents(filter){\n\n this.select(this.elements[0]);\n\n for ( ; this.elements[ this.elements.length - 1].parentElement !== null ; ) {\n this.#push(this.elements[ this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0,1); // Deleting initial element from the set\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n children(filter){\n\n this.select(this.elements[0].children);\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n siblings(filter){\n\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /************** DOM MANIPULATIONS **************/\n remove(){\n for(let elem of this.elements){\n elem.remove();\n }\n }\n\n after(content){\n for(let elem of this.elements){\n elem.after(content);\n }\n }\n\n append(content){\n for(let elem of this.elements){\n elem.append(content);\n }\n }\n\n /** ANIMATION **/\n fadeIn(time) {\n for(let elem of this.elements){\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n fadeOut(time) {\n for(let elem of this.elements){\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * Enter point to ApbctCore class\n *\n * @param params\n * @returns {*}\n */\nfunction apbct(params){\n return new ApbctCore()\n .select(params);\n}\nclass ApbctXhr{\n\n #xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n #methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n #body = null;\n #http_code = 0;\n #status_text = '';\n\n constructor(parameters){\n\n console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n\n // Set class properties\n for( let key in parameters ){\n if( typeof this[key] !== 'undefined' ){\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.#prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if( ! this.url ){\n console.log('%cXHR%c not URL provided', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;')\n return false;\n }\n\n // Configure the request\n this.#xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.#xhr.responseType = this.responseType;\n this.#xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.#xhr.onreadystatechange = function(){\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.#xhr.onload = function(){\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.#xhr.onprogress = function(event){\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.#xhr.onerror = function(){\n this.onError();\n }.bind(this);\n\n this.#xhr.ontimeout = function(){\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.#xhr.send(this.#body);\n }\n\n #prepare(){\n\n // Disable button\n if(this.button){\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n #complete(){\n\n this.#http_code = this.#xhr.status;\n this.#status_text = this.#xhr.statusText;\n\n // Disable button\n if(this.button){\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n onReadyStateChange(){\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function'){\n this.on_ready_state_change();\n }\n }\n\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function'){\n this.on_progress();\n }\n }\n\n onError(){\n\n console.log('error');\n\n this.#complete();\n this.#error(\n this.#http_code,\n this.#status_text\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback(this.#status_text);\n }\n }\n\n onTimeout(){\n this.#complete();\n this.#error(\n 0,\n 'timeout'\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback('Timeout');\n }\n }\n\n onLoad(){\n\n this.#complete();\n\n if (this.responseType === 'json' ){\n if(this.#xhr.response === null){\n this.#error(this.#http_code, this.#status_text, 'No response');\n return false;\n }else if( typeof this.#xhr.response.error !== 'undefined') {\n this.#error(this.#http_code, this.#status_text, this.#xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.#xhr.response, this.data);\n }\n }\n\n #error(http_code, status_text, additional_msg){\n\n let error_string = '';\n\n if( status_text === 'timeout' ){\n error_string += 'Server response timeout'\n\n }else if( http_code === 200 ){\n\n if( status_text === 'parsererror' ){\n error_string += 'Unexpected response from server. See console for details.';\n }else {\n error_string += 'Unexpected error. Status: ' + status_text + '.';\n if( typeof additional_msg !== 'undefined' )\n error_string += ' Additional error info: ' + additional_msg;\n }\n\n }else if(http_code === 500){\n error_string += 'Internal server error.';\n\n }else {\n error_string += 'Unexpected response code:' + http_code;\n }\n\n this.errorOutput( error_string );\n }\n\n errorOutput(error_msg){\n console.log( '%c ctXHR error: %c' + error_msg, 'color: red;', 'color: grey;' );\n }\n\n setHeaders(){\n // Set headers if passed\n for( let header_name in this.headers ){\n if( typeof this.headers[header_name] !== 'undefined' ){\n this.#xhr.setRequestHeader(header_name, this.headers[header_name]);\n }\n }\n }\n\n convertData()\n {\n // GET, HEAD request-type\n if( ~this.#methods_to_convert_data_to_URL.indexOf( this.method ) ){\n return this.convertDataToURL();\n\n // POST request-type\n }else{\n return this.convertDataToBody()\n }\n }\n\n convertDataToURL(){\n let params_appendix = new URLSearchParams(this.data).toString();\n let params_prefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += params_prefix + params_appendix;\n\n return this.url;\n }\n\n /**\n *\n * @returns {null}\n */\n convertDataToBody()\n {\n this.#body = new FormData();\n\n for (let dataKey in this.data) {\n this.#body.append(\n dataKey,\n typeof this.data[dataKey] === 'object'\n ? JSON.stringify(this.data[dataKey])\n : this.data[dataKey]\n );\n }\n\n return this.#body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\n deleteDoubleJSONEncoding(object){\n\n if( typeof object === 'object'){\n\n for (let objectKey in object) {\n\n // Recursion\n if( typeof object[objectKey] === 'object'){\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if(\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ){\n let parsedValue = JSON.parse(object[objectKey]);\n if( typeof parsedValue === 'object' ){\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n }\n}\nclass ApbctAjax extends ApbctXhr{\n\n constructor(...args) {\n super(args[0]);\n }\n}\nclass ApbctRest extends ApbctXhr{\n\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n constructor(...args) {\n args = args[0];\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n \"X-WP-Nonce\": ctPublicFunctions._rest_nonce\n };\n super(args);\n }\n}\n\nfunction ctSetCookie( cookies, value, expires ){\n\n if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n var skip_alt = cookies === 'ct_pointer_data';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n cookies.forEach( function (item, i, arr\t) {\n apbctLocalStorage.set(item[0], encodeURIComponent(item[1]))\n });\n ctNoCookieAttachHiddenFieldsToForms()\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n cookies.forEach( function (item, i, arr\t) {\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix + item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ){\n\n if (typeof (getJavascriptClientData) === \"function\"){\n //reprocess already gained cookies data\n cookies = getJavascriptClientData(cookies);\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded')\n }\n\n try {\n JSON.parse(cookies)\n } catch (e){\n console.log('APBCT ERROR: JSON parse error:' + e)\n return\n }\n\n // Using REST API handler\n if( ctPublicFunctions.data__ajax_type === 'rest' ){\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: { cookies: cookies }\n }\n );\n\n // Using AJAX request and handler\n } else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n }\n );\n }\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n return;\n\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + \"=\\\"\\\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax\" + ctSecure;\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' ){\n // @ToDo implement this logic\n }\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n // Default params\n let _params = [];\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"callback_context\"] = params.callback_context || null;\n _params[\"callback_params\"] = params.callback_params || null;\n _params[\"async\"] = params.async || true;\n _params[\"notJson\"] = params.notJson || null;\n _params[\"timeout\"] = params.timeout || 15000;\n _params[\"obj\"] = obj || null;\n _params[\"button\"] = params.button || null;\n _params[\"progressbar\"] = params.progressbar || null;\n _params[\"silent\"] = params.silent || null;\n _params[\"no_nonce\"] = params.no_nonce || null;\n _params[\"data\"] = data;\n _params[\"url\"] = ctPublicFunctions._ajax_url;\n\n if(typeof (data) === 'string') {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"] = _params[\"data\"] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"] = _params[\"data\"] + '&no_cache=' + Math.random()\n } else {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"]._ajax_nonce = ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n let _params = [];\n _params[\"route\"] = route;\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"data\"] = params.data || [];\n _params[\"method\"] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\napbctLocalStorage = {\n get : function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set : function(key, value, is_json = true) {\n if (is_json){\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive : function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet : function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete : function (key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData : function () {\n let data = {}\n for(let i=0; i<localStorage.length; i++) {\n let key = localStorage.key(i);\n if (key.indexOf('ct_') !==-1 || key.indexOf('apbct_') !==-1){\n data[key.toString()] = apbctLocalStorage.get(key)\n }\n }\n return data\n },\n\n}\nvar ct_date = new Date(),\n\tctTimeMs = new Date().getTime(),\n\tctMouseEventTimerFlag = true, //Reading interval flag\n\tctMouseData = [],\n\tctMouseDataCounter = 0,\n\tctCheckedEmails = {};\n\nfunction apbct_attach_event_handler(elem, event, callback){\n\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\telse elem.attachEvent(event, callback);\n}\n\nfunction apbct_remove_event_handler(elem, event, callback){\n\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\telse elem.detachEvent(event, callback);\n}\n\n//Writing first key press timestamp\nvar ctFunctionFirstKey = function output(event){\n\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\tctKeyStopStopListening();\n};\n\n//Reading interval\nvar ctMouseReadInterval = setInterval(function(){\n\tctMouseEventTimerFlag = true;\n}, 150);\n\n//Writting interval\nvar ctMouseWriteDataInterval = setInterval(function(){\n\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n}, 1200);\n\n//Logging mouse position each 150 ms\nvar ctFunctionMouseMove = function output(event){\n\tctSetMouseMoved();\n\tif(ctMouseEventTimerFlag === true){\n\n\t\tctMouseData.push([\n\t\t\tMath.round(event.clientY),\n\t\t\tMath.round(event.clientX),\n\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t]);\n\n\t\tctMouseDataCounter++;\n\t\tctMouseEventTimerFlag = false;\n\t\tif(ctMouseDataCounter >= 50){\n\t\t\tctMouseStopData();\n\t\t}\n\t}\n};\n\n//Stop mouse observing function\nfunction ctMouseStopData(){\n\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tclearInterval(ctMouseReadInterval);\n\tclearInterval(ctMouseWriteDataInterval);\n}\n\n//Stop key listening function\nfunction ctKeyStopStopListening(){\n\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n}\n\nfunction checkEmail(e) {\n\tvar current_email = e.target.value;\n\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t// Using REST API handler\n\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'check_email_before_post',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t\t// Using AJAX request and handler\n\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\temail : current_email,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction ctSetPixelImg(pixelUrl) {\n\tctSetCookie('apbct_pixel_url', pixelUrl);\n\tif( +ctPublic.pixel__enabled ){\n\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\tlet insertedImg = document.createElement('img');\n\t\t\tinsertedImg.setAttribute('alt', 'CleanTalk Pixel');\n\t\t\tinsertedImg.setAttribute('id', 'apbct_pixel');\n\t\t\tinsertedImg.setAttribute('style', 'display: none; left: 99999px;');\n\t\t\tinsertedImg.setAttribute('src', pixelUrl);\n\t\t\tapbct('body').append(insertedImg);\n\t\t}\n\t}\n}\n\nfunction ctGetPixelUrl() {\n\t// Check if pixel is already in localstorage and is not outdated\n\tlet local_storage_pixel_url = apbctLocalStorage.get('apbct_pixel_url');\n\tif ( local_storage_pixel_url !== false ) {\n\t\tif ( apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n\t\t\tapbctLocalStorage.delete('apbct_pixel_url')\n\t\t} else {\n\t\t\t//if so - load pixel from localstorage and draw it skipping AJAX\n\t\t\tctSetPixelImg(local_storage_pixel_url);\n\t\t\treturn;\n\t\t}\n\t}\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_get_pixel_url',\n\t\t\t{\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\t// Using AJAX request and handler\n\t}else{\n\t\tapbct_public_sendAJAX(\n\t\t\t{\n\t\t\t\taction: 'apbct_get_pixel_url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction ctSetHasScrolled() {\n\tif( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\tapbctLocalStorage.set('ct_has_scrolled', true);\n\t}\n}\n\nfunction ctSetMouseMoved() {\n\tif( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\tapbctLocalStorage.set('ct_mouse_moved', true);\n\t}\n}\n\nfunction ctPreloadLocalStorage(){\n\tif (ctPublic.data__to_local_storage){\n\t\tlet data = Object.entries(ctPublic.data__to_local_storage)\n\t\tdata.forEach(([key, value]) => {\n\t\t\tapbctLocalStorage.set(key,value)\n\t\t});\n\t}\n}\n\napbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\napbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"scroll\", ctSetHasScrolled);\n\n// Ready function\nfunction apbct_ready(){\n\n\tctPreloadLocalStorage()\n\n\tlet cookiesType = apbctLocalStorage.get('ct_cookies_type');\n\tif ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n\t\tapbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n\t\tapbctLocalStorage.delete('ct_mouse_moved');\n\t\tapbctLocalStorage.delete('ct_has_scrolled');\n\t}\n\n\t// Collect scrolling info\n\tvar initCookies = [\n\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t[\"ct_pointer_data\", \"0\"],\n\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t[\"apbct_headless\", navigator.webdriver],\n\t];\n\n\tapbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n\tapbctLocalStorage.set('ct_fkp_timestamp', \"0\");\n\tapbctLocalStorage.set('ct_pointer_data', \"0\");\n\tapbctLocalStorage.set('ct_timezone', ct_date.getTimezoneOffset()/60*(-1) );\n\tapbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n\tapbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n\tif( ctPublic.data__cookies_type !== 'native' ) {\n\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t} else {\n\t\t// Delete all visible fields cookies on load the page\n\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\tif( cookiesArray.length !== 0 ) {\n\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif( +ctPublic.pixel__setting ){\n\t\tif( +ctPublic.pixel__enabled ){\n\t\t\tctGetPixelUrl()\n\t\t} else {\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t}\n\t}\n\n\tif ( +ctPublic.data__email_check_before_post) {\n\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\tapbct(\"input[type = 'email'], #email\").on('blur', checkEmail);\n\t}\n\n\tif (apbctLocalStorage.isSet('ct_checkjs')) {\n\t\tinitCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n\t} else {\n\t\tinitCookies.push(['ct_checkjs', 0]);\n\t}\n\n\tctSetCookie(initCookies);\n\n\tsetTimeout(function(){\n\n\t\tctNoCookieAttachHiddenFieldsToForms()\n\n\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\tvar form = document.forms[i];\n\n\t\t\t//Exclusion for forms\n\t\t\tif (\n\t\t\t\t+ctPublic.data__visible_fields_required === 0 ||\n\t\t\t\tform.method.toString().toLowerCase() === 'get' ||\n\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t(form.id && form.id === 'caspioform') || //Caspio Form\n\t\t\t\t(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t(form.classList && form.classList.contains('give-form')) || // GiveWP\n\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n\t\t\t\t(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n\t\t\t\t(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\t(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\tform.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n\t\t\t\t(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar hiddenInput = document.createElement( 'input' );\n\t\t\thiddenInput.setAttribute( 'type', 'hidden' );\n\t\t\thiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n\t\t\thiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n\t\t\tvar visibleFieldsToInput = {};\n\t\t\tvisibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n\t\t\thiddenInput.value = JSON.stringify(visibleFieldsToInput);\n\t\t\tform.append( hiddenInput );\n\n\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\tform.ctFormIndex = i;\n\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\tif ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tconsole.log(\"visible_fields[0]\" + visible_fields[0])\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t}\n\n\t\t\t\t// Call previous submit action\n\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t}, 1000);\n\n\t// Listen clicks on encoded emails\n\tlet decodedEmailNodes = document.querySelectorAll(\"[data-original-string]\");\n\tif (decodedEmailNodes.length) {\n\t\tfor (let i = 0; i < decodedEmailNodes.length; ++i) {\n\t\t\tif (\n\t\t\t\tdecodedEmailNodes[i].parentElement.href ||\n\t\t\t\tdecodedEmailNodes[i].parentElement.parentElement.href\n\t\t\t) {\n\t\t\t\t// Skip listening click on hyperlinks\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdecodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n\t\t}\n\t}\n}\napbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\nfunction ctFillDecodedEmailHandler(event) {\n\tthis.removeEventListener('click', ctFillDecodedEmailHandler);\n\tapbctAjaxEmailDecode(event, this);\n}\n\nfunction apbctAjaxEmailDecode(event, baseElement){\n\tconst element = event.target;\n\tconst javascriptClientData = getJavascriptClientData();\n\tlet data = {\n\t\tevent_javascript_data: javascriptClientData,\n\t\tpost_url: document.location.href,\n\t\treferrer: document.referrer,\n\t};\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tevent.preventDefault();\n\t} else {\n\t\telement.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);\n\t\telement.style.cursor = 'progress';\n\n\t\t// Adding a tooltip\n\t\tlet apbctTooltip = document.createElement('div');\n\t\tapbctTooltip.setAttribute('class', 'apbct-tooltip');\n\t\tlet apbctTooltipText = document.createElement('div');\n\t\tapbctTooltipText.setAttribute('class', 'apbct-tooltip--text');\n\t\tlet apbctTooltipArrow = document.createElement('div');\n\t\tapbctTooltipArrow.setAttribute('class', 'apbct-tooltip--arrow');\n\t\tapbct(element).append(apbctTooltip);\n\t\tapbct(apbctTooltip).append(apbctTooltipText);\n\t\tapbct(apbctTooltip).append(apbctTooltipArrow);\n\t\tctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);\n\t}\n\n\tlet encodedEmail = event.target.dataset.originalString;\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tencodedEmail = baseElement.dataset.originalString;\n\t}\n\n\tdata.encodedEmail = encodedEmail;\n\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_decode_email',\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\t\t\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\t\t\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\t\t\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\t\t\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\t\t\t\t\tbaseElement.click();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t\t\t}, 3000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tapbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\n\t// Using AJAX request and handler\n\t}else{\n\t\tdata.action = 'apbct_decode_email';\n\t\tapbct_public_sendAJAX(\n\t\t\tdata,\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\t\t\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\t\t\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\t\t\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\t\t\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\t\t\t\t\tbaseElement.click();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t\t\t}, 3000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tapbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction getJavascriptClientData(common_cookies = []) {\n\tlet resultDataJson = {};\n\n\tresultDataJson.apbct_headless = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\tresultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\tresultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n\tresultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n\tresultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n\tresultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n\tresultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n\tresultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n\tresultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n\t// collecting data from localstorage\n\tconst ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\t// collecting data from cookies\n\tconst ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\tresultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;\n\tresultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;\n\tresultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n\n\tif (\n\t\ttypeof (common_cookies) === \"object\"\n\t\t&& common_cookies !== []\n\t){\n\t\tfor (let i = 0; i < common_cookies.length; ++i){\n\t\t\tif ( typeof (common_cookies[i][1]) === \"object\" ){\n\t\t\t\t//this is for handle SFW cookies\n\t\t\t\tresultDataJson[common_cookies[i][1][0]] = common_cookies[i][1][1]\n\t\t\t} else {\n\t\t\t\tresultDataJson[common_cookies[i][0]] = common_cookies[i][1]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconsole.log('APBCT JS ERROR: Collecting data type mismatch')\n\t}\n\n\t// Parse JSON properties to prevent double JSON encoding\n\tresultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\treturn JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\nfunction removeDoubleJsonEncoding(object){\n\n\tif( typeof object === 'object'){\n\n\t\tfor (let objectKey in object) {\n\n\t\t\t// Recursion\n\t\t\tif( typeof object[objectKey] === 'object'){\n\t\t\t\tobject[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n\t\t\t}\n\n\t\t\t// Common case (out)\n\t\t\tif(\n\t\t\t\ttypeof object[objectKey] === 'string' &&\n\t\t\t\tobject[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n\t\t\t){\n\t\t\t\tlet parsedValue = JSON.parse(object[objectKey]);\n\t\t\t\tif( typeof parsedValue === 'object' ){\n\t\t\t\t\tobject[objectKey] = parsedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction ctProcessDecodedDataResult(response, targetElement) {\n\n\ttargetElement.setAttribute('title', '');\n\ttargetElement.removeAttribute('style');\n\n\tif( !! response.is_allowed) {\n\t\tctFillDecodedEmail(targetElement, response.decoded_email);\n\t}\n\n\tif( !! response.show_comment ){\n\t\tctShowDecodeComment(targetElement, response.comment);\n\t}\n}\n\nfunction ctFillDecodedEmail(target, email){\n\tapbct(target).html(\n\t\tapbct(target)\n\t\t\t.html()\n\t\t\t.replace(/.+?(<div class=[\"']apbct-tooltip[\"'].+?<\\/div>)/, email + \"$1\")\n\t);\n}\n\nfunction ctShowDecodeComment(target, comment){\n\n\tif( ! comment ){\n\t\treturn;\n\t}\n\n\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeIn(300);\n\tapbct(target.getElementsByClassName('apbct-tooltip--text')).html(comment);\n\tsetTimeout(function(){\n\t\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t}, 5000);\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tif( ctPublic.data__cookies_type === 'native' ) {\n\t\tfor ( var i in collection ) {\n\t\t\tif ( i > 10 ) {\n\t\t\t\t// Do not generate more than 10 cookies\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar collectionIndex = form_id !== undefined ? form_id : i;\n\t\t\tctSetCookie(\"apbct_visible_fields_\" + collectionIndex, JSON.stringify( collection[i] ) );\n\t\t}\n\t} else {\n\t\tif (ctPublic.data__cookies_type === 'none'){\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection[0] ) );\n\t\t} else {\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\t\t}\n\n\t}\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbctGetScreenInfo() {\n\treturn JSON.stringify({\n\t\tfullWidth : document.documentElement.scrollWidth,\n\t\tfullHeight : Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t),\n\t\tvisibleWidth : document.documentElement.clientWidth,\n\t\tvisibleHeight : document.documentElement.clientHeight,\n\t});\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\ttry {\n\t\t\t\tvar response = JSON.parse(responseText);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e.toString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctParseBlockMessage(response);\n\t\t}\n\t});\n}\n\nfunction ctParseBlockMessage(response) {\n\n\tif (typeof response.apbct !== 'undefined') {\n\t\tresponse = response.apbct;\n\t\tif (response.blocked) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\t// Show the result by modal\n\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\tcleantalkModal.open();\n\n\t\t\tif(+response.stop_script == 1)\n\t\t\t\twindow.stop();\n\t\t}\n\t}\n}\n\nfunction ctSetPixelUrlLocalstorage(ajax_pixel_url) {\n\t//set pixel to the storage\n\tctSetCookie('apbct_pixel_url', ajax_pixel_url)\n}\n\nfunction ctNoCookieConstructHiddenField(){\n\tlet field = ''\n\tlet no_cookie_data = apbctLocalStorage.getCleanTalkData()\n\tno_cookie_data = JSON.stringify(no_cookie_data)\n\tno_cookie_data = btoa(no_cookie_data)\n\tfield = document.createElement('input')\n\tfield.setAttribute('id','ct_no_cookie_hidden_field')\n\tfield.setAttribute('name','ct_no_cookie_hidden_field')\n\tfield.setAttribute('value', no_cookie_data)\n\tfield.setAttribute('type', 'hidden')\n\treturn field\n}\n\nfunction ctNoCookieGetForms(){\n\tlet forms = document.forms\n\tif (forms) {\n\t\treturn forms\n\t}\n\treturn false\n}\n\nfunction ctNoCookieAttachHiddenFieldsToForms(){\n\n\tif (ctPublic.data__cookies_type !== 'none'){\n\t\treturn\n\t}\n\n\tlet forms = ctNoCookieGetForms()\n\n\tif (forms){\n\t\tfor ( let i = 0; i < forms.length; i++ ){\n\t\t\t//ignore forms with get method @todo We need to think about this\n\t\t\tif (document.forms[i].getAttribute('method') === null ||\n\t\t\t\tdocument.forms[i].getAttribute('method').toLowerCase() === 'post'){\n\n\t\t\t\tlet elements = document.getElementsByName('ct_no_cookie_hidden_field')\n\t\t\t\t//clear previous hidden set\n\t\t\t\tif (elements){\n\t\t\t\t\tfor (let j = 0; j < elements.length; j++) {\n\t\t\t\t\t\telements[j].parentNode.removeChild(elements[j])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// add new set\n\t\t\t\tdocument.forms[i].append(ctNoCookieConstructHiddenField())\n\t\t\t}\n\t\t}\n\t}\n\n}\n/* Cleantalk Modal object */\ncleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\nlet buttons_to_handle = []\nlet gdpr_notice_for_button = 'Please, apply the GDPR agreement.'\n\ndocument.addEventListener('DOMContentLoaded', function(){\n\tbuttons_to_handle = []\n\tif(\n\t\ttypeof ctPublicGDPR === 'undefined' ||\n\t\t! ctPublicGDPR.gdpr_forms.length\n\t) {\n\t\treturn;\n\t}\n\n\tif ( typeof jQuery === 'undefined' ) {\n\t\treturn;\n\t}\n\ttry {\n\t\tctPublicGDPR.gdpr_forms.forEach(function(item, i){\n\n\t\t\tlet elem = jQuery('#'+item+', .'+item);\n\n\t\t\t// Filter forms\n\t\t\tif (!elem.is('form')){\n\t\t\t\t// Caldera\n\t\t\t\tif (elem.find('form')[0])\n\t\t\t\t\telem = elem.children('form').first();\n\t\t\t\t// Contact Form 7\n\t\t\t\telse if(\n\t\t\t\t\tjQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]')\n\t\t\t\t\t\t.attr('id')\n\t\t\t\t\t\t.indexOf('wpcf7-f'+item) !== -1\n\t\t\t\t) {\n\t\t\t\t\telem = jQuery('.wpcf7[role=form]').children('form');\n\t\t\t\t}\n\n\t\t\t\t// Formidable\n\t\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\n\t\t\t\t\telem = jQuery('.frm_forms').first().children('form');\n\t\t\t\t// WPForms\n\t\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\n\t\t\t\t\telem = jQuery('.wpforms-form');\n\t\t\t}\n\n\t\t\t//disable forms buttons\n\t\t\tlet button = false\n\t\t\tlet buttons_collection= elem.find('input[type|=\"submit\"]')\n\n\t\t\tif (!buttons_collection.length) {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tbutton = buttons_collection[0]\n\t\t\t}\n\n\t\t\tif (button !== false){\n\t\t\t\tconsole.log(buttons_collection)\n\t\t\t\tbutton.disabled = true\n\t\t\t\tlet old_notice = jQuery(button).prop('title') ? jQuery(button).prop('title') : ''\n\t\t\t\tbuttons_to_handle.push({index:i,button:button,old_notice:old_notice})\n\t\t\t\tjQuery(button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\n\t\t\t// Adding notice and checkbox\n\t\t\tif(elem.is('form') || elem.attr('role') === 'form'){\n\t\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required\" style=\" margin-right: 10px;\" onchange=\"apbct_gdpr_handle_buttons()\">')\n\t\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\n\t\t\t}\n\t\t});\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not add GDPR notice' + e)\n\t}\n});\n\nfunction apbct_gdpr_handle_buttons(){\n\n\ttry {\n\n\t\tif (buttons_to_handle === []){\n\t\t\treturn\n\t\t}\n\n\t\tbuttons_to_handle.forEach((button) => {\n\t\t\tlet selector = '[id=\"apbct_gdpr_' + button.index + '\"]'\n\t\t\tlet apbct_gdpr_item = jQuery(selector)\n\t\t\t//chek if apbct_gdpr checkbox is set\n\t\t\tif (jQuery(apbct_gdpr_item).prop(\"checked\")){\n\t\t\t\tbutton.button.disabled = false\n\t\t\t\tjQuery(button.button).prop('title', button.old_notice)\n\t\t\t} else {\n\t\t\t\tbutton.button.disabled = true\n\t\t\t\tjQuery(button.button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not handle form buttons ' + e)\n\t}\n}\n/**\n * Handle external forms\n */\nfunction ct_protect_external() {\n for(var i = 0; i < document.forms.length; i++) {\n\n if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {\n\n // current form\n var currentForm = document.forms[i];\n\n if (currentForm.parentElement && currentForm.parentElement.classList.length > 0 && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1){\n return\n }\n\n if(typeof(currentForm.action) == 'string') {\n\n // Ajax checking for the integrated forms\n if(isIntegratedForm(currentForm)) {\n\n var cleantalk_placeholder = document.createElement(\"i\");\n cleantalk_placeholder.className = 'cleantalk_placeholder';\n cleantalk_placeholder.style = 'display: none';\n currentForm.parentElement.insertBefore(cleantalk_placeholder, currentForm);\n\n // Deleting form to prevent submit event\n var prev = currentForm.previousSibling,\n form_html = currentForm.outerHTML,\n form_original = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement(\"div\");\n placeholder.innerHTML = form_html;\n prev.after(placeholder.firstElementChild);\n\n var force_action = document.createElement(\"input\");\n force_action.name = 'action';\n force_action.value = 'cleantalk_force_ajax_check';\n force_action.type = 'hidden';\n\n let reUseCurrentForm = document.forms[i];\n\n reUseCurrentForm.appendChild(force_action);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = form_original;\n\n // mailerlite integration - disable click on submit button\n let mailerlite_detected_class = false\n if (reUseCurrentForm.classList !== undefined) {\n //list there all the mailerlite classes\n let mailerlite_classes = ['newsletterform', 'ml-block-form']\n mailerlite_classes.forEach(function(mailerlite_class) {\n if (reUseCurrentForm.classList.contains(mailerlite_class)){\n mailerlite_detected_class = mailerlite_class\n }\n });\n }\n if ( mailerlite_detected_class ) {\n let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.click(function (event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n });\n }\n } else {\n document.forms[i].onsubmit = function ( event ){\n event.preventDefault();\n\n const prev = jQuery(event.currentTarget).prev();\n const form_original = jQuery(event.currentTarget).clone();\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n }\n\n // Common flow - modify form's action\n }else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {\n\n var tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n var host = tmp[0].toLowerCase();\n\n if(host !== location.hostname.toLowerCase()){\n\n var ct_action = document.createElement(\"input\");\n ct_action.name = 'cleantalk_hidden_action';\n ct_action.value = currentForm.action;\n ct_action.type = 'hidden';\n currentForm.appendChild(ct_action);\n\n var ct_method = document.createElement(\"input\");\n ct_method.name = 'cleantalk_hidden_method';\n ct_method.value = currentForm.method;\n ct_method.type = 'hidden';\n\n currentForm.method = 'POST'\n\n currentForm.appendChild(ct_method);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n\n }\n}\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n var\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n inputs_source.each( function( index, elem_source ){\n\n var source = jQuery( elem_source );\n\n inputs_target.each( function( index2, elem_target ){\n\n var target = jQuery( elem_target );\n\n if( elem_source.outerHTML === elem_target.outerHTML ){\n\n target.val( source.val() );\n }\n });\n });\n\n}\nwindow.onload = function () {\n\n if( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n if ( typeof jQuery === 'undefined' ) {\n return;\n }\n\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};\n\n/**\n * Checking the form integration\n */\nfunction isIntegratedForm(formObj) {\n var formAction = formObj.action;\n\n if(\n formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n ( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('webto.salesforce.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1\n\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Sending Ajax for checking form data\n */\nfunction sendAjaxCheckingFormData(form, prev, formOriginal) {\n // Get visible fields and set cookie\n var visible_fields = {};\n visible_fields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visible_fields );\n\n var data = {};\n var elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ){\n\n if( result.apbct === undefined || ! +result.apbct.blocked ) {\n\n let form_new = jQuery(form).detach();\n let prev = form.apbctPrev;\n let formOriginal = form.apbctFormOriginal;\n\n apbct_replace_inputs_values_from_other_form(form_new, formOriginal);\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n jQuery(formOriginal).find('input[name=\"apbct_visible_fields\"]').remove();\n jQuery(formOriginal).find('input[value=\"cleantalk_force_ajax_check\"]').remove();\n\n // Common click event\n var subm_button = jQuery(formOriginal).find('button[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n subm_button = jQuery(formOriginal).find('input[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // ConvertKit direct integration\n subm_button = jQuery(formOriginal).find('button[data-element=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // Paypal integration\n subm_button = jQuery(formOriginal).find('input[type=\"image\"][name=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n }\n\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n }\n }\n );\n}\n\nfunction ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n //AJAX Request\n apbct_public_sendAJAX(\n ct_data,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function (data) {\n if(data.success === true){\n currForm.submit();\n }else{\n alert(data.data);\n return false;\n }\n }\n }\n );\n}\n\ndocument.addEventListener('DOMContentLoaded',function(){\n let ct_currAction = '',\n ct_currForm = '';\n\n if( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n\tfor( let i=0; i<document.forms.length; i++ ){\n\t\tif ( typeof(document.forms[i].action) == 'string' ){\n ct_currForm = document.forms[i];\n\t\t\tct_currAction = ct_currForm.action;\n if (\n ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory\n ct_currAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing\n ) {\n ctPrevHandler = ct_currForm.click;\n if ( typeof jQuery !== 'undefined' ) {\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(event){\n ct_check_internal(event.target);\n return false;\n });\n }\n }\n\t\t}\n\t}\n});\n\n/**\n * Check by action to exclude the form checking\n * @param action string\n * @return boolean\n */\nfunction ct_check_internal__is_exclude_form(action) {\n // An array contains forms action need to be excluded.\n let ct_internal_script_exclusions = [\n ctPublic.blog_home + 'wp-login.php', // WordPress login page\n ctPublic.blog_home + 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ct_internal_script_exclusions.some((item) => {\n return action.match(new RegExp('^' + item)) !== null;\n });\n}"],"names":["ApbctCore","ajax_parameters","rest_parameters","#selector","elements","#eventCallback","#eventSelector","#event","constructor","selector","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","#deselect","#addElement","elemToAdd","push","#push","elem","#reduce","css","style","getRaw","let","style_name","DOM_style_name","replace","group","toUpperCase","i","length","computedStyle","getComputedStyle","console","log","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ApbctAjax","rest","ApbctRest","on","args","addEventListener","#onChecker","bind","event","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","propName","value","html","val","data","name","is","filter","#isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","isRegisteredTagName","tagName","toLowerCase","#isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","apbct","params","ApbctXhr","#xhr","XMLHttpRequest","method","url","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","#methods_to_convert_data_to_URL","#body","#http_code","#status_text","parameters","key","#prepare","Object","keys","deleteDoubleJSONEncoding","convertData","open","setHeaders","onreadystatechange","onReadyStateChange","onload","onLoad","onprogress","onProgress","onerror","onError","ontimeout","onTimeout","send","setAttribute","cursor","#complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","#error","response","error","http_code","status_text","additional_msg","error_string","errorOutput","error_msg","header_name","setRequestHeader","convertDataToURL","convertDataToBody","params_appendix","URLSearchParams","toString","params_prefix","dataKey","FormData","JSON","stringify","object","objectKey","parsedValue","parse","super","default_route","ctPublicFunctions","_rest_url","route","X-WP-Nonce","_rest_nonce","ctSetCookie","cookies","expires","skip_alt","data__cookies_type","forEach","item","arr","apbctLocalStorage","set","encodeURIComponent","ctNoCookieAttachHiddenFieldsToForms","ctSecure","location","protocol","cookie","cookiePrefix","getJavascriptClientData","e","data__ajax_type","apbct_public_sendREST","apbct_public_sendAJAX","action","notJson","ctGetCookie","matches","RegExp","decodeURIComponent","undefined","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","_ajax_nonce","Math","random","no_cache","get","property","storageValue","localStorage","getItem","json","hasOwnProperty","is_json","objToSave","timestamp","floor","getTime","setItem","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","ct_date","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","apbct_attach_event_handler","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","clearInterval","checkEmail","current_email","email","result","now","ctSetPixelImg","pixelUrl","ctPublic","pixel__enabled","getElementById","insertedImg","ctGetPixelUrl","local_storage_pixel_url","ctSetHasScrolled","ctPreloadLocalStorage","data__to_local_storage","entries","apbct_ready","cookiesType","initCookies","getTimezoneOffset","apbctGetScreenInfo","navigator","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","forms","hiddenInput","visibleFieldsToInput","form","data__visible_fields_required","contains","id","apbct_collect_visible_fields","onsubmit_prev","onsubmit","ctFormIndex","visible_fields","apbct_visible_fields_set_cookie","Function","decodedEmailNodes","href","ctFillDecodedEmailHandler","apbctAjaxEmailDecode","baseElement","element","event_javascript_data","post_url","referrer","preventDefault","text__wait_for_decoding","apbctTooltip","apbctTooltipText","apbctTooltipArrow","ctShowDecodeComment","encodedEmail","dataset","originalString","success","baseElementContent","innerHTML","decoded_email","click","ctProcessDecodedDataResult","getElementsByClassName","res","common_cookies","resultDataJson","apbct_headless","apbct_pixel_url","ct_checked_emails","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","removeDoubleJsonEncoding","targetElement","is_allowed","ctFillDecodedEmail","show_comment","comment","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","isNaN","getAttribute","visibility","visible_fields_count","invisible_fields","invisible_fields_count","visible_fields_collection","form_id","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","body","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ctParseBlockMessage","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajax_pixel_url","ctNoCookieConstructHiddenField","field","no_cookie_data","btoa","ctNoCookieGetForms","getElementsByName","j","parentNode","removeChild","jQuery","ajaxComplete","xhr","settings","responseText","loading","opened","opening","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","right","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","buttons_to_handle","gdpr_notice_for_button","apbct_gdpr_handle_buttons","index","apbct_gdpr_item","disabled","old_notice","info","ct_protect_external","cleantalk_hidden_action","cleantalk_hidden_method","currentForm","isIntegratedForm","cleantalk_placeholder","prev","insertBefore","previousSibling","form_html","outerHTML","form_original","placeholder","firstElementChild","force_action","type","reUseCurrentForm","mailerlite_detected_class","appendChild","apbctPrev","apbctFormOriginal","mailerlite_classes","mailerlite_class","mailerliteSubmitButton","find","sendAjaxCheckingFormData","currentTarget","clone","hostname","ct_action","ct_method","apbct_replace_inputs_values_from_other_form","form_source","form_target","inputs_source","inputs_target","each","elem_source","source","index2","elem_target","formObj","formAction","firstChild","formOriginal","elems","y","form_new","detach","subm_button","ct_check_internal","currForm","ct_data","alert","submit","ct_check_internal__is_exclude_form","ct_internal_script_exclusions","blog_home","some","ctPublicGDPR","gdpr_forms","first","buttons_collection","gdpr_text","settings__forms__check_external","ct_currAction","ct_currForm","settings__forms__check_internal","ctPrevHandler","off"],"mappings":"MAAMA,UAEFC,gBAAkB,GAClBC,gBAAkB,GAElBC,UAAY,KACZC,SAAW,GAGXC,eACAC,eACAC,OAKAC,YAAYC,GACRC,KAAKC,OAAOF,GAShBE,OAAOF,GAkBH,OAhBGA,aAAoBG,gBACnBF,KAAKP,UAAe,KACpBO,KAAKN,SAAc,GACnBM,KAAKN,SAAWS,MAAMC,UAAUC,MAAMC,KAAKP,IACjB,iBAAbA,GACbC,KAAKP,UAAe,KACpBO,KAAKN,SAAc,GACnBM,KAAKN,SAAS,GAAKK,GACO,iBAAbA,GACbC,KAAKP,UAAYM,EACjBC,KAAKN,SAAWS,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBT,KAGrEC,KAAKS,YAGFT,KAGXU,YAAYC,GACiB,iBAAdA,EACPX,KAAKN,SAASkB,KAAKD,GACQ,iBAAdA,GACbX,KAAKP,UAAYkB,EACjBX,KAAKN,SAAWS,MAAMC,UAAUC,MAAMC,KAAKC,SAASC,iBAAiBG,KAErEX,KAAKS,YAIbI,MAAMC,GACFd,KAAKN,SAASkB,KAAKE,GAGvBC,UACIf,KAAKN,SAAWM,KAAKN,SAASW,MAAM,GAAG,GAG3CI,YACIT,KAAKN,SAAW,GAWpBsB,IAAIC,EAAOC,GAKP,GAHAA,IAAkB,EAGE,iBAAVD,EAAmB,CAWzB,IAAIE,IAAIC,KAAcH,EAAM,CACxBE,IAAIE,EAAmCD,EATnCE,QAAQ,eAAgBC,GACxBA,EACKC,cACAF,QAAQ,IAAK,IACbA,QAAQ,IAAK,KAQtB,IAAIH,IAAIM,EAAE,EAAGA,EAAEzB,KAAKN,SAASgC,OAAQD,IACjCzB,KAAKN,SAAS+B,GAAGR,MAAMI,GAAkBJ,EAAMG,GAIvD,OAAOpB,KAIX,GA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,EAAgBC,EAAYnU,QAEDjI,QAAQ,cACmC,OAAzDmc,EAAczc,MAAM4M,SAASqP,UAAY,YACvCF,mCAAmCU,KAErCG,cAAgBF,EAAYnM,MACL,oBAAXiF,SACRA,OAAOkH,GAAaG,IAAI,MACxBrH,OAAOkH,GAAaG,MACpBrH,OAAOkH,GAAane,GAAG,SAAU,SAASK,GAEtC,OADA8c,kBAAkB9c,EAAMC,SACjB"}
|
1 |
+
{"version":3,"file":"apbct-public-bundle.min.js","sources":["apbct-public-bundle.js"],"sourcesContent":["class ApbctCore{\n\n ajax_parameters = {};\n rest_parameters = {};\n\n #selector = null;\n elements = [];\n\n // Event properties\n #eventCallback;\n #eventSelector;\n #event;\n\n /**\n * Default constructor\n */\n constructor(selector){\n this.select(selector);\n }\n\n /**\n * Get elements by CSS selector\n *\n * @param selector\n * @returns {*}\n */\n select(selector) {\n\n if(selector instanceof HTMLCollection){\n this.#selector = null;\n this.elements = [];\n this.elements = Array.prototype.slice.call(selector);\n }else if( typeof selector === 'object' ){\n this.#selector = null;\n this.elements = [];\n this.elements[0] = selector;\n }else if( typeof selector === 'string' ){\n this.#selector = selector;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));\n // this.elements = document.querySelectorAll(selector)[0];\n }else{\n this.#deselect();\n }\n\n return this;\n }\n\n #addElement(elemToAdd){\n if( typeof elemToAdd === 'object' ){\n this.elements.push(elemToAdd);\n }else if( typeof elemToAdd === 'string' ){\n this.#selector = elemToAdd;\n this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));\n }else{\n this.#deselect();\n }\n }\n\n #push(elem){\n this.elements.push(elem);\n }\n\n #reduce(){\n this.elements = this.elements.slice(0,-1);\n }\n\n #deselect(){\n this.elements = [];\n }\n\n /**\n * Set or get CSS for/of currently selected element\n *\n * @param style\n * @param getRaw\n *\n * @returns {boolean|*}\n */\n css(style, getRaw){\n\n getRaw = getRaw | false;\n\n // Set style\n if(typeof style === \"object\"){\n\n const stringToCamelCase = str =>\n str.replace(/([-_][a-z])/g, group =>\n group\n .toUpperCase()\n .replace('-', '')\n .replace('_', '')\n );\n\n // Apply multiple styles\n for(let style_name in style){\n let DOM_style_name = stringToCamelCase(style_name);\n\n // Apply to multiple elements (currently selected)\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].style[DOM_style_name] = style[style_name];\n }\n }\n\n return this;\n }\n\n // Get style of first currently selected element\n if(typeof style === 'string'){\n\n let computedStyle = getComputedStyle(this.elements[0])[style];\n\n // Process\n if( typeof computedStyle !== 'undefined' && ! getRaw){\n computedStyle = computedStyle.replace(/(\\d)(em|pt|%|px){1,2}$/, '$1'); // Cut of units\n computedStyle = Number(computedStyle) == computedStyle ? Number(computedStyle) : computedStyle; // Cast to INT\n return computedStyle;\n }\n\n // Return unprocessed\n return computedStyle;\n }\n }\n\n hide(){\n this.prop('prev-display', this.css('display'));\n this.css({'display': 'none'});\n }\n\n show(){\n this.css({'display': this.prop('prev-display')});\n }\n\n addClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.add(className);\n }\n }\n\n removeClass(){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.remove(className);\n }\n }\n\n toggleClass(className){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].classList.toggle(className);\n }\n }\n\n /**\n * Wrapper for apbctAJAX class\n *\n * @param ajax_parameters\n * @returns {ApbctAjax}\n */\n ajax(ajax_parameters){\n this.ajax_parameters = ajax_parameters;\n return new ApbctAjax(ajax_parameters);\n }\n\n /**\n * Wrapper for apbctREST class\n *\n * @param rest_parameters\n * @returns {ApbctRest}\n */\n rest(rest_parameters){\n this.rest_parameters = rest_parameters;\n return new ApbctRest(rest_parameters);\n }\n\n /************** EVENTS **************/\n\n /**\n *\n * Why the mess with arguments?\n *\n * Because we need to support the following function signatures:\n * on('click', function(){ alert('some'); });\n * on('click', 'inner_selector', function(){ alert('some'); });\n *\n * @param args\n */\n on(...args){\n\n this.#event = args[0];\n this.#eventCallback = args[2] || args[1];\n this.#eventSelector = typeof args[1] === \"string\" ? args[1] : null;\n\n for(let i=0; i<this.elements.length; i++){\n this.elements[i].addEventListener(\n this.#event,\n this.#eventSelector !== null\n ? this.#onChecker.bind(this)\n : this.#eventCallback\n );\n }\n }\n\n /**\n * Check if a selector of an event matches current target\n *\n * @param event\n * @returns {*}\n */\n #onChecker(event){\n if(event.target === document.querySelector(this.#eventSelector)){\n event.stopPropagation();\n return this.#eventCallback(event);\n }\n }\n\n ready(callback){\n document.addEventListener('DOMContentLoaded', callback);\n }\n\n change(callback){\n this.on('change', callback);\n }\n\n /************** ATTRIBUTES **************/\n\n /**\n * Get an attribute or property of an element\n *\n * @param attrName\n * @returns {*|*[]}\n */\n attr(attrName){\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n\n // Use property instead of attribute if possible\n if(typeof this.elements[i][attrName] !== undefined){\n outputValue.push(this.elements[i][attrName]);\n }else{\n outputValue.push(this.elements[i].getAttribute(attrName));\n }\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n\n prop(propName, value){\n\n // Setting values\n if(typeof value !== \"undefined\"){\n for(let i=0; i<this.elements.length; i++){\n this.elements[i][propName] = value;\n }\n\n return this;\n\n // Getting values\n }else{\n\n let outputValue = [];\n\n for(let i=0; i<this.elements.length; i++){\n outputValue.push(this.elements[i][propName]);\n }\n\n // Return a single value instead of array if only one value is present\n return outputValue.length === 1 ? outputValue[0] : outputValue;\n }\n }\n\n /**\n * Set or get inner HTML\n *\n * @param value\n * @returns {*|*[]}\n */\n html(value){\n return typeof value !== 'undefined'\n ? this.prop('innerHTML', value)\n : this.prop('innerHTML');\n }\n\n /**\n * Set or get value of input tags\n *\n * @param value\n * @returns {*|*[]|undefined}\n */\n val(value){\n return typeof value !== 'undefined'\n ? this.prop('value', value)\n : this.prop('value');\n }\n\n data(name, value){\n return typeof value !== 'undefined'\n ? this.prop('apbct-data', name, value)\n : this.prop('apbct-data');\n }\n\n /************** END OF ATTRIBUTES **************/\n\n /************** FILTERS **************/\n\n /**\n * Check if the current elements are corresponding to filter\n *\n * @param filter\n * @returns {boolean}\n */\n is(filter){\n\n let outputValue = false;\n\n for(let elem of this.elements){\n outputValue ||= this.#isElem(elem, filter);\n }\n\n return outputValue;\n }\n\n #isElem(elemToCheck, filter){\n\n let is = false;\n let isRegisteredTagName = function(name){\n let newlyCreatedElement = document.createElement(name).constructor;\n return ! Boolean( ~[HTMLElement, HTMLUnknownElement].indexOf(newlyCreatedElement) );\n };\n\n // Check for filter function\n if(typeof filter === 'function') {\n is ||= filter.call(this, elemToCheck);\n }\n\n // Check for filter function\n if(typeof filter === 'string') {\n\n // Filter is tag name\n if( filter.match(/^[a-z]/) && isRegisteredTagName(filter) ){\n is ||= elemToCheck.tagName.toLowerCase() === filter.toLowerCase();\n\n // Filter is property\n }else if( filter.match(/^[a-z]/) ){\n is ||= Boolean(elemToCheck[filter]);\n\n // Filter is CSS selector\n }else {\n is ||= this.#selector !== null\n ? document.querySelector(this.#selector + filter) !== null // If possible\n : this.#isWithoutSelector(elemToCheck, filter); // Search through all elems with such selector\n }\n }\n\n return is;\n }\n\n #isWithoutSelector(elemToCheck, filter){\n\n let elems = document.querySelectorAll(filter);\n let outputValue = false;\n\n for(let elem of elems){\n outputValue ||= elemToCheck === elem;\n }\n\n return outputValue;\n }\n\n filter(filter){\n\n this.#selector = null;\n\n for( let i = this.elements.length - 1; i >= 0; i-- ){\n if( ! this.#isElem(this.elements[i], filter) ){\n this.elements.splice(Number(i), 1);\n }\n }\n\n return this;\n }\n\n /************** NODES **************/\n\n parent(filter){\n\n this.select(this.elements[0].parentElement);\n\n if( typeof filter !== 'undefined' && ! this.is(filter) ){\n this.#deselect();\n }\n\n return this;\n }\n\n parents(filter){\n\n this.select(this.elements[0]);\n\n for ( ; this.elements[ this.elements.length - 1].parentElement !== null ; ) {\n this.#push(this.elements[ this.elements.length - 1].parentElement);\n }\n\n this.elements.splice(0,1); // Deleting initial element from the set\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n children(filter){\n\n this.select(this.elements[0].children);\n\n if( typeof filter !== 'undefined' ){\n this.filter(filter);\n }\n\n return this;\n }\n\n siblings(filter){\n\n let current = this.elements[0]; // Remember current to delete it later\n\n this.parent();\n this.children(filter);\n this.elements.splice(this.elements.indexOf(current), 1); // Remove current element\n\n return this;\n }\n\n /************** DOM MANIPULATIONS **************/\n remove(){\n for(let elem of this.elements){\n elem.remove();\n }\n }\n\n after(content){\n for(let elem of this.elements){\n elem.after(content);\n }\n }\n\n append(content){\n for(let elem of this.elements){\n elem.append(content);\n }\n }\n\n /** ANIMATION **/\n fadeIn(time) {\n for(let elem of this.elements){\n elem.style.opacity = 0;\n elem.style.display = 'block';\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity < 1) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n }\n };\n\n tick();\n }\n }\n\n fadeOut(time) {\n for(let elem of this.elements){\n elem.style.opacity = 1;\n\n let last = +new Date();\n const tick = function () {\n elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;\n last = +new Date();\n\n if (+elem.style.opacity > 0) {\n (window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);\n } else {\n elem.style.display = 'none';\n }\n };\n\n tick();\n }\n }\n\n}\n\n/**\n * Hack\n *\n * Make a proxy to keep both properties and methods from:\n * - the native object and\n * - the new one from ApbctCore for selected element.\n *\n * For example:\n * apbct('#id).innerHTML = 'some';\n * apbct('#id).css({'backgorund-color': 'black'});\n */\n// apbct = new Proxy(\n// apbct,\n// {\n// get(target, prop) {\n// if (target.elements.length) {\n// return target.elements[0][prop];\n// } else {\n// return null;\n// }\n// },\n// set(target, prop, value){\n// if (target.elements.length) {\n// target.elements[0][prop] = value;\n// return true;\n// } else {\n// return false;\n// }\n// },\n// apply(target, thisArg, argArray) {\n//\n// }\n// }\n// );\n\n/**\n * Enter point to ApbctCore class\n *\n * @param params\n * @returns {*}\n */\nfunction apbct(params){\n return new ApbctCore()\n .select(params);\n}\nclass ApbctXhr{\n\n #xhr = new XMLHttpRequest();\n\n // Base parameters\n method = 'POST'; // HTTP-request type\n url = ''; // URL to send the request\n async = true;\n user = null; // HTTP-authorization username\n password = null; // HTTP-authorization password\n data = {}; // Data to send\n\n\n // Optional params\n button = null; // Button that should be disabled when request is performing\n spinner = null; // Spinner that should appear when request is in process\n progressbar = null; // Progress bar for the current request\n context = this; // Context\n callback = null;\n onErrorCallback = null;\n\n responseType = 'json'; // Expected data type from server\n headers = {};\n timeout = 15000; // Request timeout in milliseconds\n\n #methods_to_convert_data_to_URL = [\n 'GET',\n 'HEAD',\n ];\n\n #body = null;\n #http_code = 0;\n #status_text = '';\n\n constructor(parameters){\n\n console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');\n\n // Set class properties\n for( let key in parameters ){\n if( typeof this[key] !== 'undefined' ){\n this[key] = parameters[key];\n }\n }\n\n // Modifying DOM-elements\n this.#prepare();\n\n // Modify URL with data for GET and HEAD requests\n if ( Object.keys(this.data).length ) {\n this.deleteDoubleJSONEncoding(this.data);\n this.convertData();\n }\n\n if( ! this.url ){\n console.log('%cXHR%c not URL provided', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;')\n return false;\n }\n\n // Configure the request\n this.#xhr.open(this.method, this.url, this.async, this.user, this.password);\n this.setHeaders();\n\n this.#xhr.responseType = this.responseType;\n this.#xhr.timeout = this.timeout;\n\n /* EVENTS */\n // Monitoring status\n this.#xhr.onreadystatechange = function(){\n this.onReadyStateChange();\n }.bind(this);\n\n // Run callback\n this.#xhr.onload = function(){\n this.onLoad();\n }.bind(this);\n\n // On progress\n this.#xhr.onprogress = function(event){\n this.onProgress(event);\n }.bind(this);\n\n // On error\n this.#xhr.onerror = function(){\n this.onError();\n }.bind(this);\n\n this.#xhr.ontimeout = function(){\n this.onTimeout();\n }.bind(this);\n\n // Send the request\n this.#xhr.send(this.#body);\n }\n\n #prepare(){\n\n // Disable button\n if(this.button){\n this.button.setAttribute('disabled', 'disabled');\n this.button.style.cursor = 'not-allowed';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'inline';\n }\n }\n\n #complete(){\n\n this.#http_code = this.#xhr.status;\n this.#status_text = this.#xhr.statusText;\n\n // Disable button\n if(this.button){\n this.button.removeAttribute('disabled');\n this.button.style.cursor = 'auto';\n }\n\n // Enable spinner\n if(this.spinner) {\n this.spinner.style.display = 'none';\n }\n\n if( this.progressbar ) {\n this.progressbar.fadeOut('slow');\n }\n }\n\n onReadyStateChange(){\n if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function'){\n this.on_ready_state_change();\n }\n }\n\n onProgress(event) {\n if (this.on_progress !== null && typeof this.on_progress === 'function'){\n this.on_progress();\n }\n }\n\n onError(){\n\n console.log('error');\n\n this.#complete();\n this.#error(\n this.#http_code,\n this.#status_text\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback(this.#status_text);\n }\n }\n\n onTimeout(){\n this.#complete();\n this.#error(\n 0,\n 'timeout'\n );\n\n if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){\n this.onErrorCallback('Timeout');\n }\n }\n\n onLoad(){\n\n this.#complete();\n\n if (this.responseType === 'json' ){\n if(this.#xhr.response === null){\n this.#error(this.#http_code, this.#status_text, 'No response');\n return false;\n }else if( typeof this.#xhr.response.error !== 'undefined') {\n this.#error(this.#http_code, this.#status_text, this.#xhr.response.error);\n return false;\n }\n }\n\n if (this.callback !== null && typeof this.callback === 'function') {\n this.callback.call(this.context, this.#xhr.response, this.data);\n }\n }\n\n #error(http_code, status_text, additional_msg){\n\n let error_string = '';\n\n if( status_text === 'timeout' ){\n error_string += 'Server response timeout'\n\n }else if( http_code === 200 ){\n\n if( status_text === 'parsererror' ){\n error_string += 'Unexpected response from server. See console for details.';\n }else {\n error_string += 'Unexpected error. Status: ' + status_text + '.';\n if( typeof additional_msg !== 'undefined' )\n error_string += ' Additional error info: ' + additional_msg;\n }\n\n }else if(http_code === 500){\n error_string += 'Internal server error.';\n\n }else {\n error_string += 'Unexpected response code:' + http_code;\n }\n\n this.errorOutput( error_string );\n }\n\n errorOutput(error_msg){\n console.log( '%c ctXHR error: %c' + error_msg, 'color: red;', 'color: grey;' );\n }\n\n setHeaders(){\n // Set headers if passed\n for( let header_name in this.headers ){\n if( typeof this.headers[header_name] !== 'undefined' ){\n this.#xhr.setRequestHeader(header_name, this.headers[header_name]);\n }\n }\n }\n\n convertData()\n {\n // GET, HEAD request-type\n if( ~this.#methods_to_convert_data_to_URL.indexOf( this.method ) ){\n return this.convertDataToURL();\n\n // POST request-type\n }else{\n return this.convertDataToBody()\n }\n }\n\n convertDataToURL(){\n let params_appendix = new URLSearchParams(this.data).toString();\n let params_prefix = this.url.match(/^(https?:\\/{2})?[a-z0-9.]+\\?/) ? '&' : '?';\n this.url += params_prefix + params_appendix;\n\n return this.url;\n }\n\n /**\n *\n * @returns {null}\n */\n convertDataToBody()\n {\n this.#body = new FormData();\n\n for (let dataKey in this.data) {\n this.#body.append(\n dataKey,\n typeof this.data[dataKey] === 'object'\n ? JSON.stringify(this.data[dataKey])\n : this.data[dataKey]\n );\n }\n\n return this.#body;\n }\n\n /**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\n deleteDoubleJSONEncoding(object){\n\n if( typeof object === 'object'){\n\n for (let objectKey in object) {\n\n // Recursion\n if( typeof object[objectKey] === 'object'){\n object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);\n }\n\n // Common case (out)\n if(\n typeof object[objectKey] === 'string' &&\n object[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n ){\n let parsedValue = JSON.parse(object[objectKey]);\n if( typeof parsedValue === 'object' ){\n object[objectKey] = parsedValue;\n }\n }\n }\n }\n\n return object;\n }\n}\nclass ApbctAjax extends ApbctXhr{\n\n constructor(...args) {\n super(args[0]);\n }\n}\nclass ApbctRest extends ApbctXhr{\n\n static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';\n route = '';\n\n constructor(...args) {\n args = args[0];\n args.url = ApbctRest.default_route + args.route;\n args.headers = {\n \"X-WP-Nonce\": ctPublicFunctions._rest_nonce\n };\n super(args);\n }\n}\n\nfunction ctSetCookie( cookies, value, expires ){\n\n if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){\n var skip_alt = cookies === 'ct_pointer_data';\n cookies = [ [ cookies, value, expires ] ];\n }\n\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n cookies.forEach( function (item, i, arr\t) {\n apbctLocalStorage.set(item[0], encodeURIComponent(item[1]))\n });\n ctNoCookieAttachHiddenFieldsToForms()\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n cookies.forEach( function (item, i, arr\t) {\n var expires = typeof item[2] !== 'undefined' ? \"expires=\" + expires + '; ' : '';\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = ctPublicFunctions.cookiePrefix + item[0] + \"=\" + encodeURIComponent(item[1]) + \"; \" + expires + \"path=/; samesite=lax\" + ctSecure;\n });\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ){\n\n if (typeof (getJavascriptClientData) === \"function\"){\n //reprocess already gained cookies data\n cookies = getJavascriptClientData(cookies);\n } else {\n console.log('APBCT ERROR: getJavascriptClientData() is not loaded')\n }\n\n try {\n JSON.parse(cookies)\n } catch (e){\n console.log('APBCT ERROR: JSON parse error:' + e)\n return\n }\n\n // Using REST API handler\n if( ctPublicFunctions.data__ajax_type === 'rest' ){\n apbct_public_sendREST(\n 'alt_sessions',\n {\n method: 'POST',\n data: { cookies: cookies }\n }\n );\n\n // Using AJAX request and handler\n } else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n apbct_public_sendAJAX(\n {\n action: 'apbct_alt_session__save__AJAX',\n cookies: cookies,\n },\n {\n notJson: 1,\n }\n );\n }\n }\n}\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n var matches = document.cookie.match(new RegExp(\n \"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n ));\n return matches ? decodeURIComponent(matches[1]) : undefined;\n}\n\nfunction ctDeleteCookie(cookieName) {\n // Cookies disabled\n if( ctPublicFunctions.data__cookies_type === 'none' ){\n return;\n\n // Using traditional cookies\n }else if( ctPublicFunctions.data__cookies_type === 'native' ){\n\n var ctSecure = location.protocol === 'https:' ? '; secure' : '';\n document.cookie = cookieName + \"=\\\"\\\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax\" + ctSecure;\n\n // Using alternative cookies\n }else if( ctPublicFunctions.data__cookies_type === 'alternative' ){\n // @ToDo implement this logic\n }\n}\n\nfunction apbct_public_sendAJAX(data, params, obj){\n\n // Default params\n let _params = [];\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"callback_context\"] = params.callback_context || null;\n _params[\"callback_params\"] = params.callback_params || null;\n _params[\"async\"] = params.async || true;\n _params[\"notJson\"] = params.notJson || null;\n _params[\"timeout\"] = params.timeout || 15000;\n _params[\"obj\"] = obj || null;\n _params[\"button\"] = params.button || null;\n _params[\"progressbar\"] = params.progressbar || null;\n _params[\"silent\"] = params.silent || null;\n _params[\"no_nonce\"] = params.no_nonce || null;\n _params[\"data\"] = data;\n _params[\"url\"] = ctPublicFunctions._ajax_url;\n\n if(typeof (data) === 'string') {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"] = _params[\"data\"] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"] = _params[\"data\"] + '&no_cache=' + Math.random()\n } else {\n if( ! _params[\"no_nonce\"] ) {\n _params[\"data\"]._ajax_nonce = ctPublicFunctions._ajax_nonce;\n }\n _params[\"data\"].no_cache = Math.random();\n }\n\n new ApbctCore().ajax(_params);\n}\n\nfunction apbct_public_sendREST( route, params ) {\n\n let _params = [];\n _params[\"route\"] = route;\n _params[\"callback\"] = params.callback || null;\n _params[\"onErrorCallback\"] = params.onErrorCallback || null;\n _params[\"data\"] = params.data || [];\n _params[\"method\"] = params.method || 'POST';\n\n new ApbctCore().rest(_params);\n}\n\nlet apbctLocalStorage = {\n get : function(key, property) {\n if ( typeof property === 'undefined' ) {\n property = 'value';\n }\n const storageValue = localStorage.getItem(key);\n if ( storageValue !== null ) {\n try {\n const json = JSON.parse(storageValue);\n return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;\n } catch (e) {\n return storageValue;\n }\n }\n return false;\n },\n set : function(key, value, is_json = true) {\n if (is_json){\n let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};\n localStorage.setItem(key, JSON.stringify(objToSave));\n } else {\n localStorage.setItem(key, value);\n }\n },\n isAlive : function(key, maxLifetime) {\n if ( typeof maxLifetime === 'undefined' ) {\n maxLifetime = 86400;\n }\n const keyTimestamp = this.get(key, 'timestamp');\n return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);\n },\n isSet : function(key) {\n return localStorage.getItem(key) !== null;\n },\n delete : function (key) {\n localStorage.removeItem(key);\n },\n getCleanTalkData : function () {\n let data = {}\n for(let i=0; i<localStorage.length; i++) {\n let key = localStorage.key(i);\n if (key.indexOf('ct_') !==-1 || key.indexOf('apbct_') !==-1){\n data[key.toString()] = apbctLocalStorage.get(key)\n }\n }\n return data\n },\n\n}\nvar ct_date = new Date(),\n\tctTimeMs = new Date().getTime(),\n\tctMouseEventTimerFlag = true, //Reading interval flag\n\tctMouseData = [],\n\tctMouseDataCounter = 0,\n\tctCheckedEmails = {};\n\nfunction apbct_attach_event_handler(elem, event, callback){\n\tif(typeof window.addEventListener === \"function\") elem.addEventListener(event, callback);\n\telse elem.attachEvent(event, callback);\n}\n\nfunction apbct_remove_event_handler(elem, event, callback){\n\tif(typeof window.removeEventListener === \"function\") elem.removeEventListener(event, callback);\n\telse elem.detachEvent(event, callback);\n}\n\n//Writing first key press timestamp\nvar ctFunctionFirstKey = function output(event){\n\tvar KeyTimestamp = Math.floor(new Date().getTime()/1000);\n\tctSetCookie(\"ct_fkp_timestamp\", KeyTimestamp);\n\tctKeyStopStopListening();\n};\n\n//Reading interval\nvar ctMouseReadInterval = setInterval(function(){\n\tctMouseEventTimerFlag = true;\n}, 150);\n\n//Writting interval\nvar ctMouseWriteDataInterval = setInterval(function(){\n\tctSetCookie(\"ct_pointer_data\", JSON.stringify(ctMouseData));\n}, 1200);\n\n//Logging mouse position each 150 ms\nvar ctFunctionMouseMove = function output(event){\n\tctSetMouseMoved();\n\tif(ctMouseEventTimerFlag === true){\n\n\t\tctMouseData.push([\n\t\t\tMath.round(event.clientY),\n\t\t\tMath.round(event.clientX),\n\t\t\tMath.round(new Date().getTime() - ctTimeMs)\n\t\t]);\n\n\t\tctMouseDataCounter++;\n\t\tctMouseEventTimerFlag = false;\n\t\tif(ctMouseDataCounter >= 50){\n\t\t\tctMouseStopData();\n\t\t}\n\t}\n};\n\n//Stop mouse observing function\nfunction ctMouseStopData(){\n\tapbct_remove_event_handler(window, \"mousemove\", ctFunctionMouseMove);\n\tclearInterval(ctMouseReadInterval);\n\tclearInterval(ctMouseWriteDataInterval);\n}\n\n//Stop key listening function\nfunction ctKeyStopStopListening(){\n\tapbct_remove_event_handler(window, \"mousedown\", ctFunctionFirstKey);\n\tapbct_remove_event_handler(window, \"keydown\", ctFunctionFirstKey);\n}\n\nfunction checkEmail(e) {\n\tvar current_email = e.target.value;\n\tif (current_email && !(current_email in ctCheckedEmails)) {\n\t\t// Using REST API handler\n\t\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\t\tapbct_public_sendREST(\n\t\t\t\t'check_email_before_post',\n\t\t\t\t{\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tdata: {'email' : current_email},\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t\t// Using AJAX request and handler\n\t\t} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {\n\t\t\tapbct_public_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_email_check_before_post',\n\t\t\t\t\temail : current_email,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tcallback: function (result) {\n\t\t\t\t\t\tif (result.result) {\n\t\t\t\t\t\t\tctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};\n\t\t\t\t\t\t\tctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n}\n\nfunction ctSetPixelImg(pixelUrl) {\n\tctSetCookie('apbct_pixel_url', pixelUrl);\n\tif( +ctPublic.pixel__enabled ){\n\t\tif( ! document.getElementById('apbct_pixel') ) {\n\t\t\tlet insertedImg = document.createElement('img');\n\t\t\tinsertedImg.setAttribute('alt', 'CleanTalk Pixel');\n\t\t\tinsertedImg.setAttribute('id', 'apbct_pixel');\n\t\t\tinsertedImg.setAttribute('style', 'display: none; left: 99999px;');\n\t\t\tinsertedImg.setAttribute('src', pixelUrl);\n\t\t\tapbct('body').append(insertedImg);\n\t\t}\n\t}\n}\n\nfunction ctGetPixelUrl() {\n\t// Check if pixel is already in localstorage and is not outdated\n\tlet local_storage_pixel_url = apbctLocalStorage.get('apbct_pixel_url');\n\tif ( local_storage_pixel_url !== false ) {\n\t\tif ( apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {\n\t\t\tapbctLocalStorage.delete('apbct_pixel_url')\n\t\t} else {\n\t\t\t//if so - load pixel from localstorage and draw it skipping AJAX\n\t\t\tctSetPixelImg(local_storage_pixel_url);\n\t\t\treturn;\n\t\t}\n\t}\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_get_pixel_url',\n\t\t\t{\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t\t// Using AJAX request and handler\n\t}else{\n\t\tapbct_public_sendAJAX(\n\t\t\t{\n\t\t\t\taction: 'apbct_get_pixel_url',\n\t\t\t},\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//set pixel url to localstorage\n\t\t\t\t\t\tif ( ! apbctLocalStorage.get('apbct_pixel_url') ){\n\t\t\t\t\t\t\t//set pixel to the storage\n\t\t\t\t\t\t\tapbctLocalStorage.set('apbct_pixel_url', result)\n\t\t\t\t\t\t\t//update pixel data in the hidden fields\n\t\t\t\t\t\t\tctNoCookieAttachHiddenFieldsToForms()\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//then run pixel drawing\n\t\t\t\t\t\tctSetPixelImg(result);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction ctSetHasScrolled() {\n\tif( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {\n\t\tctSetCookie(\"ct_has_scrolled\", 'true');\n\t\tapbctLocalStorage.set('ct_has_scrolled', true);\n\t}\n}\n\nfunction ctSetMouseMoved() {\n\tif( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {\n\t\tctSetCookie(\"ct_mouse_moved\", 'true');\n\t\tapbctLocalStorage.set('ct_mouse_moved', true);\n\t}\n}\n\nfunction ctPreloadLocalStorage(){\n\tif (ctPublic.data__to_local_storage){\n\t\tlet data = Object.entries(ctPublic.data__to_local_storage)\n\t\tdata.forEach(([key, value]) => {\n\t\t\tapbctLocalStorage.set(key,value)\n\t\t});\n\t}\n}\n\napbct_attach_event_handler(window, \"mousemove\", ctFunctionMouseMove);\napbct_attach_event_handler(window, \"mousedown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"keydown\", ctFunctionFirstKey);\napbct_attach_event_handler(window, \"scroll\", ctSetHasScrolled);\n\n// Ready function\nfunction apbct_ready(){\n\n\tctPreloadLocalStorage()\n\n\tlet cookiesType = apbctLocalStorage.get('ct_cookies_type');\n\tif ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {\n\t\tapbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);\n\t\tapbctLocalStorage.delete('ct_mouse_moved');\n\t\tapbctLocalStorage.delete('ct_has_scrolled');\n\t}\n\n\t// Collect scrolling info\n\tvar initCookies = [\n\t\t[\"ct_ps_timestamp\", Math.floor(new Date().getTime() / 1000)],\n\t\t[\"ct_fkp_timestamp\", \"0\"],\n\t\t[\"ct_pointer_data\", \"0\"],\n\t\t[\"ct_timezone\", ct_date.getTimezoneOffset()/60*(-1) ],\n\t\t[\"ct_screen_info\", apbctGetScreenInfo()],\n\t\t[\"apbct_headless\", navigator.webdriver],\n\t];\n\n\tapbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));\n\tapbctLocalStorage.set('ct_fkp_timestamp', \"0\");\n\tapbctLocalStorage.set('ct_pointer_data', \"0\");\n\tapbctLocalStorage.set('ct_timezone', ct_date.getTimezoneOffset()/60*(-1) );\n\tapbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());\n\tapbctLocalStorage.set('apbct_headless', navigator.webdriver);\n\n\tif( ctPublic.data__cookies_type !== 'native' ) {\n\t\tinitCookies.push(['apbct_visible_fields', '0']);\n\t} else {\n\t\t// Delete all visible fields cookies on load the page\n\t\tvar cookiesArray = document.cookie.split(\";\");\n\t\tif( cookiesArray.length !== 0 ) {\n\t\t\tfor ( var i = 0; i < cookiesArray.length; i++ ) {\n\t\t\t\tvar currentCookie = cookiesArray[i].trim();\n\t\t\t\tvar cookieName = currentCookie.split(\"=\")[0];\n\t\t\t\tif( cookieName.indexOf(\"apbct_visible_fields_\") === 0 ) {\n\t\t\t\t\tctDeleteCookie(cookieName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif( +ctPublic.pixel__setting ){\n\t\tif( +ctPublic.pixel__enabled ){\n\t\t\tctGetPixelUrl()\n\t\t} else {\n\t\t\tinitCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);\n\t\t}\n\t}\n\n\tif ( +ctPublic.data__email_check_before_post) {\n\t\tinitCookies.push(['ct_checked_emails', '0']);\n\t\tapbct(\"input[type = 'email'], #email\").on('blur', checkEmail);\n\t}\n\n\tif (apbctLocalStorage.isSet('ct_checkjs')) {\n\t\tinitCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);\n\t} else {\n\t\tinitCookies.push(['ct_checkjs', 0]);\n\t}\n\n\tctSetCookie(initCookies);\n\n\tsetTimeout(function(){\n\n\t\tctNoCookieAttachHiddenFieldsToForms()\n\n\t\tfor(var i = 0; i < document.forms.length; i++){\n\t\t\tvar form = document.forms[i];\n\n\t\t\t//Exclusion for forms\n\t\t\tif (\n\t\t\t\t+ctPublic.data__visible_fields_required === 0 ||\n\t\t\t\tform.method.toString().toLowerCase() === 'get' ||\n\t\t\t\tform.classList.contains('slp_search_form') || //StoreLocatorPlus form\n\t\t\t\tform.parentElement.classList.contains('mec-booking') ||\n\t\t\t\tform.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign\n\t\t\t\t(form.id && form.id === 'caspioform') || //Caspio Form\n\t\t\t\t(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm\n\t\t\t\t(form.classList && form.classList.contains('give-form')) || // GiveWP\n\t\t\t\t(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password\n\t\t\t\t(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm\n\t\t\t\t(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat\n\t\t\t\t(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\t(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form\n\t\t\t\tform.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form\n\t\t\t\t(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar\n\t\t\t) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar hiddenInput = document.createElement( 'input' );\n\t\t\thiddenInput.setAttribute( 'type', 'hidden' );\n\t\t\thiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );\n\t\t\thiddenInput.setAttribute( 'name', 'apbct_visible_fields');\n\t\t\tvar visibleFieldsToInput = {};\n\t\t\tvisibleFieldsToInput[0] = apbct_collect_visible_fields(form);\n\t\t\thiddenInput.value = JSON.stringify(visibleFieldsToInput);\n\t\t\tform.append( hiddenInput );\n\n\t\t\tform.onsubmit_prev = form.onsubmit;\n\n\t\t\tform.ctFormIndex = i;\n\t\t\tform.onsubmit = function (event) {\n\n\t\t\t\tif ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {\n\n\t\t\t\t\tvar visible_fields = {};\n\t\t\t\t\tvisible_fields[0] = apbct_collect_visible_fields(this);\n\t\t\t\t\tapbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );\n\t\t\t\t}\n\n\t\t\t\t// Call previous submit action\n\t\t\t\tif (event.target.onsubmit_prev instanceof Function) {\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tevent.target.onsubmit_prev.call(event.target, event);\n\t\t\t\t\t}, 500);\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t}, 1000);\n\n\t// Listen clicks on encoded emails\n\tlet decodedEmailNodes = document.querySelectorAll(\"[data-original-string]\");\n\tif (decodedEmailNodes.length) {\n\t\tfor (let i = 0; i < decodedEmailNodes.length; ++i) {\n\t\t\tif (\n\t\t\t\tdecodedEmailNodes[i].parentElement.href ||\n\t\t\t\tdecodedEmailNodes[i].parentElement.parentElement.href\n\t\t\t) {\n\t\t\t\t// Skip listening click on hyperlinks\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tdecodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);\n\t\t}\n\t}\n}\napbct_attach_event_handler(window, \"DOMContentLoaded\", apbct_ready);\n\nfunction ctFillDecodedEmailHandler(event) {\n\tthis.removeEventListener('click', ctFillDecodedEmailHandler);\n\tapbctAjaxEmailDecode(event, this);\n}\n\nfunction apbctAjaxEmailDecode(event, baseElement){\n\tconst element = event.target;\n\tconst javascriptClientData = getJavascriptClientData();\n\tlet data = {\n\t\tevent_javascript_data: javascriptClientData,\n\t\tpost_url: document.location.href,\n\t\treferrer: document.referrer,\n\t};\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tevent.preventDefault();\n\t}\n\n\telement.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);\n\telement.style.cursor = 'progress';\n\n\t// Adding a tooltip\n\tlet apbctTooltip = document.createElement('div');\n\tapbctTooltip.setAttribute('class', 'apbct-tooltip');\n\tlet apbctTooltipText = document.createElement('div');\n\tapbctTooltipText.setAttribute('class', 'apbct-tooltip--text');\n\tlet apbctTooltipArrow = document.createElement('div');\n\tapbctTooltipArrow.setAttribute('class', 'apbct-tooltip--arrow');\n\tapbct(element).append(apbctTooltip);\n\tapbct(apbctTooltip).append(apbctTooltipText);\n\tapbct(apbctTooltip).append(apbctTooltipArrow);\n\tctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);\n\n\tlet encodedEmail = event.target.dataset.originalString;\n\n\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\tencodedEmail = baseElement.dataset.originalString;\n\t}\n\n\tdata.encodedEmail = encodedEmail;\n\n\t// Using REST API handler\n\tif( ctPublicFunctions.data__ajax_type === 'rest' ){\n\t\tapbct_public_sendREST(\n\t\t\t'apbct_decode_email',\n\t\t\t{\n\t\t\t\tdata: data,\n\t\t\t\tmethod: 'POST',\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\t\t\t\t\telement.style.cursor = 'default';\n\t\t\t\t\t\t\telement.getElementsByClassName('apbct-tooltip')[0].style.display='none';\n\t\t\t\t\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\t\t\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\t\t\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\t\t\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\t\t\t\t\tbaseElement.click();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t\t\t}, 3000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tapbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\n\t// Using AJAX request and handler\n\t}else{\n\t\tdata.action = 'apbct_decode_email';\n\t\tapbct_public_sendAJAX(\n\t\t\tdata,\n\t\t\t{\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function (result) {\n\t\t\t\t\tif (result.success) {\n\t\t\t\t\t\tif (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {\n\t\t\t\t\t\t\tlet encodedEmail = baseElement.href.replace('mailto:', '');\n\t\t\t\t\t\t\tlet baseElementContent = baseElement.innerHTML;\n\t\t\t\t\t\t\tbaseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);\n\t\t\t\t\t\t\tbaseElement.href = 'mailto:' + result.data.decoded_email;\n\t\t\t\t\t\t\tbaseElement.click();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t\tctProcessDecodedDataResult(result.data, event.target);\n\t\t\t\t\t\t\t}, 3000);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tapbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t\t\t\t\t}, 4000);\n\t\t\t\t},\n\t\t\t\tonErrorCallback: function (res) {\n\t\t\t\t\telement.addEventListener('click', ctFillDecodedEmailHandler);\n\t\t\t\t\telement.removeAttribute('style');\n\t\t\t\t\tctShowDecodeComment(element, 'Error occurred: ' + res);\n\t\t\t\t},\n\t\t\t}\n\t\t);\n\t}\n}\n\nfunction getJavascriptClientData(common_cookies = []) {\n\tlet resultDataJson = {};\n\n\tresultDataJson.apbct_headless = !!ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');\n\tresultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');\n\tresultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');\n\tresultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');\n\tresultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');\n\tresultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');\n\tresultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');\n\tresultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');\n\tresultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');\n\n\t// collecting data from localstorage\n\tconst ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\t// collecting data from cookies\n\tconst ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');\n\tconst ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');\n\tconst ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');\n\n\tresultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;\n\tresultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;\n\tresultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;\n\n\tif (\n\t\ttypeof (common_cookies) === \"object\"\n\t\t&& common_cookies !== []\n\t){\n\t\tfor (let i = 0; i < common_cookies.length; ++i){\n\t\t\tif ( typeof (common_cookies[i][1]) === \"object\" ){\n\t\t\t\t//this is for handle SFW cookies\n\t\t\t\tresultDataJson[common_cookies[i][1][0]] = common_cookies[i][1][1]\n\t\t\t} else {\n\t\t\t\tresultDataJson[common_cookies[i][0]] = common_cookies[i][1]\n\t\t\t}\n\t\t}\n\t} else {\n\t\tconsole.log('APBCT JS ERROR: Collecting data type mismatch')\n\t}\n\n\t// Parse JSON properties to prevent double JSON encoding\n\tresultDataJson = removeDoubleJsonEncoding(resultDataJson);\n\n\treturn JSON.stringify(resultDataJson);\n}\n\n/**\n * Recursive\n *\n * Recursively decode JSON-encoded properties\n *\n * @param object\n * @returns {*}\n */\nfunction removeDoubleJsonEncoding(object){\n\n\tif( typeof object === 'object'){\n\n\t\tfor (let objectKey in object) {\n\n\t\t\t// Recursion\n\t\t\tif( typeof object[objectKey] === 'object'){\n\t\t\t\tobject[objectKey] = removeDoubleJsonEncoding(object[objectKey]);\n\t\t\t}\n\n\t\t\t// Common case (out)\n\t\t\tif(\n\t\t\t\ttypeof object[objectKey] === 'string' &&\n\t\t\t\tobject[objectKey].match(/^[\\[{].*?[\\]}]$/) !== null // is like JSON\n\t\t\t){\n\t\t\t\tlet parsedValue = JSON.parse(object[objectKey]);\n\t\t\t\tif( typeof parsedValue === 'object' ){\n\t\t\t\t\tobject[objectKey] = parsedValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn object;\n}\n\nfunction ctProcessDecodedDataResult(response, targetElement) {\n\n\ttargetElement.setAttribute('title', '');\n\ttargetElement.removeAttribute('style');\n\n\tif( !! response.is_allowed) {\n\t\tctFillDecodedEmail(targetElement, response.decoded_email);\n\t}\n\n\tif( !! response.show_comment ){\n\t\tctShowDecodeComment(targetElement, response.comment);\n\t}\n}\n\nfunction ctFillDecodedEmail(target, email){\n\tapbct(target).html(\n\t\tapbct(target)\n\t\t\t.html()\n\t\t\t.replace(/.+?(<div class=[\"']apbct-tooltip[\"'].+?<\\/div>)/, email + \"$1\")\n\t);\n}\n\nfunction ctShowDecodeComment(target, comment){\n\n\tif( ! comment ){\n\t\treturn;\n\t}\n\n\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeIn(300);\n\tapbct(target.getElementsByClassName('apbct-tooltip--text')).html(comment);\n\tsetTimeout(function(){\n\t\tapbct(target.getElementsByClassName('apbct-tooltip')).fadeOut(700);\n\t}, 5000);\n}\n\nfunction apbct_collect_visible_fields( form ) {\n\n\t// Get only fields\n\tvar inputs = [],\n\t\tinputs_visible = '',\n\t\tinputs_visible_count = 0,\n\t\tinputs_invisible = '',\n\t\tinputs_invisible_count = 0,\n\t\tinputs_with_duplicate_names = [];\n\n\tfor(var key in form.elements){\n\t\tif(!isNaN(+key))\n\t\t\tinputs[key] = form.elements[key];\n\t}\n\n\t// Filter fields\n\tinputs = inputs.filter(function(elem){\n\n\t\t// Filter already added fields\n\t\tif( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){\n\t\t\treturn false;\n\t\t}\n\t\t// Filter inputs with same names for type == radio\n\t\tif( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute(\"type\") )){\n\t\t\tinputs_with_duplicate_names.push( elem.getAttribute('name') );\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t});\n\n\t// Visible fields\n\tinputs.forEach(function(elem, i, elements){\n\t\t// Unnecessary fields\n\t\tif(\n\t\t\telem.getAttribute(\"type\") === \"submit\" || // type == submit\n\t\t\telem.getAttribute('name') === null ||\n\t\t\telem.getAttribute('name') === 'ct_checkjs'\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\t// Invisible fields\n\t\tif(\n\t\t\tgetComputedStyle(elem).display === \"none\" || // hidden\n\t\t\tgetComputedStyle(elem).visibility === \"hidden\" || // hidden\n\t\t\tgetComputedStyle(elem).opacity === \"0\" || // hidden\n\t\t\telem.getAttribute(\"type\") === \"hidden\" // type == hidden\n\t\t) {\n\t\t\tif( elem.classList.contains(\"wp-editor-area\") ) {\n\t\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_visible_count++;\n\t\t\t} else {\n\t\t\t\tinputs_invisible += \" \" + elem.getAttribute(\"name\");\n\t\t\t\tinputs_invisible_count++;\n\t\t\t}\n\t\t}\n\t\t// Visible fields\n\t\telse {\n\t\t\tinputs_visible += \" \" + elem.getAttribute(\"name\");\n\t\t\tinputs_visible_count++;\n\t\t}\n\n\t});\n\n\tinputs_invisible = inputs_invisible.trim();\n\tinputs_visible = inputs_visible.trim();\n\n\treturn {\n\t\tvisible_fields : inputs_visible,\n\t\tvisible_fields_count : inputs_visible_count,\n\t\tinvisible_fields : inputs_invisible,\n\t\tinvisible_fields_count : inputs_invisible_count,\n\t}\n\n}\n\nfunction apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {\n\n\tvar collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};\n\n\tif( ctPublic.data__cookies_type === 'native' ) {\n\t\tfor ( var i in collection ) {\n\t\t\tif ( i > 10 ) {\n\t\t\t\t// Do not generate more than 10 cookies\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar collectionIndex = form_id !== undefined ? form_id : i;\n\t\t\tctSetCookie(\"apbct_visible_fields_\" + collectionIndex, JSON.stringify( collection[i] ) );\n\t\t}\n\t} else {\n\t\tif (ctPublic.data__cookies_type === 'none'){\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection[0] ) );\n\t\t} else {\n\t\t\tctSetCookie(\"apbct_visible_fields\", JSON.stringify( collection ) );\n\t\t}\n\n\t}\n}\n\nfunction apbct_js_keys__set_input_value(result, data, params, obj){\n\tif( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {\n\t\tvar elements = document.querySelectorAll('[name^=ct_checkjs]');\n\t\tfor ( var i = 0; i < elements.length; i++ ) {\n\t\t\telements[i].value = result.js_key;\n\t\t}\n\t}\n}\n\nfunction apbctGetScreenInfo() {\n\treturn JSON.stringify({\n\t\tfullWidth : document.documentElement.scrollWidth,\n\t\tfullHeight : Math.max(\n\t\t\tdocument.body.scrollHeight, document.documentElement.scrollHeight,\n\t\t\tdocument.body.offsetHeight, document.documentElement.offsetHeight,\n\t\t\tdocument.body.clientHeight, document.documentElement.clientHeight\n\t\t),\n\t\tvisibleWidth : document.documentElement.clientWidth,\n\t\tvisibleHeight : document.documentElement.clientHeight,\n\t});\n}\n\nif(typeof jQuery !== 'undefined') {\n\n\t// Capturing responses and output block message for unknown AJAX forms\n\tjQuery(document).ajaxComplete(function (event, xhr, settings) {\n\t\tif (xhr.responseText && xhr.responseText.indexOf('\"apbct') !== -1) {\n\t\t\ttry {\n\t\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\t} catch (e) {\n\t\t\t\tconsole.log(e.toString());\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tctParseBlockMessage(response);\n\t\t}\n\t});\n}\n\nfunction ctParseBlockMessage(response) {\n\n\tif (typeof response.apbct !== 'undefined') {\n\t\tresponse = response.apbct;\n\t\tif (response.blocked) {\n\t\t\tdocument.dispatchEvent(\n\t\t\t\tnew CustomEvent( \"apbctAjaxBockAlert\", {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tdetail: { message: response.comment }\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\t// Show the result by modal\n\t\t\tcleantalkModal.loaded = response.comment;\n\t\t\tcleantalkModal.open();\n\n\t\t\tif(+response.stop_script == 1)\n\t\t\t\twindow.stop();\n\t\t}\n\t}\n}\n\nfunction ctSetPixelUrlLocalstorage(ajax_pixel_url) {\n\t//set pixel to the storage\n\tctSetCookie('apbct_pixel_url', ajax_pixel_url)\n}\n\nfunction ctNoCookieConstructHiddenField(){\n\tlet field = ''\n\tlet no_cookie_data = apbctLocalStorage.getCleanTalkData()\n\tno_cookie_data = JSON.stringify(no_cookie_data)\n\tno_cookie_data = btoa(no_cookie_data)\n\tfield = document.createElement('input')\n\tfield.setAttribute('id','ct_no_cookie_hidden_field')\n\tfield.setAttribute('name','ct_no_cookie_hidden_field')\n\tfield.setAttribute('value', no_cookie_data)\n\tfield.setAttribute('type', 'hidden')\n\treturn field\n}\n\nfunction ctNoCookieGetForms(){\n\tlet forms = document.forms\n\tif (forms) {\n\t\treturn forms\n\t}\n\treturn false\n}\n\nfunction ctNoCookieAttachHiddenFieldsToForms(){\n\n\tif (ctPublic.data__cookies_type !== 'none'){\n\t\treturn\n\t}\n\n\tlet forms = ctNoCookieGetForms()\n\n\tif (forms){\n\t\tfor ( let i = 0; i < forms.length; i++ ){\n\t\t\t//ignore forms with get method @todo We need to think about this\n\t\t\tif (document.forms[i].getAttribute('method') === null ||\n\t\t\t\tdocument.forms[i].getAttribute('method').toLowerCase() === 'post'){\n\n\t\t\t\tlet elements = document.getElementsByName('ct_no_cookie_hidden_field')\n\t\t\t\t//clear previous hidden set\n\t\t\t\tif (elements){\n\t\t\t\t\tfor (let j = 0; j < elements.length; j++) {\n\t\t\t\t\t\telements[j].parentNode.removeChild(elements[j])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// add new set\n\t\t\t\tdocument.forms[i].append(ctNoCookieConstructHiddenField())\n\t\t\t}\n\t\t}\n\t}\n\n}\n/* Cleantalk Modal object */\nlet cleantalkModal = {\n\n // Flags\n loaded: false,\n loading: false,\n opened: false,\n opening: false,\n\n // Methods\n load: function( action ) {\n if( ! this.loaded ) {\n this.loading = true;\n callback = function( result, data, params, obj ) {\n cleantalkModal.loading = false;\n cleantalkModal.loaded = result;\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalContentLoaded\", {\n bubbles: true,\n } )\n );\n };\n if( typeof apbct_admin_sendAJAX === \"function\" ) {\n apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n } else {\n apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );\n }\n\n }\n },\n\n open: function () {\n /* Cleantalk Modal CSS start */\n var renderCss = function () {\n var cssStr = '';\n for ( key in this.styles ) {\n cssStr += key + ':' + this.styles[key] + ';';\n }\n return cssStr;\n };\n var overlayCss = {\n styles: {\n \"z-index\": \"9999\",\n \"position\": \"fixed\",\n \"top\": \"0\",\n \"left\": \"0\",\n \"width\": \"100%\",\n \"height\": \"100%\",\n \"background\": \"rgba(0,0,0,0.5)\",\n \"display\": \"flex\",\n \"justify-content\" : \"center\",\n \"align-items\" : \"center\",\n },\n toString: renderCss\n };\n var innerCss = {\n styles: {\n \"position\" : \"relative\",\n \"padding\" : \"30px\",\n \"background\" : \"#FFF\",\n \"border\" : \"1px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"4px\",\n \"box-shadow\" : \"7px 7px 5px 0px rgba(50,50,50,0.75)\",\n },\n toString: renderCss\n };\n var closeCss = {\n styles: {\n \"position\" : \"absolute\",\n \"background\" : \"#FFF\",\n \"width\" : \"20px\",\n \"height\" : \"20px\",\n \"border\" : \"2px solid rgba(0,0,0,0.75)\",\n \"border-radius\" : \"15px\",\n \"cursor\" : \"pointer\",\n \"top\" : \"-8px\",\n \"right\" : \"-8px\",\n \"box-sizing\" : \"content-box\",\n },\n toString: renderCss\n };\n var closeCssBefore = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(45deg)\",\n },\n toString: renderCss\n };\n var closeCssAfter = {\n styles: {\n \"content\" : \"\\\"\\\"\",\n \"display\" : \"block\",\n \"position\" : \"absolute\",\n \"background\" : \"#000\",\n \"border-radius\" : \"1px\",\n \"width\" : \"2px\",\n \"height\" : \"16px\",\n \"top\" : \"2px\",\n \"left\" : \"9px\",\n \"transform\" : \"rotate(-45deg)\",\n },\n toString: renderCss\n };\n var bodyCss = {\n styles: {\n \"overflow\" : \"hidden\",\n },\n toString: renderCss\n };\n var cleantalkModalStyle = document.createElement( 'style' );\n cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );\n cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';\n cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';\n document.body.append( cleantalkModalStyle );\n /* Cleantalk Modal CSS end */\n\n var overlay = document.createElement( 'div' );\n overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );\n document.body.append( overlay );\n\n document.body.classList.add( 'cleantalk-modal-opened' );\n\n var inner = document.createElement( 'div' );\n inner.setAttribute( 'id', 'cleantalk-modal-inner' );\n inner.setAttribute( 'style', innerCss );\n overlay.append( inner );\n\n var close = document.createElement( 'div' );\n close.setAttribute( 'id', 'cleantalk-modal-close' );\n inner.append( close );\n\n var content = document.createElement( 'div' );\n if ( this.loaded ) {\n content.innerHTML = this.loaded;\n } else {\n content.innerHTML = 'Loading...';\n // @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.\n this.load( 'get_options_template' );\n }\n content.setAttribute( 'id', 'cleantalk-modal-content' );\n inner.append( content );\n\n this.opened = true;\n },\n\n close: function () {\n document.body.classList.remove( 'cleantalk-modal-opened' );\n document.getElementById( 'cleantalk-modal-overlay' ).remove();\n document.getElementById( 'cleantalk-modal-styles' ).remove();\n document.dispatchEvent(\n new CustomEvent( \"cleantalkModalClosed\", {\n bubbles: true,\n } )\n );\n }\n\n};\n\n/* Cleantalk Modal helpers */\ndocument.addEventListener('click',function( e ){\n if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){\n cleantalkModal.close();\n }\n});\ndocument.addEventListener(\"cleantalkModalContentLoaded\", function( e ) {\n if( cleantalkModal.opened && cleantalkModal.loaded ) {\n document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;\n }\n});\nlet buttons_to_handle = []\nlet gdpr_notice_for_button = 'Please, apply the GDPR agreement.'\n\ndocument.addEventListener('DOMContentLoaded', function(){\n\tbuttons_to_handle = []\n\tif(\n\t\ttypeof ctPublicGDPR === 'undefined' ||\n\t\t! ctPublicGDPR.gdpr_forms.length\n\t) {\n\t\treturn;\n\t}\n\n\tif ( typeof jQuery === 'undefined' ) {\n\t\treturn;\n\t}\n\ttry {\n\t\tctPublicGDPR.gdpr_forms.forEach(function(item, i){\n\n\t\t\tlet elem = jQuery('#'+item+', .'+item);\n\n\t\t\t// Filter forms\n\t\t\tif (!elem.is('form')){\n\t\t\t\t// Caldera\n\t\t\t\tif (elem.find('form')[0])\n\t\t\t\t\telem = elem.children('form').first();\n\t\t\t\t// Contact Form 7\n\t\t\t\telse if(\n\t\t\t\t\tjQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]')\n\t\t\t\t\t\t.attr('id')\n\t\t\t\t\t\t.indexOf('wpcf7-f'+item) !== -1\n\t\t\t\t) {\n\t\t\t\t\telem = jQuery('.wpcf7[role=form]').children('form');\n\t\t\t\t}\n\n\t\t\t\t// Formidable\n\t\t\t\telse if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)\n\t\t\t\t\telem = jQuery('.frm_forms').first().children('form');\n\t\t\t\t// WPForms\n\t\t\t\telse if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)\n\t\t\t\t\telem = jQuery('.wpforms-form');\n\t\t\t}\n\n\t\t\t//disable forms buttons\n\t\t\tlet button = false\n\t\t\tlet buttons_collection= elem.find('input[type|=\"submit\"]')\n\n\t\t\tif (!buttons_collection.length) {\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tbutton = buttons_collection[0]\n\t\t\t}\n\n\t\t\tif (button !== false){\n\t\t\t\tbutton.disabled = true\n\t\t\t\tlet old_notice = jQuery(button).prop('title') ? jQuery(button).prop('title') : ''\n\t\t\t\tbuttons_to_handle.push({index:i,button:button,old_notice:old_notice})\n\t\t\t\tjQuery(button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\n\t\t\t// Adding notice and checkbox\n\t\t\tif(elem.is('form') || elem.attr('role') === 'form'){\n\t\t\t\telem.append('<input id=\"apbct_gdpr_'+i+'\" type=\"checkbox\" required=\"required\" style=\" margin-right: 10px;\" onchange=\"apbct_gdpr_handle_buttons()\">')\n\t\t\t\t\t.append('<label style=\"display: inline;\" for=\"apbct_gdpr_'+i+'\">'+ctPublicGDPR.gdpr_text+'</label>');\n\t\t\t}\n\t\t});\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not add GDPR notice' + e)\n\t}\n});\n\nfunction apbct_gdpr_handle_buttons(){\n\n\ttry {\n\n\t\tif (buttons_to_handle === []){\n\t\t\treturn\n\t\t}\n\n\t\tbuttons_to_handle.forEach((button) => {\n\t\t\tlet selector = '[id=\"apbct_gdpr_' + button.index + '\"]'\n\t\t\tlet apbct_gdpr_item = jQuery(selector)\n\t\t\t//chek if apbct_gdpr checkbox is set\n\t\t\tif (jQuery(apbct_gdpr_item).prop(\"checked\")){\n\t\t\t\tbutton.button.disabled = false\n\t\t\t\tjQuery(button.button).prop('title', button.old_notice)\n\t\t\t} else {\n\t\t\t\tbutton.button.disabled = true\n\t\t\t\tjQuery(button.button).prop('title', gdpr_notice_for_button)\n\t\t\t}\n\t\t})\n\t} catch (e) {\n\t\tconsole.info('APBCT GDPR JS ERROR: Can not handle form buttons ' + e)\n\t}\n}\n/**\n * Handle external forms\n */\nfunction ct_protect_external() {\n for(var i = 0; i < document.forms.length; i++) {\n\n if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {\n\n // current form\n var currentForm = document.forms[i];\n\n if (currentForm.parentElement && currentForm.parentElement.classList.length > 0 && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1){\n return\n }\n\n if(typeof(currentForm.action) == 'string') {\n\n // Ajax checking for the integrated forms\n if(isIntegratedForm(currentForm)) {\n\n apbctProcessExternalForm(currentForm, i, document);\n\n // Common flow - modify form's action\n }else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {\n\n var tmp = currentForm.action.split('//');\n tmp = tmp[1].split('/');\n var host = tmp[0].toLowerCase();\n\n if(host !== location.hostname.toLowerCase()){\n\n var ct_action = document.createElement(\"input\");\n ct_action.name = 'cleantalk_hidden_action';\n ct_action.value = currentForm.action;\n ct_action.type = 'hidden';\n currentForm.appendChild(ct_action);\n\n var ct_method = document.createElement(\"input\");\n ct_method.name = 'cleantalk_hidden_method';\n ct_method.value = currentForm.method;\n ct_method.type = 'hidden';\n\n currentForm.method = 'POST'\n\n currentForm.appendChild(ct_method);\n\n currentForm.action = document.location;\n }\n }\n }\n }\n\n }\n\n // Trying to process external form into an iframe\n const frames = document.getElementsByTagName('iframe');\n if ( frames.length > 0 ) {\n for ( let j = 0; j < frames.length; j++ ) {\n if ( frames[j].contentDocument == null ) { continue; }\n\n const iframeForms = frames[j].contentDocument.forms;\n if ( iframeForms.length === 0 ) { return; }\n\n for ( let y = 0; y < iframeForms.length; y++ ) {\n let currentForm = iframeForms[y];\n apbctProcessExternalForm(currentForm, y, frames[j].contentDocument);\n }\n }\n }\n}\n\nfunction apbctProcessExternalForm(currentForm, iterator, documentObject) {\n\n const cleantalk_placeholder = document.createElement(\"i\");\n cleantalk_placeholder.className = 'cleantalk_placeholder';\n cleantalk_placeholder.style = 'display: none';\n currentForm.parentElement.insertBefore(cleantalk_placeholder, currentForm);\n\n // Deleting form to prevent submit event\n let prev = currentForm.previousSibling,\n form_html = currentForm.outerHTML,\n form_original = currentForm;\n\n // Remove the original form\n currentForm.parentElement.removeChild(currentForm);\n\n // Insert a clone\n const placeholder = document.createElement(\"div\");\n placeholder.innerHTML = form_html;\n prev.after(placeholder.firstElementChild);\n\n var force_action = document.createElement(\"input\");\n force_action.name = 'action';\n force_action.value = 'cleantalk_force_ajax_check';\n force_action.type = 'hidden';\n\n let reUseCurrentForm = documentObject.forms[iterator];\n\n reUseCurrentForm.appendChild(force_action);\n reUseCurrentForm.apbctPrev = prev;\n reUseCurrentForm.apbctFormOriginal = form_original;\n\n // mailerlite integration - disable click on submit button\n let mailerlite_detected_class = false\n if (reUseCurrentForm.classList !== undefined) {\n //list there all the mailerlite classes\n let mailerlite_classes = ['newsletterform', 'ml-block-form']\n mailerlite_classes.forEach(function(mailerlite_class) {\n if (reUseCurrentForm.classList.contains(mailerlite_class)){\n mailerlite_detected_class = mailerlite_class\n }\n });\n }\n if ( mailerlite_detected_class ) {\n let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type=\"submit\"]');\n if ( mailerliteSubmitButton !== undefined ) {\n mailerliteSubmitButton.click(function (event) {\n event.preventDefault();\n sendAjaxCheckingFormData(event.currentTarget);\n });\n }\n } else {\n documentObject.forms[iterator].onsubmit = function ( event ){\n event.preventDefault();\n\n const prev = jQuery(event.currentTarget).prev();\n const form_original = jQuery(event.currentTarget).clone();\n\n sendAjaxCheckingFormData(event.currentTarget);\n };\n }\n}\n\nfunction apbct_replace_inputs_values_from_other_form( form_source, form_target ){\n\n var\tinputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),\n inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );\n\n inputs_source.each( function( index, elem_source ){\n\n var source = jQuery( elem_source );\n\n inputs_target.each( function( index2, elem_target ){\n\n var target = jQuery( elem_target );\n\n if( elem_source.outerHTML === elem_target.outerHTML ){\n\n target.val( source.val() );\n }\n });\n });\n\n}\nwindow.onload = function () {\n\n if( ! +ctPublic.settings__forms__check_external ) {\n return;\n }\n\n if ( typeof jQuery === 'undefined' ) {\n return;\n }\n\n setTimeout(function () {\n ct_protect_external()\n }, 1500);\n};\n\n/**\n * Checking the form integration\n */\nfunction isIntegratedForm(formObj) {\n var formAction = formObj.action;\n let formId = formObj.id;\n\n if(\n formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form\n formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form\n ( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form\n formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration\n formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration\n formAction.indexOf('paypal.com') !== -1 ||\n formAction.indexOf('infusionsoft.com') !== -1 ||\n formAction.indexOf('webto.salesforce.com') !== -1 ||\n formAction.indexOf('secure2.convio.net') !== -1 ||\n formAction.indexOf('hookb.in') !== -1 ||\n formAction.indexOf('external.url') !== -1 ||\n formAction.indexOf('tp.media') !== -1 ||\n formAction.indexOf('flodesk.com') !== -1 ||\n formAction.indexOf('sendfox.com') !== -1 ||\n formAction.indexOf('aweber.com') !== -1 ||\n formAction.indexOf('secure.payu.com') !== -1 ||\n formAction.indexOf('mautic') !== -1 || formId.indexOf('mauticform_') !== -1\n ) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Sending Ajax for checking form data\n */\nfunction sendAjaxCheckingFormData(form, prev, formOriginal) {\n // Get visible fields and set cookie\n var visible_fields = {};\n visible_fields[0] = apbct_collect_visible_fields(form);\n apbct_visible_fields_set_cookie( visible_fields );\n\n var data = {};\n var elems = form.elements;\n elems = Array.prototype.slice.call(elems);\n\n elems.forEach( function( elem, y ) {\n if( elem.name === '' ) {\n data['input_' + y] = elem.value;\n } else {\n data[elem.name] = elem.value;\n }\n });\n\n apbct_public_sendAJAX(\n data,\n {\n async: false,\n callback: function( result, data, params, obj ){\n\n if( result.apbct === undefined || ! +result.apbct.blocked ) {\n\n let form_new = jQuery(form).detach();\n let prev = form.apbctPrev;\n let formOriginal = form.apbctFormOriginal;\n\n apbct_replace_inputs_values_from_other_form(form_new, formOriginal);\n\n prev.after( formOriginal );\n\n // Clear visible_fields input\n jQuery(formOriginal).find('input[name=\"apbct_visible_fields\"]').remove();\n jQuery(formOriginal).find('input[value=\"cleantalk_force_ajax_check\"]').remove();\n\n // Common click event\n var subm_button = jQuery(formOriginal).find('button[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n subm_button = jQuery(formOriginal).find('input[type=submit]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // ConvertKit direct integration\n subm_button = jQuery(formOriginal).find('button[data-element=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n return;\n }\n\n // Paypal integration\n subm_button = jQuery(formOriginal).find('input[type=\"image\"][name=\"submit\"]');\n if( subm_button.length !== 0 ) {\n subm_button[0].click();\n }\n\n }\n if (result.apbct !== undefined && +result.apbct.blocked) {\n ctParseBlockMessage(result);\n }\n }\n }\n );\n}\n\nfunction ct_check_internal(currForm){\n \n//Gathering data\n var ct_data = {},\n elems = currForm.elements;\n\n for (var key in elems) {\n if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')\n continue;\n ct_data[elems[key].name] = currForm.elements[key].value;\n }\n ct_data['action'] = 'ct_check_internal';\n\n //AJAX Request\n apbct_public_sendAJAX(\n ct_data,\n {\n url: ctPublicFunctions._ajax_url,\n callback: function (data) {\n if(data.success === true){\n currForm.submit();\n }else{\n alert(data.data);\n return false;\n }\n }\n }\n );\n}\n\ndocument.addEventListener('DOMContentLoaded',function(){\n let ct_currAction = '',\n ct_currForm = '';\n\n if( ! +ctPublic.settings__forms__check_internal ) {\n return;\n }\n\n let ctPrevHandler;\n\tfor( let i=0; i<document.forms.length; i++ ){\n\t\tif ( typeof(document.forms[i].action) == 'string' ){\n ct_currForm = document.forms[i];\n\t\t\tct_currAction = ct_currForm.action;\n if (\n ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory\n ct_currAction.match(ctPublic.blog_home + '.*?\\.php') !== null && // Main check\n ! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing\n ) {\n ctPrevHandler = ct_currForm.click;\n if ( typeof jQuery !== 'undefined' ) {\n jQuery(ct_currForm).off('**');\n jQuery(ct_currForm).off();\n jQuery(ct_currForm).on('submit', function(event){\n ct_check_internal(event.target);\n return false;\n });\n }\n }\n\t\t}\n\t}\n});\n\n/**\n * Check by action to exclude the form checking\n * @param action string\n * @return boolean\n */\nfunction ct_check_internal__is_exclude_form(action) {\n // An array contains forms action need to be excluded.\n let ct_internal_script_exclusions = [\n 'wp-login.php', // WordPress login page\n 'wp-comments-post.php', // WordPress Comments Form\n ];\n\n return ct_internal_script_exclusions.some((item) => {\n return action.match(new RegExp(ctPublic.blog_home + '.*' + item)) !== null;\n });\n}"],"names":["ApbctCore","ajax_parameters","rest_parameters","#selector","elements","#eventCallback","#eventSelector","#event","constructor","selector","this","select","HTMLCollection","Array","prototype","slice","call","document","querySelectorAll","#deselect","#addElement","elemToAdd","push","#push","elem","#reduce","css","style","getRaw","let","style_name","DOM_style_name","replace","group","toUpperCase","i","length","computedStyle","getComputedStyle","Number","hide","prop","display","show","addClass","classList","add","className","removeClass","remove","toggleClass","toggle","ajax","ApbctAjax","rest","ApbctRest","on","args","addEventListener","#onChecker","bind","event","target","querySelector","stopPropagation","ready","callback","change","attr","attrName","outputValue","propName","value","html","val","data","name","is","filter","#isElem","elemToCheck","match","newlyCreatedElement","createElement","Boolean","HTMLElement","HTMLUnknownElement","indexOf","tagName","toLowerCase","#isWithoutSelector","splice","parent","parentElement","parents","children","siblings","current","after","content","append","fadeIn","time","opacity","last","Date","tick","window","requestAnimationFrame","setTimeout","fadeOut","apbct","params","ApbctXhr","#xhr","XMLHttpRequest","method","url","async","user","password","button","spinner","progressbar","context","onErrorCallback","responseType","headers","timeout","#methods_to_convert_data_to_URL","#body","#http_code","#status_text","parameters","key","console","log","#prepare","Object","keys","deleteDoubleJSONEncoding","convertData","open","setHeaders","onreadystatechange","onReadyStateChange","onload","onLoad","onprogress","onProgress","onerror","onError","ontimeout","onTimeout","send","setAttribute","cursor","#complete","status","statusText","removeAttribute","on_ready_state_change","on_progress","#error","response","error","http_code","status_text","additional_msg","error_string","errorOutput","error_msg","header_name","setRequestHeader","convertDataToURL","convertDataToBody","params_appendix","URLSearchParams","toString","params_prefix","dataKey","FormData","JSON","stringify","object","objectKey","parsedValue","parse","super","default_route","ctPublicFunctions","_rest_url","route","X-WP-Nonce","_rest_nonce","ctSetCookie","cookies","expires","skip_alt","data__cookies_type","forEach","item","arr","apbctLocalStorage","set","encodeURIComponent","ctNoCookieAttachHiddenFieldsToForms","ctSecure","location","protocol","cookie","cookiePrefix","getJavascriptClientData","e","data__ajax_type","apbct_public_sendREST","apbct_public_sendAJAX","action","notJson","ctGetCookie","matches","RegExp","decodeURIComponent","undefined","ctDeleteCookie","cookieName","obj","_params","callback_context","callback_params","silent","no_nonce","_ajax_url","_ajax_nonce","Math","random","no_cache","get","property","storageValue","localStorage","getItem","json","hasOwnProperty","is_json","objToSave","timestamp","floor","getTime","setItem","isAlive","maxLifetime","isSet","delete","removeItem","getCleanTalkData","ct_date","ctTimeMs","ctMouseEventTimerFlag","ctMouseData","ctMouseDataCounter","ctCheckedEmails","apbct_attach_event_handler","attachEvent","apbct_remove_event_handler","removeEventListener","detachEvent","ctFunctionFirstKey","ctKeyStopStopListening","ctMouseReadInterval","setInterval","ctMouseWriteDataInterval","ctFunctionMouseMove","ctSetMouseMoved","round","clientY","clientX","ctMouseStopData","clearInterval","checkEmail","current_email","email","result","now","ctSetPixelImg","pixelUrl","insertedImg","ctPublic","pixel__enabled","getElementById","ctGetPixelUrl","local_storage_pixel_url","ctSetHasScrolled","ctPreloadLocalStorage","data__to_local_storage","entries","apbct_ready","cookiesType","initCookies","getTimezoneOffset","apbctGetScreenInfo","navigator","webdriver","cookiesArray","split","trim","pixel__setting","pixel__url","data__email_check_before_post","forms","hiddenInput","visibleFieldsToInput","form","data__visible_fields_required","contains","id","apbct_collect_visible_fields","onsubmit_prev","onsubmit","ctFormIndex","visible_fields","apbct_visible_fields_set_cookie","Function","decodedEmailNodes","href","ctFillDecodedEmailHandler","apbctAjaxEmailDecode","baseElement","element","event_javascript_data","post_url","referrer","apbctTooltip","preventDefault","text__wait_for_decoding","apbctTooltipText","apbctTooltipArrow","ctShowDecodeComment","encodedEmail","dataset","originalString","baseElementContent","success","getElementsByClassName","innerHTML","decoded_email","click","ctProcessDecodedDataResult","res","common_cookies","resultDataJson","apbct_headless","apbct_pixel_url","ct_checked_emails","ct_checkjs","ct_fkp_timestamp","ct_pointer_data","ct_ps_timestamp","ct_screen_info","ct_timezone","ctMouseMovedLocalStorage","ctHasScrolledLocalStorage","ctCookiesTypeLocalStorage","ctMouseMovedCookie","ctHasScrolledCookie","ctCookiesTypeCookie","ct_mouse_moved","ct_has_scrolled","ct_cookies_type","removeDoubleJsonEncoding","targetElement","is_allowed","ctFillDecodedEmail","show_comment","comment","inputs","inputs_visible","inputs_visible_count","inputs_invisible","inputs_invisible_count","inputs_with_duplicate_names","isNaN","getAttribute","visibility","visible_fields_count","invisible_fields","invisible_fields_count","visible_fields_collection","form_id","collection","apbct_js_keys__set_input_value","js_key","fullWidth","documentElement","scrollWidth","fullHeight","max","body","scrollHeight","offsetHeight","clientHeight","visibleWidth","clientWidth","visibleHeight","ctParseBlockMessage","blocked","dispatchEvent","CustomEvent","bubbles","detail","message","cleantalkModal","loaded","stop_script","stop","ctSetPixelUrlLocalstorage","ajax_pixel_url","ctNoCookieConstructHiddenField","field","no_cookie_data","btoa","ctNoCookieGetForms","getElementsByName","j","parentNode","removeChild","jQuery","ajaxComplete","xhr","settings","responseText","loading","opened","opening","load","apbct_admin_sendAJAX","renderCss","cssStr","styles","overlayCss","z-index","position","top","left","width","height","background","justify-content","align-items","innerCss","padding","border","border-radius","box-shadow","closeCss","right","box-sizing","closeCssBefore","transform","closeCssAfter","bodyCss","overflow","cleantalkModalStyle","overlay","inner","close","buttons_to_handle","gdpr_notice_for_button","apbct_gdpr_handle_buttons","index","apbct_gdpr_item","disabled","old_notice","info","ct_protect_external","cleantalk_hidden_action","cleantalk_hidden_method","ct_method","currentForm","isIntegratedForm","apbctProcessExternalForm","hostname","ct_action","type","appendChild","frames","getElementsByTagName","contentDocument","iframeForms","y","iterator","documentObject","cleantalk_placeholder","prev","insertBefore","previousSibling","form_html","outerHTML","form_original","placeholder","force_action","firstElementChild","reUseCurrentForm","mailerlite_detected_class","apbctPrev","apbctFormOriginal","mailerlite_class","mailerliteSubmitButton","find","sendAjaxCheckingFormData","currentTarget","clone","apbct_replace_inputs_values_from_other_form","form_source","form_target","inputs_source","inputs_target","each","elem_source","source","index2","elem_target","formObj","formAction","formId","firstChild","formOriginal","elems","form_new","detach","subm_button","ct_check_internal","currForm","ct_data","alert","submit","ct_check_internal__is_exclude_form","some","blog_home","ctPublicGDPR","gdpr_forms","first","buttons_collection","gdpr_text","settings__forms__check_external","ct_currForm","ct_currAction","settings__forms__check_internal","off"],"mappings":"MAAMA,UAEFC,gBAAkB,GAClBC,gBAAkB,GAElBC,UAAY,KACZC,SAAW,GAGXC,eACAC,eACAC,OAKAC,YAAYC,GACRC,KAAKC,OAAOF,CAAQ,CACxB,CAQAE,OAAOF,GAkBH,OAhBGA,aAAoBG,gBACnBF,KAAKP,UAAe,KACpBO,KAAKN,SAAc,GACnBM,KAAKN,SAAWS,MAAMC,UAAUC,MAAMC,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ogB,EADAC,EAAgB,GAGpB,GAAM,CAACnQ,SAASoQ,gCAKnB,IAAKtgB,IAAIM,EAAE,EAAGA,EAAElB,SAASoS,MAAMjR,OAAQD,CAAC,GACE,UAApC,OAAOlB,SAASoS,MAAMlR,GAAS,QAIiB,QAFpD+f,GADSD,EAAchhB,SAASoS,MAAMlR,IACVsL,QAEDlI,QAAQ,WAAW,GACwB,OAAzD2c,EAAcjd,MAAM8M,SAAS2P,UAAY,SAAU,GACjDF,mCAAmCU,CAAa,IAElCD,EAAYvM,MACL,aAAlB,OAAOgF,SACRA,OAAOuH,CAAW,EAAEG,IAAI,IAAI,EAC5B1H,OAAOuH,CAAW,EAAEG,IAAI,EACxB1H,OAAOuH,CAAW,EAAEze,GAAG,SAAU,SAASK,GAEtC,OADAsd,kBAAkBtd,EAAMC,MAAM,EACvB,CAAA,CACX,CAAC,GAKrB,CAAC"}
|
js/cleantalk-admin-settings-page.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
function apbct_banner_check(){var c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbct_get_elems(t){for(var e,n=0,a=(t=t.split(",")).length;n<a;n++)e=jQuery("#"+t[n]),t[n]=0===e.length?jQuery("."+t[n]):e;return t}function apbct_get_elems__native(t){"string"==typeof t&&(t=t.split(","));var c=[];return t.forEach(function(t,e,n){var a=document.getElementById(t);if(null!==a)c.push(a[key]);else if(null!==(a=document.getElementsByClassName(t))&&0!==a.length)for(key in a)0<=+key&&c.push(a[key])}),c}function apbct_show_hide_elem(t){for(var e=0,n=(t=apbct_get_elems(t)).length;e<n;e++)t[e].each(function(t,e){var n=(e=jQuery(e)).next("label")||e.prev("label")||null;e.is(":visible")?(e.hide(),n&&n.hide()):(e.show(),n&&n.show())})}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbct_get_elems__native(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null!==t.getAttribute("apbct_children")&&null!==(a=apbctSettingsDependencies_getState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependencies_getState(t){var e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbct_settings__showDescription(t,e){function c(t){void 0!==t&&(0!=jQuery(t.target).parent(".apbct_long_desc").length&&!jQuery(t.target).hasClass("apbct_long_desc__cancel")||jQuery(t.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",c))}c(),t.after("<div id='apbct_long_desc__"+e+"' class='apbct_long_desc'></div>");var n=jQuery("#apbct_long_desc__"+e);n.append("<i class= 'apbct-icon-spin1 animate-spin'></i>").append("<div class='apbct_long_desc__angle'></div>").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.empty().append("<div class='apbct_long_desc__angle'></div>").append("<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>").append("<h3 class='apbct_long_desc__title'>"+t.title+"</h3>").append("<p>"+t.desc+"</p>"),jQuery(document).on("click",c)}},n)}function apbct_save_button_position(){var t,e,n,a,c,s,i,o;null!==document.getElementById("apbct_settings__before_advanced_settings")&&null!==document.getElementById("apbct_settings__after_advanced_settings")&&null!==document.getElementById("apbct_settings__button_section")&&null!==document.getElementById("apbct_settings__advanced_settings")&&null!==document.getElementById("apbct_hidden_section_nav")&&(t=window.innerHeight,n=(e=document.getElementById("apbct_settings__advanced_settings")).getBoundingClientRect().top,c=(a=document.getElementById("apbct_settings__button_section")).getBoundingClientRect().height,i=(s=document.getElementById("apbct_hidden_section_nav")).getBoundingClientRect().top,o=s.getBoundingClientRect().height,"none"!==getComputedStyle(e).display?(jQuery("#apbct_settings__main_save_button").hide(),t<i+o+c?(a.style.bottom="",a.style.top=i+o+20+"px"):(a.style.bottom=0,a.style.top="")):jQuery("#apbct_settings__main_save_button").show(),s.style.top=n<=0?30-n+"px":0)}function apbct_highlight_element(t,e){e=e-1||0;let n=jQuery("#"+t);jQuery("html, body").animate({scrollTop:n.offset().top-100},"slow"),n.addClass("apbct_highlighted"),n.animate({opacity:0},400,"linear",function(){n.animate({opacity:1},400,"linear",function(){0<e?apbct_highlight_element(t,e):n.removeClass("apbct_highlighted")})})}jQuery(document).ready(function(){jQuery(".apbct_setting---data__email_decoder").on("click",t=>{var e;"checkbox"===t.target.type?(e=t.target.checked?"__On":"__Off",document.getElementById("apbct_setting_data__email_decoder"+e).checked=!0):document.getElementById("apbct_setting_data__email_decoder").checked=1===parseInt(t.target.value)}),document.getElementsByClassName("apbct_settings-title")[0]&&"rtl"===getComputedStyle(document.getElementsByClassName("apbct_settings-title")[0]).direction&&jQuery(".apbct_switchers").css("text-align","right"),jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});var t=new Date;jQuery("#ct_admin_timezone").val(t.getTimezoneOffset()/60*-1),jQuery("#apbct_button__get_key_auto").on("click",function(){apbct_admin_sendAJAX({action:"apbct_get_key_auto"},{timeout:25e3,button:document.getElementById("apbct_button__get_key_auto"),spinner:jQuery("#apbct_button__get_key_auto .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__get_key_auto .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__get_key_auto .apbct_success").hide(300)},2e3),t.reload&&document.location.reload(),t.getTemplates&&(cleantalkModal.loaded=t.getTemplates,cleantalkModal.open(),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}))}})}),jQuery(document).on("click","#apbct_settings_templates_import_button",function(){jQuery("#apbct-ajax-result").remove();var c,t=jQuery("option:selected",jQuery("#apbct_settings_templates_import"));jQuery("#apbct_settings_templates_import_name").css("border-color","inherit"),void 0===t.data("id")?console.log('Attribute "data-id" not set for the option.'):(t={template_id:t.data("id"),template_name:t.data("name"),settings:t.data("settings")},c=this,apbct_admin_sendAJAX({action:"settings_templates_import",data:t},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_import_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}}))}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");if(e.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===t.data("id")){var n=e.val();if(""===n)return void e.css("border-color","red");n={template_name:n}}else n={template_id:t.data("id")};var c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){var c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&document.location.reload()}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){apbct_settings__showDescription(self=jQuery(this),self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbct_banner_check(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbct_save_button_position(),window.addEventListener("scroll",apbct_save_button_position),jQuery("#ct_adv_showhide a").on("click",apbct_save_button_position),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var t=jQuery(this),e=jQuery("#apbct-account-email"),n=e.text();t.toggleClass("active"),t.hasClass("active")?(t.text(t.data("save-text")),e.attr("contenteditable","true"),e.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),e.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:n},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),e.attr("contenteditable","false"),t.text(t.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val();jQuery('button.cleantalk_link[value="save_changes"]').off("click"),""!==t&&null===t.match(/^[a-z\d]{3,30}\s*$/)&&(jQuery("#apbct_button__get_key_auto__wrapper").show(),jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#apbct_bad_key_notice").length||jQuery("<div class='apbct_notice_inner error'><h4 id='apbct_bad_key_notice'>Please, insert a correct access key before saving changes!</h4></div>").insertAfter(jQuery("#apbct_setting_apikey")),apbct_highlight_element("apbct_setting_apikey",3)}))}),jQuery("#apbct_setting_apikey").val()&&ctSettingsPage.key_is_ok&&jQuery("#apbct_button__get_key_auto__wrapper").hide(),ctSettingsPage.key_is_ok||jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#sync_required_notice").length||jQuery("<div class='apbct_notice_inner error'><h4 id='sync_required_notice'>Synchronization process failed. Please, check the acces key and restart the synch.<h4></div>").insertAfter(jQuery("#apbct_button__sync")),apbct_highlight_element("apbct_setting_apikey",3),apbct_highlight_element("apbct_button__sync",3),jQuery("#apbct_button__get_key_auto__wrapper").show()})});
|
2 |
//# sourceMappingURL=cleantalk-admin-settings-page.min.js.map
|
1 |
+
function apbct_banner_check(){var c=setInterval(function(){apbct_admin_sendAJAX({action:"apbct_settings__check_renew_banner"},{callback:function(t,e,n,a){t.close_renew_banner&&(jQuery("#cleantalk_notice_renew").length&&jQuery("#cleantalk_notice_renew").hide("slow"),jQuery("#cleantalk_notice_trial").length&&jQuery("#cleantalk_notice_trial").hide("slow"),clearInterval(c))}})},9e5)}function apbct_get_elems(t){for(var e,n=0,a=(t=t.split(",")).length;n<a;n++)e=jQuery("#"+t[n]),t[n]=0===e.length?jQuery("."+t[n]):e;return t}function apbct_get_elems__native(t){"string"==typeof t&&(t=t.split(","));var c=[];return t.forEach(function(t,e,n){var a=document.getElementById(t);if(null!==a)c.push(a[key]);else if(null!==(a=document.getElementsByClassName(t))&&0!==a.length)for(key in a)0<=+key&&c.push(a[key])}),c}function apbct_show_hide_elem(t){for(var e=0,n=(t=apbct_get_elems(t)).length;e<n;e++)t[e].each(function(t,e){var n=(e=jQuery(e)).next("label")||e.prev("label")||null;e.is(":visible")?(e.hide(),n&&n.hide()):(e.show(),n&&n.show())})}function apbctSettingsDependencies(t,c){c=isNaN(c)?null:c,apbct_get_elems__native(t).forEach(function(t,e,n){var a;1===(c=null===c?null===t.getAttribute("disabled")?0:1:c)?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled"),null!==t.getAttribute("apbct_children")&&null!==(a=apbctSettingsDependencies_getState(t)&&c)&&apbctSettingsDependencies(t.getAttribute("apbct_children"),a)})}function apbctSettingsDependencies_getState(t){var e;switch(t.getAttribute("type")){case"checkbox":e=+t.checked;break;case"radio":e=+(1==+t.getAttribute("value"));break;default:e=null}return e}function apbct_settings__showDescription(t,e){function c(t){void 0!==t&&(0!=jQuery(t.target).parent(".apbct_long_desc").length&&!jQuery(t.target).hasClass("apbct_long_desc__cancel")||jQuery(t.target).hasClass("apbct_long_description__show"))||(jQuery(".apbct_long_desc").remove(),jQuery(document).off("click",c))}c(),t.after("<div id='apbct_long_desc__"+e+"' class='apbct_long_desc'></div>");var n=jQuery("#apbct_long_desc__"+e);n.append("<i class= 'apbct-icon-spin1 animate-spin'></i>").append("<div class='apbct_long_desc__angle'></div>").css({top:t.position().top-5,left:t.position().left+25}),apbct_admin_sendAJAX({action:"apbct_settings__get__long_description",setting_id:e},{spinner:n.children("img"),callback:function(t,e,n,a){a.empty().append("<div class='apbct_long_desc__angle'></div>").append("<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>").append("<h3 class='apbct_long_desc__title'>"+t.title+"</h3>").append("<p>"+t.desc+"</p>"),jQuery(document).on("click",c)}},n)}function apbct_save_button_position(){var t,e,n,a,c,s,i,o;null!==document.getElementById("apbct_settings__before_advanced_settings")&&null!==document.getElementById("apbct_settings__after_advanced_settings")&&null!==document.getElementById("apbct_settings__button_section")&&null!==document.getElementById("apbct_settings__advanced_settings")&&null!==document.getElementById("apbct_hidden_section_nav")&&(t=window.innerHeight,n=(e=document.getElementById("apbct_settings__advanced_settings")).getBoundingClientRect().top,c=(a=document.getElementById("apbct_settings__button_section")).getBoundingClientRect().height,i=(s=document.getElementById("apbct_hidden_section_nav")).getBoundingClientRect().top,o=s.getBoundingClientRect().height,"none"!==getComputedStyle(e).display?(jQuery("#apbct_settings__main_save_button").hide(),t<i+o+c?(a.style.bottom="",a.style.top=i+o+20+"px"):(a.style.bottom=0,a.style.top="")):jQuery("#apbct_settings__main_save_button").show(),s.style.top=n<=0?30-n+"px":0)}function apbct_highlight_element(t,e){e=e-1||0;let n=jQuery("#"+t);jQuery("html, body").animate({scrollTop:n.offset().top-100},"slow"),n.addClass("apbct_highlighted"),n.animate({opacity:0},400,"linear",function(){n.animate({opacity:1},400,"linear",function(){0<e?apbct_highlight_element(t,e):n.removeClass("apbct_highlighted")})})}jQuery(document).ready(function(){jQuery(".apbct_setting---data__email_decoder").on("click",t=>{var e;"checkbox"===t.target.type?(e=t.target.checked?"__On":"__Off",document.getElementById("apbct_setting_data__email_decoder"+e).checked=!0):document.getElementById("apbct_setting_data__email_decoder").checked=1===parseInt(t.target.value)}),document.getElementsByClassName("apbct_settings-title")[0]&&"rtl"===getComputedStyle(document.getElementsByClassName("apbct_settings-title")[0]).direction&&jQuery(".apbct_switchers").css("text-align","right"),jQuery("#apbct_showApiKey").on("click",function(){jQuery(".apbct_setting---apikey").val(jQuery(".apbct_setting---apikey").attr("key")),jQuery(".apbct_setting---apikey+div").show(),jQuery(this).fadeOut(300)});var t=new Date;jQuery("#ct_admin_timezone").val(t.getTimezoneOffset()/60*-1),jQuery("#apbct_button__get_key_auto").on("click",function(){apbct_admin_sendAJAX({action:"apbct_get_key_auto"},{timeout:25e3,button:document.getElementById("apbct_button__get_key_auto"),spinner:jQuery("#apbct_button__get_key_auto .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__get_key_auto .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__get_key_auto .apbct_success").hide(300)},2e3),t.reload&&document.location.reload(),t.getTemplates&&(cleantalkModal.loaded=t.getTemplates,cleantalkModal.open(),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}))}})}),jQuery(document).on("click","#apbct_settings_templates_import_button",function(){jQuery("#apbct-ajax-result").remove();var c,t=jQuery("option:selected",jQuery("#apbct_settings_templates_import"));jQuery("#apbct_settings_templates_import_name").css("border-color","inherit"),void 0===t.data("id")?console.log('Attribute "data-id" not set for the option.'):(t={template_id:t.data("id"),template_name:t.data("name"),settings:t.data("settings")},c=this,apbct_admin_sendAJAX({action:"settings_templates_import",data:t},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_import_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_import_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_import_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}}))}),jQuery(document).on("click","#apbct_settings_templates_export_button",function(){jQuery("#apbct-ajax-result").remove();var t=jQuery("option:selected",jQuery("#apbct_settings_templates_export")),e=jQuery("#apbct_settings_templates_export_name");if(e.css("border-color","inherit"),void 0===t.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===t.data("id")){var n=e.val();if(""===n)return void e.css("border-color","red");n={template_name:n}}else n={template_id:t.data("id")};var c=this;apbct_admin_sendAJAX({action:"settings_templates_export",data:n},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_export_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_export_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_export_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}}),jQuery(document).on("click","#apbct_settings_templates_reset_button",function(){var c=this;apbct_admin_sendAJAX({action:"settings_templates_reset"},{timeout:25e3,button:c,spinner:jQuery("#apbct_settings_templates_reset_button .apbct_preloader_button"),notJson:!0,callback:function(t,e,n,a){t.success?(jQuery("<p id='apbct-ajax-result' class='success'>"+t.data+"</p>").insertAfter(jQuery(c)),jQuery("#apbct_settings_templates_reset_button .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_settings_templates_reset_button .apbct_success").hide(300)},2e3),document.addEventListener("cleantalkModalClosed",function(t){document.location.reload()}),setTimeout(function(){cleantalkModal.close()},2e3)):jQuery("<p id='apbct-ajax-result' class='error'>"+t.data+"</p>").insertAfter(jQuery(c))}})}),jQuery("#apbct_button__sync").on("click",function(){apbct_admin_sendAJAX({action:"apbct_sync"},{timeout:25e3,button:document.getElementById("apbct_button__sync"),spinner:jQuery("#apbct_button__sync .apbct_preloader_button"),callback:function(t,e,n,a){jQuery("#apbct_button__sync .apbct_success").show(300),setTimeout(function(){jQuery("#apbct_button__sync .apbct_success").hide(300)},2e3),t.reload&&document.location.reload()}})}),ctSettingsPage.key_changed&&jQuery("#apbct_button__sync").click(),jQuery(document).on("click",".apbct_settings-long_description---show",function(){apbct_settings__showDescription(self=jQuery(this),self.attr("setting"))}),(jQuery("#cleantalk_notice_renew").length||jQuery("#cleantalk_notice_trial").length)&&apbct_banner_check(),jQuery(document).on("change","#apbct_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").show():jQuery(this).parent().parent().find("#apbct_settings_templates_export_name").hide()}),apbct_save_button_position(),window.addEventListener("scroll",apbct_save_button_position),jQuery("#ct_adv_showhide a").on("click",apbct_save_button_position),jQuery("#apbct-change-account-email").on("click",function(t){t.preventDefault();var t=jQuery(this),e=jQuery("#apbct-account-email"),n=e.text();t.toggleClass("active"),t.hasClass("active")?(t.text(t.data("save-text")),e.attr("contenteditable","true"),e.on("keydown",function(t){"Enter"===t.code&&t.preventDefault()}),e.on("input",function(t){"insertParagraph"===t.inputType&&t.preventDefault()})):(apbct_admin_sendAJAX({action:"apbct_update_account_email",accountEmail:n},{timeout:5e3,callback:function(t,e,n,a){void 0!==t.success&&"ok"===t.success&&void 0!==t.manuallyLink&&jQuery("#apbct-key-manually-link").attr("href",t.manuallyLink),void 0!==t.error&&jQuery("#apbct-account-email").css("border-color","red")}}),e.attr("contenteditable","false"),t.text(t.data("default-text")))}),jQuery("#apbct_setting_apikey").on("input",function(){var t=jQuery(this).val();jQuery('button.cleantalk_link[value="save_changes"]').off("click"),""!==t&&null===t.match(/^[a-z\d]{3,30}\s*$/)&&(jQuery("#apbct_button__get_key_auto__wrapper").show(),jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#apbct_bad_key_notice").length||jQuery("<div class='apbct_notice_inner error'><h4 id='apbct_bad_key_notice'>Please, insert a correct access key before saving changes!</h4></div>").insertAfter(jQuery("#apbct_setting_apikey")),apbct_highlight_element("apbct_setting_apikey",3)}))}),jQuery("#apbct_setting_apikey").val()&&ctSettingsPage.key_is_ok&&jQuery("#apbct_button__get_key_auto__wrapper").hide(),ctSettingsPage.key_is_ok||jQuery('button.cleantalk_link[value="save_changes"]').on("click",function(t){t.preventDefault(),jQuery("#sync_required_notice").length||jQuery("<div class='apbct_notice_inner error'><h4 id='sync_required_notice'>Synchronization process failed. Please, check the acces key and restart the synch.<h4></div>").insertAfter(jQuery("#apbct_button__sync")),apbct_highlight_element("apbct_setting_apikey",3),apbct_highlight_element("apbct_button__sync",3),jQuery("#apbct_button__get_key_auto__wrapper").show()}),jQuery("#apbct-custom-logo-open-gallery").click(function(t){t.preventDefault();const e=jQuery(this),n=wp.media({library:{type:"image"},multiple:!1});n.on("select",function(){var t=n.state().get("selection").first().toJSON();e.parent().prev().attr("src",t.url),jQuery("#cleantalk_custom_logo").val(t.id)}),n.open()}),jQuery("#apbct-custom-logo-remove-image").click(function(t){t.preventDefault(),!0===confirm("Sure?")&&(t=jQuery(this).parent().prev().data("src"),jQuery(this).parent().prev().attr("src",t),jQuery(this).prev().prev().val(""))})});
|
2 |
//# sourceMappingURL=cleantalk-admin-settings-page.min.js.map
|
js/cleantalk-admin-settings-page.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-admin-settings-page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function(){\n\n\t// Top level settings\n\tjQuery('.apbct_setting---data__email_decoder').on('click', (event) => {\n\t\tif ( event.target.type === 'checkbox' ) {\n\t\t\tconst postFix = event.target.checked ? '__On' : '__Off';\n\t\t\tdocument.getElementById('apbct_setting_data__email_decoder' + postFix).checked = true;\n\t\t} else {\n\t\t\tdocument.getElementById('apbct_setting_data__email_decoder').checked = parseInt(event.target.value) === 1;\n\t\t}\n\t});\n\n\t// Crunch for Right to Left direction languages\n\tif(document.getElementsByClassName('apbct_settings-title')[0]) {\n\t\tif(getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl'){\n\t\t\tjQuery('.apbct_switchers').css('text-align', 'right');\n\t\t}\n\t}\n\n\t// Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function(){\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\n jQuery('.apbct_setting---apikey+div').show();\n jQuery(this).fadeOut(300);\n });\n\n\tvar d = new Date();\n\tjQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\n\n\t// Key KEY automatically\n\tjQuery('#apbct_button__get_key_auto').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_get_key_auto'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__get_key_auto' ),\n\t\t\t\tspinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\tif(result.getTemplates) {\n\t\t\t\t\t\tcleantalkModal.loaded = result.getTemplates;\n\t\t\t\t\t\tcleantalkModal.open();\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Import settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_import_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_import_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tvar data = {\n\t\t\t'template_id' : optionSelected.data('id'),\n\t\t\t'template_name' : optionSelected.data('name'),\n\t\t\t'settings' : optionSelected.data('settings')\n\t\t};\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_import', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Export settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_export_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_export_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tif( optionSelected.data('id') === 'new_template' ) {\n\t\t\tvar templateName = templateNameInput.val();\n\t\t\tif( templateName === '' ) {\n\t\t\t\ttemplateNameInput.css('border-color', 'red');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar data = {\n\t\t\t\t'template_name' : templateName\n\t\t\t}\n\t\t} else {\n\t\t\tvar data = {\n\t\t\t\t'template_id' : optionSelected.data('id')\n\t\t\t}\n\t\t}\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_export', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Reset settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_reset_button', function(){\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_reset'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Sync button\n\tjQuery('#apbct_button__sync').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_sync'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__sync' ),\n\t\t\t\tspinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__sync .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__sync .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\tif( ctSettingsPage.key_changed )\n\t\tjQuery('#apbct_button__sync').click();\n\n\tjQuery(document).on('click', '.apbct_settings-long_description---show', function(){\n\t\tself = jQuery(this);\n\t\tapbct_settings__showDescription(self, self.attr('setting'));\n\t});\n\n\tif (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length)\n\t\tapbct_banner_check();\n\n\tjQuery(document).on('change', '#apbct_settings_templates_export',function(){\n\t\tvar optionSelected = jQuery(\"option:selected\", this);\n\t\tif ( optionSelected.data(\"id\") === 'new_template' ) {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n\t\t} else {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n\t\t}\n\t});\n\n\tapbct_save_button_position();\n\twindow.addEventListener('scroll', apbct_save_button_position);\n\tjQuery('#ct_adv_showhide a').on('click', apbct_save_button_position);\n\n\n\t/**\n\t * Change cleantalk account email\n\t */\n\tjQuery('#apbct-change-account-email').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\tvar $this = jQuery(this);\n\t\tvar accountEmailField = jQuery('#apbct-account-email');\n\t\tvar accountEmail = accountEmailField.text();\n\n\t\t$this.toggleClass('active');\n\n\t\tif ($this.hasClass('active')) {\n\t\t\t$this.text($this.data('save-text'));\n\t\t\taccountEmailField.attr('contenteditable', 'true');\n\t\t\taccountEmailField.on('keydown', function (e) {\n\t\t\t\tif (e.code === 'Enter') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}\n\t\t\t})\n\t\t\taccountEmailField.on('input', function (e) {\n\t\t\t\tif (e.inputType === 'insertParagraph') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tapbct_admin_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_update_account_email',\n\t\t\t\t\taccountEmail: accountEmail\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttimeout: 5000,\n\t\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\t\tif (result.success !== undefined && result.success === 'ok') {\n\t\t\t\t\t\t\tif (result.manuallyLink !== undefined) {\n\t\t\t\t\t\t\t\tjQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (result.error !== undefined) {\n\t\t\t\t\t\t\tjQuery('#apbct-account-email').css('border-color', 'red');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\taccountEmailField.attr('contenteditable', 'false');\n\t\t\t$this.text($this.data('default-text'));\n\t\t}\n\t});\n\n\t/**\n\t * Validate apkikey and hide get auto btn\n\t */\n\tjQuery('#apbct_setting_apikey').on('input', function () {\n\t\tvar enteredValue = jQuery(this).val();\n\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').off('click')\n\t\tif (enteredValue !== '' && enteredValue.match(/^[a-z\\d]{3,30}\\s*$/) === null) {\n\t\t\tjQuery('#apbct_button__get_key_auto__wrapper').show();\n\t\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n\t\t\t\t\tfunction (e) {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tif (!jQuery('#apbct_bad_key_notice').length){\n\t\t\t\t\t\t\tjQuery( \"<div class='apbct_notice_inner error'><h4 id='apbct_bad_key_notice'>\" +\n\t\t\t\t\t\t\t\t\"Please, insert a correct access key before saving changes!\" +\n\t\t\t\t\t\t\t\t\"</h4></div>\" ).insertAfter( jQuery('#apbct_setting_apikey') );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tapbct_highlight_element('apbct_setting_apikey',3)\n\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\treturn;\n\t\t}\n\n\t});\n\n\tif ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {\n\t\tjQuery('#apbct_button__get_key_auto__wrapper').hide();\n\t}\n\n\t/**\n\t * Handle synchronization errors when key is no ok to force user check the key and restart the sync\n\t */\n\tif( !ctSettingsPage.key_is_ok ){\n\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n\t\t\tfunction (e) {\n\t\t\t\te.preventDefault()\n\t\t\t\tif (!jQuery('#sync_required_notice').length){\n\t\t\t\t\tjQuery( \"<div class='apbct_notice_inner error'><h4 id='sync_required_notice'>\" +\n\t\t\t\t\t\t\"Synchronization process failed. Please, check the acces key and restart the synch.\" +\n\t\t\t\t\t\t\"<h4></div>\" ).insertAfter( jQuery('#apbct_button__sync') );\n\t\t\t\t}\n\t\t\t\tapbct_highlight_element('apbct_setting_apikey',3)\n\t\t\t\tapbct_highlight_element('apbct_button__sync',3)\n\t\t\t\tjQuery('#apbct_button__get_key_auto__wrapper').show();\n\t\t\t}\n\t\t)\n\t}\n\n});\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbct_banner_check() {\n\tvar bannerChecker = setInterval( function() {\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_settings__check_renew_banner'},\n\t\t\t{\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif (result.close_renew_banner) {\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_renew').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_renew').hide('slow');\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_trial').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_trial').hide('slow');\n\t\t\t\t\t\tclearInterval(bannerChecker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param elems\n * @returns {*}\n */\nfunction apbct_get_elems(elems){\n elems = elems.split(',');\n for( var i=0, len = elems.length, tmp; i < len; i++){\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param elems string|array\n * @returns array\n */\nfunction apbct_get_elems__native(elems){\n\n\t// Make array from a string\n\tif(typeof elems === 'string')\n\t\telems = elems.split(',');\n\n\tvar out = [];\n\n\telems.forEach(function(elem, i, arr) {\n\n\t\t// try to get elements with such IDs\n\t\tvar tmp = document.getElementById(elem);\n\t\tif (tmp !== null){\n\t\t\tout.push( tmp[key] );\n\t\t\treturn;\n\t\t}\n\n\t\t// try to get elements with such class name\n\t\t// write each elem from collection to new element of output array\n\t\ttmp = document.getElementsByClassName(elem);\n\t\tif (tmp !== null && tmp.length !==0 ){\n\t\t\tfor(key in tmp){\n\t\t\t\tif( +key >= 0 ){\n\t\t\t\t\tout.push( tmp[key] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\treturn out;\n}\n\nfunction apbct_show_hide_elem(elems){\n\telems = apbct_get_elems(elems);\n for( var i=0, len = elems.length; i < len; i++){\n elems[i].each(function (i, elem) {\n elem = jQuery(elem);\n var label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(\":visible\")) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param ids string|array Selectors\n * @param enable\n */\nfunction apbctSettingsDependencies(ids, enable){\n\n\n\tenable = ! isNaN(enable) ? enable : null;\n\n\t// Get elements\n\tvar elems = apbct_get_elems__native( ids );\n\n\telems.forEach(function(elem, i, arr){\n\n\t\tvar do_disable = function(){elem.setAttribute('disabled', 'disabled');},\n\t\t\tdo_enable = function(){elem.removeAttribute('disabled');};\n\n\t\t// Set defined state\n\t\tif(enable === null) // Set\n\t\t\tenable = elem.getAttribute('disabled') === null ? 0 : 1;\n\n\t\tenable === 1 ? do_enable() : do_disable();\n\n\t\tif( elem.getAttribute('apbct_children') !== null){\n\t\t\tvar state = apbctSettingsDependencies_getState( elem ) && enable;\n\t\t\tif( state !== null ) {\n\t\t\t\tapbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n\t\t\t}\n\t\t}\n\n\t});\n}\n\nfunction apbctSettingsDependencies_getState( elem ){\n\n\tvar state;\n\n\tswitch ( elem.getAttribute( 'type' ) ){\n\t\tcase 'checkbox':\n\t\t\tstate = +elem.checked;\n\t\t\tbreak;\n\t\tcase 'radio':\n\t\t\tstate = +(+elem.getAttribute('value') === 1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstate = null;\n\t}\n\n\treturn state;\n}\n\nfunction apbct_settings__showDescription(label, setting_id){\n\n\tvar remove_desc_func = function(e){\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.apbct_long_desc').length == 0 || jQuery(e.target).hasClass('apbct_long_desc__cancel')) && !jQuery(e.target).hasClass('apbct_long_description__show'))){\n\t\t\tjQuery('.apbct_long_desc').remove();\n\t\t\tjQuery(document).off('click', remove_desc_func);\n\t\t}\n\t};\n\n\tremove_desc_func();\n\n\tlabel.after(\"<div id='apbct_long_desc__\"+setting_id+\"' class='apbct_long_desc'></div>\");\n\tvar obj = jQuery('#apbct_long_desc__'+setting_id);\n\tobj.append(\"<i class= 'apbct-icon-spin1 animate-spin'></i>\")\n\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t.css({\n\t\t\ttop: label.position().top - 5,\n\t\t\tleft: label.position().left + 25\n\t\t});\n\n\n\tapbct_admin_sendAJAX(\n\t\t{action: 'apbct_settings__get__long_description', setting_id: setting_id},\n\t\t{\n\t\t\tspinner: obj.children('img'),\n\t\t\tcallback: function(result, data, params, obj){\n\n\t\t\t\tobj.empty()\n\t\t\t\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t\t\t\t.append(\"<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>\")\n\t\t\t\t\t.append(\"<h3 class='apbct_long_desc__title'>\"+result.title+\"</h3>\")\n\t\t\t\t\t.append(\"<p>\"+result.desc+\"</p>\");\n\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\n\t\t\t}\n\t\t},\n\t\tobj\n\t);\n}\n\nfunction apbct_save_button_position() {\n\tif (\n\t\tdocument.getElementById('apbct_settings__before_advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_settings__after_advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_settings__button_section') === null ||\n\t\tdocument.getElementById('apbct_settings__advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_hidden_section_nav') === null\n\t) {\n\t\treturn;\n\t}\n\tvar docInnerHeight = window.innerHeight;\n\tvar advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\n\tvar advSettingsOffset = advSettingsBlock.getBoundingClientRect().top;\n\tvar buttonBlock = document.getElementById('apbct_settings__button_section');\n\tvar buttonHeight = buttonBlock.getBoundingClientRect().height;\n\tvar navBlock = document.getElementById('apbct_hidden_section_nav');\n\tvar navBlockOffset = navBlock.getBoundingClientRect().top;\n\tvar navBlockHeight = navBlock.getBoundingClientRect().height;\n\n\t// Set Save button position\n\tif ( getComputedStyle(advSettingsBlock).display !== \"none\" ) {\n\t\tjQuery('#apbct_settings__main_save_button').hide();\n\t\tif ( docInnerHeight < navBlockOffset + navBlockHeight + buttonHeight ) {\n\t\t\tbuttonBlock.style.bottom = '';\n\t\t\tbuttonBlock.style.top = navBlockOffset + navBlockHeight + 20 + 'px';\n\t\t} else {\n\t\t\tbuttonBlock.style.bottom = 0;\n\t\t\tbuttonBlock.style.top = '';\n\t\t}\n\t} else {\n\t\tjQuery('#apbct_settings__main_save_button').show();\n\t}\n\n\t// Set nav position\n\tif ( advSettingsOffset <= 0 ) {\n\t\tnavBlock.style.top = - advSettingsOffset + 30 + 'px';\n\t} else {\n\t\tnavBlock.style.top = 0;\n\t}\n}\n\n// Hightlights element\nfunction apbct_highlight_element(id, times){\n\ttimes = times-1 || 0;\n\tlet key_field = jQuery('#'+id)\n\tjQuery(\"html, body\").animate({ scrollTop: key_field.offset().top - 100 }, \"slow\");\n\tkey_field.addClass('apbct_highlighted');\n\tkey_field.animate({opacity: 0 }, 400, 'linear', function(){\n\t\tkey_field.animate({opacity: 1 }, 400, 'linear', function(){\n\t\t\tif(times>0){\n\t\t\t\tapbct_highlight_element(id, times);\n\t\t\t}else{\n\t\t\t\tkey_field.removeClass('apbct_highlighted');\n\t\t\t}\n\t\t});\n\t});\n}"],"names":["apbct_banner_check","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbct_get_elems","elems","tmp","i","len","split","apbct_get_elems__native","out","forEach","elem","arr","document","getElementById","push","key","getElementsByClassName","apbct_show_hide_elem","each","label","next","prev","is","show","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependencies_getState","checked","apbct_settings__showDescription","setting_id","remove_desc_func","e","target","parent","hasClass","remove","off","after","append","css","top","position","left","spinner","children","empty","title","desc","on","apbct_save_button_position","docInnerHeight","advSettingsBlock","advSettingsOffset","buttonBlock","buttonHeight","navBlock","navBlockOffset","navBlockHeight","window","innerHeight","getBoundingClientRect","height","getComputedStyle","display","style","bottom","apbct_highlight_element","id","times","let","key_field","animate","scrollTop","offset","addClass","opacity","removeClass","ready","postFix","event","type","parseInt","value","direction","val","attr","this","fadeOut","d","Date","getTimezoneOffset","timeout","button","setTimeout","reload","location","getTemplates","cleantalkModal","loaded","open","addEventListener","optionSelected","console","log","template_id","template_name","settings","notJson","success","insertAfter","close","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find","preventDefault","$this","accountEmailField","accountEmail","text","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","match","key_is_ok"],"mappings":"AA8TA,SAASA,qBACR,IAAIC,EAAgBC,YAAa,WAChCC,qBACC,CAACC,OAAQ,sCACT,CACCC,SAAU,SAASC,EAAQC,EAAMC,EAAQC,GACpCH,EAAOI,qBACNC,OAAO,2BAA2BC,QACrCD,OAAO,2BAA2BE,KAAK,QACpCF,OAAO,2BA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C3E,OAAO,yBAAyB6F,OAAS6B,eAAekB,WAC5D5I,OAAO,wCAAwCE,OAM3CwH,eAAekB,WACnB5I,OAAO,+CAA+CyD,GAAG,QACxD,SAAUjB,GACTA,EAAEuF,iBACG/H,OAAO,yBAAyBC,QACpCD,OAAQ,oKAEQsH,YAAatH,OAAO,wBAErC2E,wBAAwB,uBAAuB,GAC/CA,wBAAwB,qBAAqB,GAC7C3E,OAAO,wCAAwC0B"}
|
1 |
+
{"version":3,"file":"cleantalk-admin-settings-page.min.js","sources":["cleantalk-admin-settings-page.js"],"sourcesContent":["jQuery(document).ready(function(){\n\n\t// Top level settings\n\tjQuery('.apbct_setting---data__email_decoder').on('click', (event) => {\n\t\tif ( event.target.type === 'checkbox' ) {\n\t\t\tconst postFix = event.target.checked ? '__On' : '__Off';\n\t\t\tdocument.getElementById('apbct_setting_data__email_decoder' + postFix).checked = true;\n\t\t} else {\n\t\t\tdocument.getElementById('apbct_setting_data__email_decoder').checked = parseInt(event.target.value) === 1;\n\t\t}\n\t});\n\n\t// Crunch for Right to Left direction languages\n\tif(document.getElementsByClassName('apbct_settings-title')[0]) {\n\t\tif(getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl'){\n\t\t\tjQuery('.apbct_switchers').css('text-align', 'right');\n\t\t}\n\t}\n\n\t// Show/Hide access key\n jQuery('#apbct_showApiKey').on('click', function(){\n jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));\n jQuery('.apbct_setting---apikey+div').show();\n jQuery(this).fadeOut(300);\n });\n\n\tvar d = new Date();\n\tjQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));\n\n\t// Key KEY automatically\n\tjQuery('#apbct_button__get_key_auto').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_get_key_auto'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__get_key_auto' ),\n\t\t\t\tspinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__get_key_auto .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\tif(result.getTemplates) {\n\t\t\t\t\t\tcleantalkModal.loaded = result.getTemplates;\n\t\t\t\t\t\tcleantalkModal.open();\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Import settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_import_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_import_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tvar data = {\n\t\t\t'template_id' : optionSelected.data('id'),\n\t\t\t'template_name' : optionSelected.data('name'),\n\t\t\t'settings' : optionSelected.data('settings')\n\t\t};\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_import', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_import_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Export settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_export_button', function(){\n\t\tjQuery('#apbct-ajax-result').remove();\n\t\tvar optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));\n\t\tvar templateNameInput = jQuery('#apbct_settings_templates_export_name');\n\t\ttemplateNameInput.css('border-color', 'inherit');\n\t\tif( typeof optionSelected.data('id') === \"undefined\" ) {\n\t\t\tconsole.log( 'Attribute \"data-id\" not set for the option.' );\n\t\t\treturn;\n\t\t}\n\t\tif( optionSelected.data('id') === 'new_template' ) {\n\t\t\tvar templateName = templateNameInput.val();\n\t\t\tif( templateName === '' ) {\n\t\t\t\ttemplateNameInput.css('border-color', 'red');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar data = {\n\t\t\t\t'template_name' : templateName\n\t\t\t}\n\t\t} else {\n\t\t\tvar data = {\n\t\t\t\t'template_id' : optionSelected.data('id')\n\t\t\t}\n\t\t}\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_export', data: data},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_export_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Reset settings\n\tjQuery( document ).on('click', '#apbct_settings_templates_reset_button', function(){\n\t\tvar button = this;\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'settings_templates_reset'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: button,\n\t\t\t\tspinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),\n\t\t\t\tnotJson: true,\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif(result.success) {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='success'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t\tjQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);\n\t\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);}, 2000);\n\t\t\t\t\t\tdocument.addEventListener(\"cleantalkModalClosed\", function( e ) {\n\t\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetTimeout(function(){cleantalkModal.close()}, 2000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery( \"<p id='apbct-ajax-result' class='error'>\" + result.data + \"</p>\" ).insertAfter( jQuery(button) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\t// Sync button\n\tjQuery('#apbct_button__sync').on('click', function(){\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_sync'},\n\t\t\t{\n\t\t\t\ttimeout: 25000,\n\t\t\t\tbutton: document.getElementById('apbct_button__sync' ),\n\t\t\t\tspinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tjQuery('#apbct_button__sync .apbct_success').show(300);\n\t\t\t\t\tsetTimeout(function(){jQuery('#apbct_button__sync .apbct_success').hide(300);}, 2000);\n\t\t\t\t\tif(result.reload)\n\t\t\t\t\t\tdocument.location.reload();\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\n\tif( ctSettingsPage.key_changed )\n\t\tjQuery('#apbct_button__sync').click();\n\n\tjQuery(document).on('click', '.apbct_settings-long_description---show', function(){\n\t\tself = jQuery(this);\n\t\tapbct_settings__showDescription(self, self.attr('setting'));\n\t});\n\n\tif (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length)\n\t\tapbct_banner_check();\n\n\tjQuery(document).on('change', '#apbct_settings_templates_export',function(){\n\t\tvar optionSelected = jQuery(\"option:selected\", this);\n\t\tif ( optionSelected.data(\"id\") === 'new_template' ) {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();\n\t\t} else {\n\t\t\tjQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();\n\t\t}\n\t});\n\n\tapbct_save_button_position();\n\twindow.addEventListener('scroll', apbct_save_button_position);\n\tjQuery('#ct_adv_showhide a').on('click', apbct_save_button_position);\n\n\n\t/**\n\t * Change cleantalk account email\n\t */\n\tjQuery('#apbct-change-account-email').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\tvar $this = jQuery(this);\n\t\tvar accountEmailField = jQuery('#apbct-account-email');\n\t\tvar accountEmail = accountEmailField.text();\n\n\t\t$this.toggleClass('active');\n\n\t\tif ($this.hasClass('active')) {\n\t\t\t$this.text($this.data('save-text'));\n\t\t\taccountEmailField.attr('contenteditable', 'true');\n\t\t\taccountEmailField.on('keydown', function (e) {\n\t\t\t\tif (e.code === 'Enter') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}\n\t\t\t})\n\t\t\taccountEmailField.on('input', function (e) {\n\t\t\t\tif (e.inputType === 'insertParagraph') {\n\t\t\t\t\te.preventDefault()\n\t\t\t\t}\n\t\t\t})\n\t\t} else {\n\t\t\tapbct_admin_sendAJAX(\n\t\t\t\t{\n\t\t\t\t\taction: 'apbct_update_account_email',\n\t\t\t\t\taccountEmail: accountEmail\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttimeout: 5000,\n\t\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\t\tif (result.success !== undefined && result.success === 'ok') {\n\t\t\t\t\t\t\tif (result.manuallyLink !== undefined) {\n\t\t\t\t\t\t\t\tjQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (result.error !== undefined) {\n\t\t\t\t\t\t\tjQuery('#apbct-account-email').css('border-color', 'red');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\n\t\t\taccountEmailField.attr('contenteditable', 'false');\n\t\t\t$this.text($this.data('default-text'));\n\t\t}\n\t});\n\n\t/**\n\t * Validate apkikey and hide get auto btn\n\t */\n\tjQuery('#apbct_setting_apikey').on('input', function () {\n\t\tvar enteredValue = jQuery(this).val();\n\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').off('click')\n\t\tif (enteredValue !== '' && enteredValue.match(/^[a-z\\d]{3,30}\\s*$/) === null) {\n\t\t\tjQuery('#apbct_button__get_key_auto__wrapper').show();\n\t\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n\t\t\t\t\tfunction (e) {\n\t\t\t\t\t\te.preventDefault()\n\t\t\t\t\t\tif (!jQuery('#apbct_bad_key_notice').length){\n\t\t\t\t\t\t\tjQuery( \"<div class='apbct_notice_inner error'><h4 id='apbct_bad_key_notice'>\" +\n\t\t\t\t\t\t\t\t\"Please, insert a correct access key before saving changes!\" +\n\t\t\t\t\t\t\t\t\"</h4></div>\" ).insertAfter( jQuery('#apbct_setting_apikey') );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tapbct_highlight_element('apbct_setting_apikey',3)\n\n\t\t\t\t\t}\n\t\t\t\t)\n\t\t\treturn;\n\t\t}\n\n\t});\n\n\tif ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {\n\t\tjQuery('#apbct_button__get_key_auto__wrapper').hide();\n\t}\n\n\t/**\n\t * Handle synchronization errors when key is no ok to force user check the key and restart the sync\n\t */\n\tif( !ctSettingsPage.key_is_ok ){\n\t\tjQuery('button.cleantalk_link[value=\"save_changes\"]').on('click',\n\t\t\tfunction (e) {\n\t\t\t\te.preventDefault()\n\t\t\t\tif (!jQuery('#sync_required_notice').length){\n\t\t\t\t\tjQuery( \"<div class='apbct_notice_inner error'><h4 id='sync_required_notice'>\" +\n\t\t\t\t\t\t\"Synchronization process failed. Please, check the acces key and restart the synch.\" +\n\t\t\t\t\t\t\"<h4></div>\" ).insertAfter( jQuery('#apbct_button__sync') );\n\t\t\t\t}\n\t\t\t\tapbct_highlight_element('apbct_setting_apikey',3)\n\t\t\t\tapbct_highlight_element('apbct_button__sync',3)\n\t\t\t\tjQuery('#apbct_button__get_key_auto__wrapper').show();\n\t\t\t}\n\t\t)\n\t}\n\n\t/**\n\t * Open WP gallery for adding custom logo\n\t */\n\tjQuery('#apbct-custom-logo-open-gallery').click(function (e) {\n\t\te.preventDefault();\n\n\t\tconst button = jQuery(this);\n\n\t\tconst customUploader = wp.media({\n\t\t\tlibrary : {\n\t\t\t\ttype : 'image'\n\t\t\t},\n\t\t\tmultiple: false\n\t\t});\n\n\t\tcustomUploader.on('select', function() {\n\t\t\tconst image = customUploader.state().get('selection').first().toJSON();\n\n\t\t\tbutton.parent().prev().attr( 'src', image.url );\n\t\t\tjQuery('#cleantalk_custom_logo').val( image.id );\n\t\t});\n\n\t\tcustomUploader.open();\n\t});\n\n\t/**\n\t * Remove selected logo\n\t */\n\tjQuery('#apbct-custom-logo-remove-image').click(function (e) {\n\t\te.preventDefault();\n\n\t\tif ( true === confirm( \"Sure?\" ) ) {\n\t\t\tconst src = jQuery(this).parent().prev().data('src');\n\t\t\tjQuery(this).parent().prev().attr('src', src);\n\t\t\tjQuery(this).prev().prev().val('');\n\t\t}\n\t});\n\n});\n\n/**\n * Checking current account status for renew notice\n */\nfunction apbct_banner_check() {\n\tvar bannerChecker = setInterval( function() {\n\t\tapbct_admin_sendAJAX(\n\t\t\t{action: 'apbct_settings__check_renew_banner'},\n\t\t\t{\n\t\t\t\tcallback: function(result, data, params, obj){\n\t\t\t\t\tif (result.close_renew_banner) {\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_renew').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_renew').hide('slow');\n\t\t\t\t\t\tif (jQuery('#cleantalk_notice_trial').length)\n\t\t\t\t\t\t\tjQuery('#cleantalk_notice_trial').hide('slow');\n\t\t\t\t\t\tclearInterval(bannerChecker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}, 900000);\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector passed in string separated by ,\n *\n * @param elems\n * @returns {*}\n */\nfunction apbct_get_elems(elems){\n elems = elems.split(',');\n for( var i=0, len = elems.length, tmp; i < len; i++){\n tmp = jQuery('#'+elems[i]);\n elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;\n }\n return elems;\n}\n\n/**\n * Select elems like #{selector} or .{selector}\n * Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )\n *\n * @param elems string|array\n * @returns array\n */\nfunction apbct_get_elems__native(elems){\n\n\t// Make array from a string\n\tif(typeof elems === 'string')\n\t\telems = elems.split(',');\n\n\tvar out = [];\n\n\telems.forEach(function(elem, i, arr) {\n\n\t\t// try to get elements with such IDs\n\t\tvar tmp = document.getElementById(elem);\n\t\tif (tmp !== null){\n\t\t\tout.push( tmp[key] );\n\t\t\treturn;\n\t\t}\n\n\t\t// try to get elements with such class name\n\t\t// write each elem from collection to new element of output array\n\t\ttmp = document.getElementsByClassName(elem);\n\t\tif (tmp !== null && tmp.length !==0 ){\n\t\t\tfor(key in tmp){\n\t\t\t\tif( +key >= 0 ){\n\t\t\t\t\tout.push( tmp[key] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\treturn out;\n}\n\nfunction apbct_show_hide_elem(elems){\n\telems = apbct_get_elems(elems);\n for( var i=0, len = elems.length; i < len; i++){\n elems[i].each(function (i, elem) {\n elem = jQuery(elem);\n var label = elem.next('label') || elem.prev('label') || null;\n if (elem.is(\":visible\")) {\n elem.hide();\n if (label) label.hide();\n } else {\n elem.show();\n if (label) label.show();\n }\n });\n }\n}\n\n/**\n * Settings dependences. Switch|toggle depended elements state (disabled|enabled)\n * Recieve list of selectors ( without class mark (.) or id mark (#) )\n *\n * @param ids string|array Selectors\n * @param enable\n */\nfunction apbctSettingsDependencies(ids, enable){\n\n\n\tenable = ! isNaN(enable) ? enable : null;\n\n\t// Get elements\n\tvar elems = apbct_get_elems__native( ids );\n\n\telems.forEach(function(elem, i, arr){\n\n\t\tvar do_disable = function(){elem.setAttribute('disabled', 'disabled');},\n\t\t\tdo_enable = function(){elem.removeAttribute('disabled');};\n\n\t\t// Set defined state\n\t\tif(enable === null) // Set\n\t\t\tenable = elem.getAttribute('disabled') === null ? 0 : 1;\n\n\t\tenable === 1 ? do_enable() : do_disable();\n\n\t\tif( elem.getAttribute('apbct_children') !== null){\n\t\t\tvar state = apbctSettingsDependencies_getState( elem ) && enable;\n\t\t\tif( state !== null ) {\n\t\t\t\tapbctSettingsDependencies( elem.getAttribute('apbct_children'), state );\n\t\t\t}\n\t\t}\n\n\t});\n}\n\nfunction apbctSettingsDependencies_getState( elem ){\n\n\tvar state;\n\n\tswitch ( elem.getAttribute( 'type' ) ){\n\t\tcase 'checkbox':\n\t\t\tstate = +elem.checked;\n\t\t\tbreak;\n\t\tcase 'radio':\n\t\t\tstate = +(+elem.getAttribute('value') === 1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tstate = null;\n\t}\n\n\treturn state;\n}\n\nfunction apbct_settings__showDescription(label, setting_id){\n\n\tvar remove_desc_func = function(e){\n\t\tif(typeof e === 'undefined' || ((jQuery(e.target).parent('.apbct_long_desc').length == 0 || jQuery(e.target).hasClass('apbct_long_desc__cancel')) && !jQuery(e.target).hasClass('apbct_long_description__show'))){\n\t\t\tjQuery('.apbct_long_desc').remove();\n\t\t\tjQuery(document).off('click', remove_desc_func);\n\t\t}\n\t};\n\n\tremove_desc_func();\n\n\tlabel.after(\"<div id='apbct_long_desc__\"+setting_id+\"' class='apbct_long_desc'></div>\");\n\tvar obj = jQuery('#apbct_long_desc__'+setting_id);\n\tobj.append(\"<i class= 'apbct-icon-spin1 animate-spin'></i>\")\n\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t.css({\n\t\t\ttop: label.position().top - 5,\n\t\t\tleft: label.position().left + 25\n\t\t});\n\n\n\tapbct_admin_sendAJAX(\n\t\t{action: 'apbct_settings__get__long_description', setting_id: setting_id},\n\t\t{\n\t\t\tspinner: obj.children('img'),\n\t\t\tcallback: function(result, data, params, obj){\n\n\t\t\t\tobj.empty()\n\t\t\t\t\t.append(\"<div class='apbct_long_desc__angle'></div>\")\n\t\t\t\t\t.append(\"<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>\")\n\t\t\t\t\t.append(\"<h3 class='apbct_long_desc__title'>\"+result.title+\"</h3>\")\n\t\t\t\t\t.append(\"<p>\"+result.desc+\"</p>\");\n\n\t\t\t\tjQuery(document).on('click', remove_desc_func);\n\t\t\t}\n\t\t},\n\t\tobj\n\t);\n}\n\nfunction apbct_save_button_position() {\n\tif (\n\t\tdocument.getElementById('apbct_settings__before_advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_settings__after_advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_settings__button_section') === null ||\n\t\tdocument.getElementById('apbct_settings__advanced_settings') === null ||\n\t\tdocument.getElementById('apbct_hidden_section_nav') === null\n\t) {\n\t\treturn;\n\t}\n\tvar docInnerHeight = window.innerHeight;\n\tvar advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');\n\tvar advSettingsOffset = advSettingsBlock.getBoundingClientRect().top;\n\tvar buttonBlock = document.getElementById('apbct_settings__button_section');\n\tvar buttonHeight = buttonBlock.getBoundingClientRect().height;\n\tvar navBlock = document.getElementById('apbct_hidden_section_nav');\n\tvar navBlockOffset = navBlock.getBoundingClientRect().top;\n\tvar navBlockHeight = navBlock.getBoundingClientRect().height;\n\n\t// Set Save button position\n\tif ( getComputedStyle(advSettingsBlock).display !== \"none\" ) {\n\t\tjQuery('#apbct_settings__main_save_button').hide();\n\t\tif ( docInnerHeight < navBlockOffset + navBlockHeight + buttonHeight ) {\n\t\t\tbuttonBlock.style.bottom = '';\n\t\t\tbuttonBlock.style.top = navBlockOffset + navBlockHeight + 20 + 'px';\n\t\t} else {\n\t\t\tbuttonBlock.style.bottom = 0;\n\t\t\tbuttonBlock.style.top = '';\n\t\t}\n\t} else {\n\t\tjQuery('#apbct_settings__main_save_button').show();\n\t}\n\n\t// Set nav position\n\tif ( advSettingsOffset <= 0 ) {\n\t\tnavBlock.style.top = - advSettingsOffset + 30 + 'px';\n\t} else {\n\t\tnavBlock.style.top = 0;\n\t}\n}\n\n// Hightlights element\nfunction apbct_highlight_element(id, times){\n\ttimes = times-1 || 0;\n\tlet key_field = jQuery('#'+id)\n\tjQuery(\"html, body\").animate({ scrollTop: key_field.offset().top - 100 }, \"slow\");\n\tkey_field.addClass('apbct_highlighted');\n\tkey_field.animate({opacity: 0 }, 400, 'linear', function(){\n\t\tkey_field.animate({opacity: 1 }, 400, 'linear', function(){\n\t\t\tif(times>0){\n\t\t\t\tapbct_highlight_element(id, times);\n\t\t\t}else{\n\t\t\t\tkey_field.removeClass('apbct_highlighted');\n\t\t\t}\n\t\t});\n\t});\n}"],"names":["apbct_banner_check","bannerChecker","setInterval","apbct_admin_sendAJAX","action","callback","result","data","params","obj","close_renew_banner","jQuery","length","hide","clearInterval","apbct_get_elems","elems","tmp","i","len","split","apbct_get_elems__native","out","forEach","elem","arr","document","getElementById","push","key","getElementsByClassName","apbct_show_hide_elem","each","label","next","prev","is","show","apbctSettingsDependencies","ids","enable","isNaN","state","getAttribute","removeAttribute","setAttribute","apbctSettingsDependencies_getState","checked","apbct_settings__showDescription","setting_id","remove_desc_func","e","target","parent","hasClass","remove","off","after","append","css","top","position","left","spinner","children","empty","title","desc","on","apbct_save_button_position","docInnerHeight","advSettingsBlock","advSettingsOffset","buttonBlock","buttonHeight","navBlock","navBlockOffset","navBlockHeight","window","innerHeight","getBoundingClientRect","height","getComputedStyle","display","style","bottom","apbct_highlight_element","id","times","let","key_field","animate","scrollTop","offset","addClass","opacity","removeClass","ready","postFix","event","type","parseInt","value","direction","val","attr","this","fadeOut","d","Date","getTimezoneOffset","timeout","button","setTimeout","reload","location","getTemplates","cleantalkModal","loaded","open","addEventListener","optionSelected","console","log","template_id","template_name","settings","notJson","success","insertAfter","close","templateNameInput","templateName","ctSettingsPage","key_changed","click","self","find","preventDefault","$this","accountEmailField","accountEmail","text","toggleClass","code","inputType","undefined","manuallyLink","error","enteredValue","match","key_is_ok","customUploader","wp","media","library","multiple","image","get","first","toJSON","url","confirm","src"],"mappings":"AAoWA,SAASA,qBACR,IAAIC,EAAgBC,YAAa,WAChCC,qBACC,CAACC,OAAQ,oCAAo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alk-admin.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-admin.min.js","sources":["cleantalk-admin.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Auto update banner close handler\n\tjQuery('.apbct_update_notice').on('click', 'button', function(){\n\t\tvar ct_date = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\tdocument.cookie = \"apbct_update_banner_closed=1; path=/; expires=\" + ct_date.toUTCString() + \"; samesite=lax\" + ctSecure;\n\t});\n\t\n\tjQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space','nowrap').css('display','inline-block');\n\n\tjQuery('body').on('click', '.apbct-notice .notice-dismiss', function(e){\n\t\tvar apbct_notice_name = jQuery(e.target).parent().attr('id');\n\t\tif( apbct_notice_name ) {\n\t\t\tapbct_admin_sendAJAX( { 'action' : 'cleantalk_dismiss_notice', 'notice_id' : apbct_notice_name }, { 'callback' : null } );\n\t\t}\n\t});\n\n\t// Notice when deleting user\n\tjQuery('.ct_username .row-actions .delete a').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\tlet result = confirm(ctAdminCommon.notice_when_deleting_user_text);\n\n\t\tif (result) {\n\t\t\twindow.location = this.href\n\t\t}\n\t});\n\n});\nfunction apbct_admin_sendAJAX(data, params, obj){\n\n\t// Default params\n\tvar callback = params.callback || null;\n\tvar callback_context = params.callback_context || null;\n\tvar callback_params = params.callback_params || null;\n\tvar async = params.async || true;\n\tvar notJson = params.notJson || null;\n\tvar timeout = params.timeout || 15000;\n\tvar obj = obj || null;\n\tvar button = params.button || null;\n\tvar spinner = params.spinner || null;\n\tvar progressbar = params.progressbar || null;\n\n\tif(typeof (data) === 'string') {\n\t\tdata = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\n\t} else {\n\t\tdata._ajax_nonce = ctAdminCommon._ajax_nonce;\n\t\tdata.no_cache = Math.random();\n\t}\n\t// Button and spinner\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\n\tif(spinner) jQuery(spinner).css('display', 'inline');\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctAdminCommon._ajax_url,\n\t\tdata: data,\n\t\tasync: async,\n\t\tsuccess: function(result){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif(!notJson) result = JSON.parse(result);\n\t\t\tif(result.error){\n\t\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n\t\t\t\tif( typeof cleantalkModal !== 'undefined' ) {\n\t\t\t\t\t// Show the result by modal\n\t\t\t\t\tcleantalkModal.loaded = 'Error:<br>' + result.error.toString();\n\t\t\t\t\tcleantalkModal.open();\n\t\t\t\t} else {\n\t\t\t\t\talert('Error happens: ' + (result.error || 'Unkown'));\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tif (callback_params)\n\t\t\t\t\t\tcallback.apply( callback_context, callback_params.concat( result, data, params, obj ) );\n\t\t\t\t\telse\n\t\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n\t\ttimeout: timeout,\n\t});\n}"],"names":["apbct_admin_sendAJAX","data","params","obj","callback","callback_context","callback_params","async","notJson","timeout","button","spinner","progressbar","ctAdminCommon","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","result","removeAttribute","JSON","parse","error","setTimeout","fadeOut","cleantalkModal","loaded","toString","open","alert","apply","concat","jqXHR","textStatus","errorThrown","console","log","document","ready","on","ct_date","Date","getTime","ctSecure","location","protocol","cookie","toUTCString","e","apbct_notice_name","target","parent","attr","action","notice_id","preventDefault","confirm","notice_when_deleting_user_text","window","this","href"],"mappings":"AA8BA,SAASA,qBAAqBC,EAAMC,EAAQC,GAG3C,IAAIC,EAAcF,EAAOE,UAAe,KACpCC,EAAmBH,EAAOG,kBAAoB,KAC9CC,EAAkBJ,EAAOI,iBAAmB,KAC5CC,EAAQL,EAAOK,
|
1 |
+
{"version":3,"file":"cleantalk-admin.min.js","sources":["cleantalk-admin.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Auto update banner close handler\n\tjQuery('.apbct_update_notice').on('click', 'button', function(){\n\t\tvar ct_date = new Date(new Date().getTime() + 1000 * 86400 * 30 );\n\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\tdocument.cookie = \"apbct_update_banner_closed=1; path=/; expires=\" + ct_date.toUTCString() + \"; samesite=lax\" + ctSecure;\n\t});\n\t\n\tjQuery('li a[href=\"options-general.php?page=cleantalk\"]').css('white-space','nowrap').css('display','inline-block');\n\n\tjQuery('body').on('click', '.apbct-notice .notice-dismiss', function(e){\n\t\tvar apbct_notice_name = jQuery(e.target).parent().attr('id');\n\t\tif( apbct_notice_name ) {\n\t\t\tapbct_admin_sendAJAX( { 'action' : 'cleantalk_dismiss_notice', 'notice_id' : apbct_notice_name }, { 'callback' : null } );\n\t\t}\n\t});\n\n\t// Notice when deleting user\n\tjQuery('.ct_username .row-actions .delete a').on('click', function (e) {\n\t\te.preventDefault();\n\n\t\tlet result = confirm(ctAdminCommon.notice_when_deleting_user_text);\n\n\t\tif (result) {\n\t\t\twindow.location = this.href\n\t\t}\n\t});\n\n});\nfunction apbct_admin_sendAJAX(data, params, obj){\n\n\t// Default params\n\tvar callback = params.callback || null;\n\tvar callback_context = params.callback_context || null;\n\tvar callback_params = params.callback_params || null;\n\tvar async = params.async || true;\n\tvar notJson = params.notJson || null;\n\tvar timeout = params.timeout || 15000;\n\tvar obj = obj || null;\n\tvar button = params.button || null;\n\tvar spinner = params.spinner || null;\n\tvar progressbar = params.progressbar || null;\n\n\tif(typeof (data) === 'string') {\n\t\tdata = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();\n\t} else {\n\t\tdata._ajax_nonce = ctAdminCommon._ajax_nonce;\n\t\tdata.no_cache = Math.random();\n\t}\n\t// Button and spinner\n\tif(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }\n\tif(spinner) jQuery(spinner).css('display', 'inline');\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ctAdminCommon._ajax_url,\n\t\tdata: data,\n\t\tasync: async,\n\t\tsuccess: function(result){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tif(!notJson) result = JSON.parse(result);\n\t\t\tif(result.error){\n\t\t\t\tsetTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);\n\t\t\t\tif( typeof cleantalkModal !== 'undefined' ) {\n\t\t\t\t\t// Show the result by modal\n\t\t\t\t\tcleantalkModal.loaded = 'Error:<br>' + result.error.toString();\n\t\t\t\t\tcleantalkModal.open();\n\t\t\t\t} else {\n\t\t\t\t\talert('Error happens: ' + (result.error || 'Unkown'));\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\tif(callback) {\n\t\t\t\t\tif (callback_params)\n\t\t\t\t\t\tcallback.apply( callback_context, callback_params.concat( result, data, params, obj ) );\n\t\t\t\t\telse\n\t\t\t\t\t\tcallback(result, data, params, obj);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown){\n\t\t\tif(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }\n\t\t\tif(spinner) jQuery(spinner).css('display', 'none');\n\t\t\tconsole.log('APBCT_AJAX_ERROR');\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n\t\ttimeout: timeout,\n\t});\n}"],"names":["apbct_admin_sendAJAX","data","params","obj","callback","callback_context","callback_params","async","notJson","timeout","button","spinner","progressbar","ctAdminCommon","_ajax_nonce","Math","random","no_cache","setAttribute","style","cursor","jQuery","css","ajax","type","url","_ajax_url","success","result","removeAttribute","JSON","parse","error","setTimeout","fadeOut","cleantalkModal","loaded","toString","open","alert","apply","concat","jqXHR","textStatus","errorThrown","console","log","document","ready","on","ct_date","Date","getTime","ctSecure","location","protocol","cookie","toUTCString","e","apbct_notice_name","target","parent","attr","action","notice_id","preventDefault","confirm","notice_when_deleting_user_text","window","this","href"],"mappings":"AA8BA,SAASA,qBAAqBC,EAAMC,EAAQC,GAG3C,IAAIC,EAAcF,EAAOE,UAAe,KACpCC,EAAmBH,EAAOG,kBAAoB,KAC9CC,EAAkBJ,EAAOI,iBAAmB,KAC5CC,EAAQL,EAAOK,OAAS,CAAA,EACxBC,EAAcN,EAAOM,SAAe,KACpCC,EAAcP,EAAOO,SAAe,KACpCN,EAAcA,GAAsB,KACpCO,EAAcR,EAAOQ,QAAe,KACpCC,EAAcT,EAAOS,SAAe,KACpCC,EAAcV,EAAOU,aAAe,KAEnB,UAAlB,OAAO,EACTX,EAAOA,EAAO,gBAAkBY,cAAcC,YAAc,aAAeC,KAAKC,OAAO,GAEvFf,EAAKa,YAAcD,cAAcC,YACjCb,EAAKgB,SAAWF,KAAKC,OAAO,GAG1BN,IAAUA,EAAOQ,aAAa,WAAY,UAAU,EAAGR,EAAOS,MAAMC,OAAS,eAC7ET,GAASU,OAAOV,CAAO,EAAEW,IAAI,UAAW,QAAQ,EAEnDD,OAAOE,KAAK,CACXC,KAAM,OACNC,IAAKZ,cAAca,UACnBzB,KAAMA,EACNM,MAAOA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QAAS,gCAAiC,SAASS,GAChEC,EAAoBtC,OAAOqC,EAAEE,MAAM,EAAEC,OAAO,EAAEC,KAAK,IAAI,EACvDH,GACH3D,qBAAsB,CAAE+D,OAAW,2BAA4BC,UAAcL,CAAkB,EAAG,CAAEvD,SAAa,IAAK,CAAE,CAE1H,CAAC,EAGDiB,OAAO,qCAAqC,EAAE4B,GAAG,QAAS,SAAUS,GACnEA,EAAEO,eAAe,EAEJC,QAAQrD,cAAcsD,8BAA8B,IAGhEC,OAAOd,SAAWe,KAAKC,KAEzB,CAAC,CAEF,CAAC"}
|
js/cleantalk-comments-checkspam.min.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
-
var ct_working=!(String.prototype.printf=function(){var e,t=this;for(e in arguments)var c=t.substring(0,t.indexOf("%s",0)),a=t.substring(t.indexOf("%s",0)+2,t.length),t=c+arguments[e]+a;return t}),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctCommentsCheck.ct_prev_accurate,ct_prev_from=ctCommentsCheck.ct_prev_from,ct_prev_till=ctCommentsCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctCommentsCheck.ct_ajax_nonce,ct_comments_total=0,ct_comments_checked=0,ct_comments_spam=0,ct_comments_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function animate_comment(e,t){ct_close_animate?.3==e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_comments(){var e=0,t=0,c=(jQuery("#ct_allow_date_range").is(":checked")&&(e=jQuery("#ct_date_range_from").val(),t=jQuery("#ct_date_range_till").val()),"https:"===location.protocol?"; secure":"");document.cookie="apbct_check_comments_offset=0; path=/; samesite=lax"+c,jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"ajax_clear_comments",security:ct_ajax_nonce,from:e,till:t},success:function(e){ct_show_info(),ct_send_comments()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_comments(),ct_show_info()}function ct_send_comments(){
|
2 |
//# sourceMappingURL=cleantalk-comments-checkspam.min.js.map
|
1 |
+
var ct_working=!(String.prototype.printf=function(){var e,t=this;for(e in arguments)var c=t.substring(0,t.indexOf("%s",0)),a=t.substring(t.indexOf("%s",0)+2,t.length),t=c+arguments[e]+a;return t}),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctCommentsCheck.ct_prev_accurate,ct_prev_from=ctCommentsCheck.ct_prev_from,ct_prev_till=ctCommentsCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctCommentsCheck.ct_ajax_nonce,ct_comments_total=0,ct_comments_checked=0,ct_comments_spam=0,ct_comments_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function animate_comment(e,t){ct_close_animate?.3==e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_comments(){var e=0,t=0,c=(jQuery("#ct_allow_date_range").is(":checked")&&(e=jQuery("#ct_date_range_from").val(),t=jQuery("#ct_date_range_till").val()),"https:"===location.protocol?"; secure":"");document.cookie="apbct_check_comments_offset=0; path=/; samesite=lax"+c,jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"ajax_clear_comments",security:ct_ajax_nonce,from:e,till:t},success:function(e){ct_show_info(),ct_send_comments()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_comments(),ct_show_info()}function ct_send_comments(){var e;!0!==ct_cooling_down_flag&&(ct_max_requests<=ct_requests_counter?(setTimeout(ct_cooling_down_toggle,ct_cool_down_time),ct_cooling_down_flag=!(ct_requests_counter=0)):(ct_requests_counter++,e={action:"ajax_check_comments",security:ct_ajax_nonce,new_check:ct_new_check,unchecked:ct_unchecked,offset:Number(ctGetCookie("apbct_check_comments_offset"))},ct_accurate_check&&(e.accurate_check=!0),ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t;e=jQuery.parseJSON(e),parseInt(e.error)?(ct_working=!1,confirm(e.error_message+". Do you want to proceed?")?ct_send_comments():(t="edit-comments.php?page=ct_check_spam",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t)):(ct_new_check=!1,1==parseInt(e.end)||!0===ct_pause?(1==parseInt(e.end)&&(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"),ct_working=!1,jQuery("#ct_working_message").hide(),t="edit-comments.php?page=ct_check_spam",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t):0==parseInt(e.end)&&(ct_comments_checked+=e.checked,ct_comments_spam+=e.spam,ct_comments_bad+=e.bad,ct_comments_total+=e.total,ct_unchecked=ct_comments_total-ct_comments_checked-ct_comments_bad,t=(t=String(ctCommentsCheck.ct_status_string)).printf(ct_comments_checked,ct_comments_spam,ct_comments_bad),0<parseInt(ct_comments_spam)&&(t+=ctCommentsCheck.ct_status_string_warning),jQuery("#ct_checking_status").html(t),jQuery("#ct_error_message").hide(),+ct_comments_total<ct_comments_checked+ct_comments_bad&&(document.cookie="ct_comments_start_check=1; path=/; samesite=lax",location.href="edit-comments.php?page=ct_check_spam"),e=Number(ctGetCookie("apbct_check_comments_offset"))+100,document.cookie="apbct_check_comments_offset="+e+"; path=/",ct_send_comments()))},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_send_comments(),3e3)},timeout:25e3})))}function ct_show_info(){var e;ct_working&&(1==ct_cooling_down_flag?(jQuery("#ct_cooling_notice").html("Waiting for API to cool down. (About a minute)"),jQuery("#ct_cooling_notice").show()):(jQuery("#ct_cooling_notice").hide(),ct_comments_total||(e={action:"ajax_info_comments",security:ct_ajax_nonce},ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){e=jQuery.parseJSON(e),jQuery("#ct_checking_status").html(e.message),ct_comments_total=e.total,ct_comments_spam=e.spam,ct_comments_checked=e.checked,ct_comments_bad=e.bad},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_show_info(),3e3)},timeout:15e3}))))}function ct_toggle_depended(e,t){t=t||null;var c=jQuery(e.data("depended"));e.data("state")||t?(e.data("state",!1),c.prop("disabled",!0),c.removeProp("checked"),c.data("depended")&&ct_toggle_depended(c,!0)):(e.data("state",!0),c.removeProp("disabled"))}function ct_trash_all(a){var e={action:"ajax_trash_all",security:ct_ajax_nonce};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ct_trash_all(a)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="edit-comments.php?page=ct_check_spam")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_trash_all(a),3e3)},timeout:25e3})}function ct_spam_all(a){var e={action:"ajax_spam_all",security:ct_ajax_nonce};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){0<e?(jQuery("#cleantalk_comments_left").html(e),ct_spam_all(a)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="edit-comments.php?page=ct_check_spam")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check comments"),setTimeout(ct_spam_all(a),3e3)},timeout:25e3})}function ctGetCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}jQuery(document).ready(function(){ct_prev_accurate&&jQuery("#ct_accurate_check").prop("checked",!0),ct_prev_from&&(jQuery("#ct_allow_date_range").prop("checked",!0).data("state",!0),jQuery("#ct_date_range_from").removeProp("disabled").val(ct_prev_from),jQuery("#ct_date_range_till").removeProp("disabled").val(ct_prev_till)),jQuery("#ct_allow_date_range").on("change",function(){document.cookie="ct_spam_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_spam_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax",this.checked?(document.cookie="ct_spam_dates_allowed=1; path=/; samesite=lax",jQuery(".ct_date").prop("checked",!0).attr("disabled",!1)):(document.cookie="ct_spam_dates_allowed=0; path=/; samesite=lax",jQuery(".ct_date").prop("disabled",!0).attr("disabled",!0))}),jQuery.datepicker.setDefaults(jQuery.datepicker.regional.en);var a=jQuery("#ct_date_range_from, #ct_date_range_till").datepicker({dateFormat:"M d yy",maxDate:"+0D",changeMonth:!0,changeYear:!0,showAnim:"slideDown",onSelect:function(e){var t="ct_date_range_from"==this.id?"minDate":"maxDate",c=jQuery(this).data("datepicker"),e=jQuery.datepicker.parseDate(c.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,e,c.settings);a.not(this).datepicker("option",t,e),document.cookie="ct_spam_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_spam_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax"}});function e(e){e=e||null,jQuery("#ct_allow_date_range").is(":checked")&&(ct_date_from=jQuery("#ct_date_range_from").val(),ct_date_till=jQuery("#ct_date_range_till").val(),""==ct_date_from||""==ct_date_till)?alert("Please, specify a date range."):(jQuery("#ct_accurate_check").is(":checked")&&(ct_accurate_check=!0),jQuery(".ct_to_hide").hide(),jQuery("#ct_working_message").show(),jQuery("#ct_preloader").show(),jQuery("#ct_pause").show(),ct_working=!0,(e?(ct_show_info(),ct_send_comments):ct_clear_comments)())}jQuery("#ct_check_spam_button").click(function(){e(!(document.cookie="ct_paused_spam_check=0; path=/; samesite=lax"))}),jQuery("#ct_proceed_check_button").click(function(){e(!0)}),jQuery("#ct_pause").on("click",function(){ct_pause=!0;var e={accurate:ct_accurate_check,from:ct_date_from,till:ct_date_till};document.cookie="ct_paused_spam_check="+JSON.stringify(e)+"; path=/; samesite=lax"}),"1"===ctCommentsCheck.start&&(document.cookie="ct_comments_start_check=0; expires="+new Date(0).toUTCString()+"; path=/; samesite=lax",jQuery("#ct_check_spam_button").click()),jQuery(".ct_trash_all").click(function(e){if(!confirm(ctCommentsCheck.ct_confirm_trash_all))return!1;ct_trash_all(e)}),jQuery(".ct_spam_all").click(function(e){if(!confirm(ctCommentsCheck.ct_confirm_spam_all))return!1;ct_spam_all(e)})});
|
2 |
//# sourceMappingURL=cleantalk-comments-checkspam.min.js.map
|
js/cleantalk-comments-checkspam.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-comments-checkspam.min.js","sources":["cleantalk-comments-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\n\tct_comments_total = 0,\n\tct_comments_checked = 0,\n\tct_comments_spam = 0,\n\tct_comments_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_comments(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\t\n\tvar data = {\n\t\t'action' : 'ajax_clear_comments',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_comments();\n\tct_show_info();\n}\n\nfunction ct_send_comments(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_comments',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked,\n\t\t'offset' : Number(ctGetCookie('apbct_check_comments_offset'))\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_comments();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_comments_checked += msg.checked;\n\t\t\t\t\tct_comments_spam += msg.spam;\n\t\t\t\t\tct_comments_bad += msg.bad;\n\t\t\t\t\tct_comments_total += msg.total;\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_checked, ct_comments_spam, ct_comments_bad);\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\t// If DB woks not properly\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar offset = Number(ctGetCookie('apbct_check_comments_offset')) + 100;\n\t\t\t\t\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + offset + \"; path=/\";\n\t\t\t\t\t\n\t\t\t\t\tct_send_comments();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_send_comments(), 3000); \n },\n timeout: 25000\n\t});\n}\nfunction ct_show_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif(!ct_comments_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_comments',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_comments_total = msg.total;\n\t\t\t\t\tct_comments_spam = msg.spam;\n\t\t\t\t\tct_comments_checked = msg.checked;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\nfunction ct_trash_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_trash_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_trash_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_trash_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\nfunction ct_spam_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_spam_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_spam_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_spam_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\njQuery(document).ready(function(){\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\tfunction ct_start_check(continue_check){\n\n continue_check = continue_check || null;\n\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}else\n\t\t\tct_clear_comments();\n\t\t\n\t}\n\t\n\t// Check comments\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_spam_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\n\n\tif(ctCommentsCheck.start === '1'){\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';\n\t\tjQuery('#ct_check_spam_button').click();\t\n\t}\n\n\t// Delete all spam comments\n\tjQuery(\".ct_trash_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_trash_all))\n\t\t\treturn false;\n\n\t\tct_trash_all( e );\n\n\t});\n\n\t// Mark as spam all spam comments\n\tjQuery(\".ct_spam_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_spam_all))\n\t\t\treturn false;\n\n\t\tct_spam_all( e );\n\n\t});\n\n});\n\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n\tvar matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}"],"names":["ct_working","String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","from","till","ctSecure","is","val","location","protocol","document","cookie","ajax","type","url","ajaxurl","data","action","security","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","offset","Number","ctGetCookie","status_string","parseJSON","parseInt","error","confirm","error_message","new_href","href","end","hide","checked","spam","bad","total","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_trash_all","e","target","addClass","css","removeClass","ct_spam_all","name","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","alert","click","ct_check","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_trash_all","ct_confirm_spam_all"],"mappings":"AAYA,IAAIA,aAXJC,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,IAClEC,EAAmBN,EAAUI,UAAUJ,EAAUK,QAAQ,KAAM,GAAG,EAAGL,EAAUO,QACnFP,EAAYG,EAAmBD,UAAUH,GAAOO,EAE9C,OAAON,IAKVQ,cAAe,EACfC,sBAAuB,EACvBC,kBAAmB,EACnBC,mBAAoB,EACpBC,UAAW,EACXC,iBAAmBC,gBAAgBD,iBACnCE,aAAeD,gBAAgBC,aAC/BC,aAAeF,gBAAgBE,aAE5BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,gBAAgBM,cACnCC,kBAAoB,EACpBC,oBAAsB,EACtBC,iBAAmB,EACnBC,gBAAkB,EAClBC,aAAe,QACfC,aAAe,EACfC,aAAe,EAEhB,SAASC,gBAAgBC,EAAGC,GACxBpB,iBACK,IAAJmB,EACFE,OAAO,YAAYD,GAAIE,OAAO,IAAIH,EAAG,WACpCD,gBAAgB,EAAEE,KAGnBC,OAAO,YAAYD,GAAIE,OAAO,IAAIH,EAAG,WACpCD,gBAAgB,GAAIE,KAItBpB,kBAAiB,EAInB,SAASuB,oBAER,IAAIC,EAAO,EAAGC,EAAO,EAKjBC,GAJDL,OAAO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C,KAKf5D,OAAO,gBAAgBiG,MAAM,SAAUrC,GAEtC,IAAK1B,QAAQnD,gBAAgB2H,qBAC5B,OAAO,EAERzC,YAAaL"}
|
1 |
+
{"version":3,"file":"cleantalk-comments-checkspam.min.js","sources":["cleantalk-comments-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctCommentsCheck.ct_prev_accurate,\n\tct_prev_from = ctCommentsCheck.ct_prev_from,\t\n\tct_prev_till = ctCommentsCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,\n\tct_comments_total = 0,\n\tct_comments_checked = 0,\n\tct_comments_spam = 0,\n\tct_comments_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to==0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_comments(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\t\n\tvar data = {\n\t\t'action' : 'ajax_clear_comments',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}\n\t});\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_comments();\n\tct_show_info();\n}\n\nfunction ct_send_comments(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\t\n\tvar data = {\n\t\t'action': 'ajax_check_comments',\n\t\t'security': ct_ajax_nonce,\n\t\t'new_check': ct_new_check,\n\t\t'unchecked': ct_unchecked,\n\t\t'offset' : Number(ctGetCookie('apbct_check_comments_offset'))\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_comments();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause === true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_comments_checked += msg.checked;\n\t\t\t\t\tct_comments_spam += msg.spam;\n\t\t\t\t\tct_comments_bad += msg.bad;\n\t\t\t\t\tct_comments_total += msg.total;\n\t\t\t\t\tct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;\n\t\t\t\t\tvar status_string = String(ctCommentsCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_comments_checked, ct_comments_spam, ct_comments_bad);\n\t\t\t\t\tif(parseInt(ct_comments_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctCommentsCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\t\t\t\t\t// If DB woks not properly\n\t\t\t\t\tif(+ct_comments_total < ct_comments_checked + ct_comments_bad){\n\t\t\t\t\t\tdocument.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';\n\t\t\t\t\t\tlocation.href = 'edit-comments.php?page=ct_check_spam';\n\t\t\t\t\t}\n\n\t\t\t\t\tvar offset = Number(ctGetCookie('apbct_check_comments_offset')) + 100;\n\t\t\t\t\tdocument.cookie = 'apbct_check_comments_offset' + \"=\" + offset + \"; path=/\";\n\t\t\t\t\t\n\t\t\t\t\tct_send_comments();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_send_comments(), 3000); \n },\n timeout: 25000\n\t});\n}\nfunction ct_show_info(){\n\t\n\tif(ct_working){\n\t\t\n\t\tif(ct_cooling_down_flag == true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');\n\t\t\tjQuery('#ct_cooling_notice').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif(!ct_comments_total){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_comments',\n\t\t\t\t'security': ct_ajax_nonce\n\t\t\t};\n\t\t\t\n\t\t\tif(ct_date_from && ct_date_till){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_comments_total = msg.total;\n\t\t\t\t\tct_comments_spam = msg.spam;\n\t\t\t\t\tct_comments_checked = msg.checked;\n\t\t\t\t\tct_comments_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\t\t\tsetTimeout(ct_show_info(), 3000); \n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\nfunction ct_trash_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_trash_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_trash_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_trash_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\nfunction ct_spam_all( e ) {\n\n\tvar data = {\n\t\t'action': 'ajax_spam_all',\n\t\t'security': ct_ajax_nonce\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_comments_left').html(msg);\n\t\t\t\tct_spam_all( e );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='edit-comments.php?page=ct_check_spam';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check comments');\n\t\t\tsetTimeout(ct_spam_all( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n\n}\n\njQuery(document).ready(function(){\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\tfunction ct_start_check(continue_check){\n\n continue_check = continue_check || null;\n\n\t\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\t\t\t\n\t\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\t\t\t\t\t\t\n\t\t\tif(!(ct_date_from != '' && ct_date_till != '')){\n\t\t\t\talert('Please, specify a date range.');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\t\tct_accurate_check = true;\n\t\t}\n\t\t\n\t\tjQuery('.ct_to_hide').hide();\n\t\tjQuery('#ct_working_message').show();\n\t\tjQuery('#ct_preloader').show();\n\t\tjQuery('#ct_pause').show();\n\n\t\tct_working=true;\n\t\t\n\t\tif(continue_check){\n\t\t\tct_show_info();\n\t\t\tct_send_comments();\n\t\t}else\n\t\t\tct_clear_comments();\n\t\t\n\t}\n\t\n\t// Check comments\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_spam_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\n\n\tif(ctCommentsCheck.start === '1'){\n\t\tdocument.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';\n\t\tjQuery('#ct_check_spam_button').click();\t\n\t}\n\n\t// Delete all spam comments\n\tjQuery(\".ct_trash_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_trash_all))\n\t\t\treturn false;\n\n\t\tct_trash_all( e );\n\n\t});\n\n\t// Mark as spam all spam comments\n\tjQuery(\".ct_spam_all\").click(function( e ){\n\n\t\tif (!confirm(ctCommentsCheck.ct_confirm_spam_all))\n\t\t\treturn false;\n\n\t\tct_spam_all( e );\n\n\t});\n\n});\n\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction ctGetCookie(name) {\n\tvar matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}"],"names":["ct_working","String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctCommentsCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_comments_total","ct_comments_checked","ct_comments_spam","ct_comments_bad","ct_unchecked","ct_date_from","ct_date_till","animate_comment","to","id","jQuery","fadeTo","ct_clear_comments","from","till","ctSecure","is","val","location","protocol","document","cookie","ajax","type","url","ajaxurl","data","action","security","success","msg","ct_show_info","ct_send_comments","ct_cooling_down_toggle","setTimeout","new_check","unchecked","offset","Number","ctGetCookie","status_string","parseJSON","parseInt","error","confirm","error_message","new_href","href","end","hide","checked","spam","bad","total","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_trash_all","e","target","addClass","css","removeClass","ct_spam_all","name","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_start_check","continue_check","alert","click","ct_check","accurate","JSON","stringify","start","Date","toUTCString","ct_confirm_trash_all","ct_confirm_spam_all"],"mappings":"AAYA,IAAIA,WAAa,EAXjBC,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,CAAC,CAAC,EACpEC,EAAmBN,EAAUI,UAAUJ,EAAUK,QAAQ,KAAM,CAAC,EAAE,EAAGL,EAAUO,MAAM,EACzFP,EAAYG,EAAmBD,UAAUH,GAAOO,EAE9C,OAAON,CACX,GAICQ,aAAe,CAAA,EACfC,qBAAuB,CAAA,EACvBC,iBAAmB,CAAA,EACnBC,kBAAoB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IAC5C1B,kBAAoB,CAAA,GAGrBoB,OAAO,aAAa,EAAEuC,KAAK,EAC3BvC,OAAO,qBAAqB,EAAEkD,KAAK,EACnClD,OAAO,eAAe,EAAEkD,KAAK,EAC7BlD,OAAO,WAAW,EAAEkD,KAAK,EAEzBtF,WAAW,CAAA,GAERmI,GACF1E,aAAa,EACbC,kBAEApB,mBAFiB,EAInB,CAGAF,OAAO,uBAAuB,EAAEiG,MAAM,WAErCH,EAAe,EADfpF,SAASC,OAAS,+CACE,CACrB,CAAC,EACDX,OAAO,0BAA0B,EAAEiG,MAAM,WACxCH,EAAe,CAAA,CAAI,CACpB,CAAC,EAGD9F,OAAO,WAAW,EAAE0E,GAAG,QAAS,WAC/B7F,SAAW,CAAA,EACX,IAAIqH,EAAW,CACdC,SAAYvH,kBACZuB,KAAYR,aACZS,KAAYR,YACb,EACAc,SAASC,OAAS,wBAA0ByF,KAAKC,UAAUH,CAAQ,EAAI,wBACxE,CAAC,EAG4B,MAA1BnH,gBAAgBuH,QAClB5F,SAASC,OAAS,sCAAwC,IAAI4F,KAAK,CAAC,EAAEC,YAAY,EAAI,yBACtFxG,OAAO,uBAAuB,EAAEiG,MAAM,GAIvCjG,OAAO,eAAe,EAAEiG,MAAM,SAAUrC,GAEvC,GAAI,CAAC1B,QAAQnD,gBAAgB0H,oBAAoB,EAChD,MAAO,CAAA,EAER9C,aAAcC,CAAE,CAEjB,CAAC,EAGD5D,OAAO,cAAc,EAAEiG,MAAM,SAAUrC,GAEtC,GAAI,CAAC1B,QAAQnD,gBAAgB2H,mBAAmB,EAC/C,MAAO,CAAA,EAERzC,YAAaL,CAAE,CAEhB,CAAC,CAEF,CAAC"}
|
js/cleantalk-comments-editscreen.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-comments-editscreen.min.js","sources":["cleantalk-comments-editscreen.js"],"sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\t/* Shows link to blacklists near every email and IP address */\n\tif(parseInt(ctCommentsScreen.ct_show_check_links))\n\t\tjQuery('.column-author a, .comment-author a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){\n\t\t\t\tjQuery(this).after(' <a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctCommentsScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n\t\t\n\t/* Feedback for comments */\n\tvar ct_comment_id;\n\t\n\t// For approved\n\tjQuery('span.approve').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\n\t\n\t// For unapprove\n\tjQuery('span.unapprove').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\t\t\n\t});\n\t\n\t// For spammed\n\tjQuery('span.spam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\n\t\t\n\t\tsetTimeout(function(){\n\t\t\tjQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){\n\t\t\t\tvar result = jQuery(this).attr('href');\n\t\t\t\tresult = result.match(/^comment\\.php\\?.*&c=(\\d*).*/);\n\t\t\t\tct_comment_id = result[1];\n\t\t\t\tct_send_feedback_request(ct_comment_id, 'approve', 1);\n\t\t\t});\n\t\t}, 202);\n\t\t\n\t});\n\t\n\t// For unspammed\n\tjQuery('span.unspam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\n\t});\n\t\n\t// For untrashed\n\tjQuery('span.untrash a').on('click', function(){\n\t\tvar result = jQuery(this).attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tfeedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\t\n});\n\n// Send feedback to backend\nfunction ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){\n\t\n\tvar data = {\n\t\t'action': 'ct_feedback_comment',\n\t\t'security': ctCommentsScreen.ct_ajax_nonce,\n\t\t'comment_id': ct_comment_id,\n\t\t'comment_status': ct_comment_status\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n timeout: 5000\n\t});\n}\n\n// Outputs CT message about feedback\nfunction ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){\n\tif(ct_result == 1){\n\t\tif(ct_comment_status == 'approve' && !ct_undo){\n\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.css('background', 'rgba(110,240,110,0.7)')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\n\t\t}\n\t\tif(ct_comment_status == 'spam'){\n\t\t\tif(jQuery('tr').is('#undo-'+ct_comment_id)){\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id)\n\t\t\t\t\t.css('background', 'rgba(240,110,110,0.7)');\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')\n\t\t\t\t\t.append(\" \"+ctCommentsScreen.ct_feedback_msg);\n\t\t\t}else{\n\t\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.css('background', 'rgba(240,110,110,0.7)')\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\n\t\t\t}\n\t\t}\n\t}\n\tif(ct_result == 0){\n\t\t// Error occurred\n\t}if(ct_result == 'no_hash'){\n\t\t// No hash for this comment\n\t}\n}\n"],"names":["ct_is_email","str","search","ct_is_ip","ct_send_feedback_request","ct_comment_id","ct_comment_status","ct_undo","data","action","security","ctCommentsScreen","ct_ajax_nonce","comment_id","comment_status","jQuery","ajax","type","url","ajaxurl","success","msg","ct_feedback_message_output","error","jqXHR","textStatus","errorThrown","console","log","timeout","ct_result","html","show","append","children","css","ct_feedback_msg","is","document","ready","parseInt","ct_show_check_links","each","ct_curr_str","this","after","ct_img_src_new_tab","on","result","attr","match","undo_comment_id","setTimeout","click","feedback_result"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,
|
1 |
+
{"version":3,"file":"cleantalk-comments-editscreen.min.js","sources":["cleantalk-comments-editscreen.js"],"sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\t/* Shows link to blacklists near every email and IP address */\n\tif(parseInt(ctCommentsScreen.ct_show_check_links))\n\t\tjQuery('.column-author a, .comment-author a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){\n\t\t\t\tjQuery(this).after(' <a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctCommentsScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n\t\t\n\t/* Feedback for comments */\n\tvar ct_comment_id;\n\t\n\t// For approved\n\tjQuery('span.approve').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\n\t\n\t// For unapprove\n\tjQuery('span.unapprove').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\t\t\n\t});\n\t\n\t// For spammed\n\tjQuery('span.spam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tundo_comment_id = ct_comment_id;\n\t\tct_send_feedback_request(ct_comment_id, 'spam', 0);\n\t\t\n\t\tsetTimeout(function(){\n\t\t\tjQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){\n\t\t\t\tvar result = jQuery(this).attr('href');\n\t\t\t\tresult = result.match(/^comment\\.php\\?.*&c=(\\d*).*/);\n\t\t\t\tct_comment_id = result[1];\n\t\t\t\tct_send_feedback_request(ct_comment_id, 'approve', 1);\n\t\t\t});\n\t\t}, 202);\n\t\t\n\t});\n\t\n\t// For unspammed\n\tjQuery('span.unspam').on('click', function(){\n\t\tvar result = jQuery(this).children('a').attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tct_send_feedback_request(ct_comment_id, 'approve', 0);\n\t});\n\t\n\t// For untrashed\n\tjQuery('span.untrash a').on('click', function(){\n\t\tvar result = jQuery(this).attr('href');\n\t\tresult = result.match(/^comment\\.php\\?.*c=(\\d*).*/);\n\t\tct_comment_id = result[1];\n\t\tfeedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);\t\t\n\t});\t\n});\n\n// Send feedback to backend\nfunction ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){\n\t\n\tvar data = {\n\t\t'action': 'ct_feedback_comment',\n\t\t'security': ctCommentsScreen.ct_ajax_nonce,\n\t\t'comment_id': ct_comment_id,\n\t\t'comment_status': ct_comment_status\n\t};\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tconsole.log(jqXHR);\n\t\t\tconsole.log(textStatus);\n\t\t\tconsole.log(errorThrown);\n\t\t},\n timeout: 5000\n\t});\n}\n\n// Outputs CT message about feedback\nfunction ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){\n\tif(ct_result == 1){\n\t\tif(ct_comment_status == 'approve' && !ct_undo){\n\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.css('background', 'rgba(110,240,110,0.7)')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\n\t\t}\n\t\tif(ct_comment_status == 'spam'){\n\t\t\tif(jQuery('tr').is('#undo-'+ct_comment_id)){\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id)\n\t\t\t\t\t.css('background', 'rgba(240,110,110,0.7)');\n\t\t\t\tjQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')\n\t\t\t\t\t.append(\" \"+ctCommentsScreen.ct_feedback_msg);\n\t\t\t}else{\n\t\t\t\tjQuery('tr#comment-'+ct_comment_id)\n\t\t\t\t.html('')\n\t\t\t\t.show()\n\t\t\t\t.css('background', 'rgba(240,110,110,0.7)')\n\t\t\t\t.append(\"<td colspan='5'></td>\").children('td')\n\t\t\t\t\t.append(\"<div class='spam-undo-inside'>\"+ctCommentsScreen.ct_feedback_msg+\"</div>\");\n\t\t\t}\n\t\t}\n\t}\n\tif(ct_result == 0){\n\t\t// Error occurred\n\t}if(ct_result == 'no_hash'){\n\t\t// No hash for this comment\n\t}\n}\n"],"names":["ct_is_email","str","search","ct_is_ip","ct_send_feedback_request","ct_comment_id","ct_comment_status","ct_undo","data","action","security","ctCommentsScreen","ct_ajax_nonce","comment_id","comment_status","jQuery","ajax","type","url","ajaxurl","success","msg","ct_feedback_message_output","error","jqXHR","textStatus","errorThrown","console","log","timeout","ct_result","html","show","append","children","css","ct_feedback_msg","is","document","ready","parseInt","ct_show_check_links","each","ct_curr_str","this","after","ct_img_src_new_tab","on","result","attr","match","undo_comment_id","setTimeout","click","feedback_result"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,WAAW,CAC9B,CACA,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,sCAAsC,CACzD,CAuEA,SAASE,yBAAyBC,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AAO,GACiB,UAAW,CAAC,CACrD,CAAC,EAGDjC,OAAO,gBAAgB,EAAEgC,GAAG,QAAS,WACpC,IACAC,GAASA,EADIjC,OAAO6B,IAAI,EAAEK,KAAK,MAAM,GACrBC,MAAM,4BAA4B,EAClD7C,EAAgB2C,EAAO,GACvBM,gBAAkBlD,yBAAyBC,EAAe,UAAW,CAAC,CACvE,CAAC,CACF,CAAC"}
|
js/cleantalk-dashboard-widget.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-dashboard-widget.min.js","sources":["cleantalk-dashboard-widget.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set \"refresh\" link handler\n\tjQuery(\".ct_widget_refresh_link\").on('click', function(){\n\t\tjQuery('.ct_preloader').show();\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\t\t\n\t\tsetTimeout(function(){jQuery(\"#ct_refresh_form\").submit();}, 2500);\n\t});\n\t\n\tif(location.hash == '#ct_widget')\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\n\t\n\t// Fixing default wrapper style\n\tjQuery(\"#ct_widget_wrapper\").parent().css('padding', 0);\n\t\n\t// Chart \n\tvar ct_chart = document.getElementById('ct_widget_chart'),\n\t\tlocale = navigator.language || navigator.userLanguage;\n\t\t\n\tfunction ctParseData(date){\n\t\tvar date_formatter = new Intl.DateTimeFormat(locale, {\n\t\t\tmonth: \"short\",\n\t\t\tday: \"numeric\"\n\t\t});\t\n\t\tdate.sort(function(a,b){\n\t\t\treturn new Date(a[0]) - new Date(b[0]) \n\t\t});\t\t\t\n\t\tdate.forEach(function(d){\t\n\t\t\td[0] = Date.parse(d[0]);\n\t\t\td[0] = date_formatter.format(d[0]);\n\t\t});\t\t\n\t}\n\t\t\n\tgoogle.charts.load('current', {packages:['corechart', 'bar']});\n\tgoogle.charts.setOnLoadCallback(drawStuff);\n\n\tfunction drawStuff() {\n\t\tvar data = new google.visualization.DataTable();\n\t\tdata.addColumn('string', 'Spam Blocked');\n\t\tdata.addColumn('number', 'Frequency');\n\t\t\n\t\tctParseData(apbctDashboardWidget.data);\n\t\tdata.addRows(apbctDashboardWidget.data);\n\t\n\t\tvar options = {\n\t\t\twidth: jQuery(\".ct_widget_block\").first().width(),\n\t\t\theight: 300,\n\t\t\tcolors: ['steelblue'],\n\t\t\tlegend: 'none',\n\t\t\tbar: {groupWidth: '95%'},\n\t\t\tchartArea:{left:30,top:20,width:'93%',height:'80%'},\n\t\t\tvAxis: { gridlines: { count: 5 } }\n\t\t};\n\n\t\tif(ct_chart){\n\t\t\tvar chart = new google.visualization.ColumnChart(ct_chart);\n\t\t\tchart.draw(data, options);\n\t\t}\n\t};\t\n});"],"names":["jQuery","document","ready","on","show","setTimeout","window","scrollTo","offset","top","submit","location","hash","parent","css","ct_chart","getElementById","locale","navigator","language","userLanguage","google","charts","load","packages","setOnLoadCallback","data","visualization","DataTable","options","addColumn","date","date_formatter","Intl","DateTimeFormat","month","day","sort","a","b","Date","forEach","d","parse","format","
|
1 |
+
{"version":3,"file":"cleantalk-dashboard-widget.min.js","sources":["cleantalk-dashboard-widget.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set \"refresh\" link handler\n\tjQuery(\".ct_widget_refresh_link\").on('click', function(){\n\t\tjQuery('.ct_preloader').show();\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\t\t\n\t\tsetTimeout(function(){jQuery(\"#ct_refresh_form\").submit();}, 2500);\n\t});\n\t\n\tif(location.hash == '#ct_widget')\n\t\tsetTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);\n\t\n\t// Fixing default wrapper style\n\tjQuery(\"#ct_widget_wrapper\").parent().css('padding', 0);\n\t\n\t// Chart \n\tvar ct_chart = document.getElementById('ct_widget_chart'),\n\t\tlocale = navigator.language || navigator.userLanguage;\n\t\t\n\tfunction ctParseData(date){\n\t\tvar date_formatter = new Intl.DateTimeFormat(locale, {\n\t\t\tmonth: \"short\",\n\t\t\tday: \"numeric\"\n\t\t});\t\n\t\tdate.sort(function(a,b){\n\t\t\treturn new Date(a[0]) - new Date(b[0]) \n\t\t});\t\t\t\n\t\tdate.forEach(function(d){\t\n\t\t\td[0] = Date.parse(d[0]);\n\t\t\td[0] = date_formatter.format(d[0]);\n\t\t});\t\t\n\t}\n\t\t\n\tgoogle.charts.load('current', {packages:['corechart', 'bar']});\n\tgoogle.charts.setOnLoadCallback(drawStuff);\n\n\tfunction drawStuff() {\n\t\tvar data = new google.visualization.DataTable();\n\t\tdata.addColumn('string', 'Spam Blocked');\n\t\tdata.addColumn('number', 'Frequency');\n\t\t\n\t\tctParseData(apbctDashboardWidget.data);\n\t\tdata.addRows(apbctDashboardWidget.data);\n\t\n\t\tvar options = {\n\t\t\twidth: jQuery(\".ct_widget_block\").first().width(),\n\t\t\theight: 300,\n\t\t\tcolors: ['steelblue'],\n\t\t\tlegend: 'none',\n\t\t\tbar: {groupWidth: '95%'},\n\t\t\tchartArea:{left:30,top:20,width:'93%',height:'80%'},\n\t\t\tvAxis: { gridlines: { count: 5 } }\n\t\t};\n\n\t\tif(ct_chart){\n\t\t\tvar chart = new google.visualization.ColumnChart(ct_chart);\n\t\t\tchart.draw(data, options);\n\t\t}\n\t};\t\n});"],"names":["jQuery","document","ready","on","show","setTimeout","window","scrollTo","offset","top","submit","location","hash","parent","css","ct_chart","getElementById","locale","navigator","language","userLanguage","google","charts","load","packages","setOnLoadCallback","data","visualization","DataTable","options","addColumn","date","date_formatter","Intl","DateTimeFormat","month","day","sort","a","b","Date","forEach","d","parse","format","apbctDashboardWidget","addRows","width","first","height","colors","legend","bar","groupWidth","chartArea","left","vAxis","gridlines","count","ColumnChart","draw"],"mappings":"AAAAA,OAAOC,QAAQ,EAAEC,MAAM,WAGtBF,OAAO,yBAAyB,EAAEG,GAAG,QAA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,OACRC,IAAK,CAACC,WAAY,KAAK,EACvBC,UAAU,CAACC,KAAK,GAAG9C,IAAI,GAAGsC,MAAM,MAAME,OAAO,KAAK,EAClDO,MAAO,CAAEC,UAAW,CAAEC,MAAO,CAAE,CAAE,CAClC,GAEG3C,GACU,IAAIM,OAAOM,cAAcgC,YAAY5C,CAAQ,EACnD6C,KAAKlC,EAAMG,CAAO,CAE1B,CAxByC,CAyB1C,CAAC"}
|
js/cleantalk-debug-ajax.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-debug-ajax.min.js","sources":["cleantalk-debug-ajax.js"],"sourcesContent":["jQuery(document).ready(function(){\n\n\tconsole.log('CT debug');\n\n\t// Debug. Console all AJAX requests.\n\tjQuery(document).ajaxComplete(function(event, xhr, settings, data) {\n\t\tconsole.log(\"Success!\")\n\t\tconsole.log('Event:\\n');\n\t\tconsole.log(event);\n\t\tconsole.log('Response:\\n');\n\t\tconsole.log(xhr);\n\t\tconsole.log('Request settings:\\n');\n\t\tconsole.log(settings);\n\t\tconsole.log('Data:\\n');\n\t\tconsole.log(data);\n\t});\n\t\t\n});"],"names":["jQuery","document","ready","console","log","ajaxComplete","event","xhr","settings","data"],"mappings":"AAAAA,OAAOC,
|
1 |
+
{"version":3,"file":"cleantalk-debug-ajax.min.js","sources":["cleantalk-debug-ajax.js"],"sourcesContent":["jQuery(document).ready(function(){\n\n\tconsole.log('CT debug');\n\n\t// Debug. Console all AJAX requests.\n\tjQuery(document).ajaxComplete(function(event, xhr, settings, data) {\n\t\tconsole.log(\"Success!\")\n\t\tconsole.log('Event:\\n');\n\t\tconsole.log(event);\n\t\tconsole.log('Response:\\n');\n\t\tconsole.log(xhr);\n\t\tconsole.log('Request settings:\\n');\n\t\tconsole.log(settings);\n\t\tconsole.log('Data:\\n');\n\t\tconsole.log(data);\n\t});\n\t\t\n});"],"names":["jQuery","document","ready","console","log","ajaxComplete","event","xhr","settings","data"],"mappings":"AAAAA,OAAOC,QAAQ,EAAEC,MAAM,WAEtBC,QAAQC,IAAI,UAAU,EAGtBJ,OAAOC,QAAQ,EAAEI,aAAa,SAASC,EAAOC,EAAKC,EAAUC,GAC5DN,QAAQC,IAAI,UAAU,EACtBD,QAAQC,IAAI,UAAU,EACtBD,QAAQC,IAAIE,CAAK,EACjBH,QAAQC,IAAI,aAAa,EACzBD,QAAQC,IAAIG,CAAG,EACfJ,QAAQC,IAAI,qBAAqB,EACjCD,QAAQC,IAAII,CAAQ,EACpBL,QAAQC,IAAI,SAAS,EACrBD,QAAQC,IAAIK,CAAI,CACjB,CAAC,CAEF,CAAC"}
|
js/cleantalk-public-admin.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-public-admin.min.js","sources":["cleantalk-public-admin.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set background-color similar to parents\njQuery('.ct_comment_info').parents().each(function() {\n if ((e = jQuery(this).css('background-color')).length > 0 && e != 'rgba(0, 0, 0, 0)'){ \n \tjQuery('.ct_comment_info').css('background', e);\n \treturn false;\n }\n});\n\t\n\t// Set same float style with article\n\tvar ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');\n\tjQuery('.ct_comment_info').css('float', ct_post_float);\n\t\n\tvar ct_posts = jQuery('.ct_comment_info');\n\t\n\tjQuery(ct_posts).each(function(indx, elem){\n\t\tcurr_elem = jQuery(elem);\n\t\tcurr_elem.parent().prepend(curr_elem);\n\t});\n\t\n\t// Handler for buttons\n\tjQuery('.ct_this_is').on('click', function(){\n\t\t\n\t\tvar ct_current_button = jQuery(this),\n\t\t\tct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),\n\t\t\tct_feedback_msg = jQuery('.ct_feedback_msg'),\n\t\t\tct_comment_status;\n\t\t\t\n\t\tif(ct_current_button.hasClass('ct_this_is_spam'))\n\t\t\tct_comment_status = 'spam';\n\t\telse\n\t\t\tct_comment_status = 'approve';\n\t\t\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_comment',\n\t\t\t'security': ctPublicAdmin.ct_ajax_nonce,\n\t\t\t'comment_id': ct_current_button.attr('commentid'),\n\t\t\t'comment_status': ct_comment_status,\n\t\t\t'change_status': 1\n\t\t};\n\t\t\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ctPublicAdmin.ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tct_current_button.hide();\n\t\t\t\tct_current_button.siblings('span.ct_this_is').show();\n\t\t\t\t\n\t\t\t\tjQuery('.ct_feedback_result').hide();\n\t\t\t\tif(ct_comment_status == 'approve')\n\t\t\t\t\tjQuery('.ct_feedback_result_not_spam').show();\n\t\t\t\telse\n\t\t\t\t\tjQuery('.ct_feedback_result_spam').show();\n\t\t\t\t\n\t\t\t\tif(msg == 1){\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_success');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);\n\t\t\t\t}else if(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_error');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);\n\t\t\t\t}else if(msg == 'no_hash'){\n\t\t\t\t\t// No hash for this comment\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_no_hash');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);\n\t\t\t\t}\n\t\t\t\t// Hidding feedback message for every message type\n\t\t\t\tct_feedback_wrap.show();\n\t\t\t\tct_feedback_wrap.css('display', 'inline-block');\n\t\t\t\t\n\t\t\t\tvar ct_timeout_id = ct_feedback_wrap.data('interval_id');\n\t\t\t\tclearInterval(ct_timeout_id);\n\t\t\t\tct_timeout_id = setTimeout(function(){\n\t\t\t\t\tct_feedback_wrap.fadeOut(1000);\n\t\t\t\t}, 5000);\n\t\t\t\tct_feedback_wrap.data('interval_id', ct_timeout_id);\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t},\n\t\t\ttimeout: 15000\n\t\t});\n\t});\n\t\n});"],"names":["jQuery","document","ready","parents","each","e","this","css","length","ct_post_float","prev","last","ct_posts","indx","elem","curr_elem","parent","prepend","on","ct_current_button","ct_feedback_wrap","siblings","ct_feedback_msg","ct_comment_status","hasClass","data","action","security","ctPublicAdmin","ct_ajax_nonce","comment_id","attr","comment_status","change_status","ajax","type","url","ajaxurl","success","msg","hide","show","addClass","html","ct_feedback_error","ct_feedback_no_hash","ct_timeout_id","clearInterval","setTimeout","fadeOut","error","jqXHR","textStatus","errorThrown","console","log","timeout"],"mappings":"AAAAA,OAAOC,
|
1 |
+
{"version":3,"file":"cleantalk-public-admin.min.js","sources":["cleantalk-public-admin.js"],"sourcesContent":["jQuery(document).ready(function(){\n\t\n\t// Set background-color similar to parents\njQuery('.ct_comment_info').parents().each(function() {\n if ((e = jQuery(this).css('background-color')).length > 0 && e != 'rgba(0, 0, 0, 0)'){ \n \tjQuery('.ct_comment_info').css('background', e);\n \treturn false;\n }\n});\n\t\n\t// Set same float style with article\n\tvar ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');\n\tjQuery('.ct_comment_info').css('float', ct_post_float);\n\t\n\tvar ct_posts = jQuery('.ct_comment_info');\n\t\n\tjQuery(ct_posts).each(function(indx, elem){\n\t\tcurr_elem = jQuery(elem);\n\t\tcurr_elem.parent().prepend(curr_elem);\n\t});\n\t\n\t// Handler for buttons\n\tjQuery('.ct_this_is').on('click', function(){\n\t\t\n\t\tvar ct_current_button = jQuery(this),\n\t\t\tct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),\n\t\t\tct_feedback_msg = jQuery('.ct_feedback_msg'),\n\t\t\tct_comment_status;\n\t\t\t\n\t\tif(ct_current_button.hasClass('ct_this_is_spam'))\n\t\t\tct_comment_status = 'spam';\n\t\telse\n\t\t\tct_comment_status = 'approve';\n\t\t\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_comment',\n\t\t\t'security': ctPublicAdmin.ct_ajax_nonce,\n\t\t\t'comment_id': ct_current_button.attr('commentid'),\n\t\t\t'comment_status': ct_comment_status,\n\t\t\t'change_status': 1\n\t\t};\n\t\t\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ctPublicAdmin.ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tct_current_button.hide();\n\t\t\t\tct_current_button.siblings('span.ct_this_is').show();\n\t\t\t\t\n\t\t\t\tjQuery('.ct_feedback_result').hide();\n\t\t\t\tif(ct_comment_status == 'approve')\n\t\t\t\t\tjQuery('.ct_feedback_result_not_spam').show();\n\t\t\t\telse\n\t\t\t\t\tjQuery('.ct_feedback_result_spam').show();\n\t\t\t\t\n\t\t\t\tif(msg == 1){\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_success');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);\n\t\t\t\t}else if(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_error');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);\n\t\t\t\t}else if(msg == 'no_hash'){\n\t\t\t\t\t// No hash for this comment\n\t\t\t\t\tct_feedback_msg.addClass('ct_feedback_no_hash');\n\t\t\t\t\tct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);\n\t\t\t\t}\n\t\t\t\t// Hidding feedback message for every message type\n\t\t\t\tct_feedback_wrap.show();\n\t\t\t\tct_feedback_wrap.css('display', 'inline-block');\n\t\t\t\t\n\t\t\t\tvar ct_timeout_id = ct_feedback_wrap.data('interval_id');\n\t\t\t\tclearInterval(ct_timeout_id);\n\t\t\t\tct_timeout_id = setTimeout(function(){\n\t\t\t\t\tct_feedback_wrap.fadeOut(1000);\n\t\t\t\t}, 5000);\n\t\t\t\tct_feedback_wrap.data('interval_id', ct_timeout_id);\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\tconsole.log(jqXHR);\n\t\t\t\tconsole.log(textStatus);\n\t\t\t\tconsole.log(errorThrown);\n\t\t\t},\n\t\t\ttimeout: 15000\n\t\t});\n\t});\n\t\n});"],"names":["jQuery","document","ready","parents","each","e","this","css","length","ct_post_float","prev","last","ct_posts","indx","elem","curr_elem","parent","prepend","on","ct_current_button","ct_feedback_wrap","siblings","ct_feedback_msg","ct_comment_status","hasClass","data","action","security","ctPublicAdmin","ct_ajax_nonce","comment_id","attr","comment_status","change_status","ajax","type","url","ajaxurl","success","msg","hide","show","addClass","html","ct_feedback_error","ct_feedback_no_hash","ct_timeout_id","clearInterval","setTimeout","fadeOut","error","jqXHR","textStatus","errorThrown","console","log","timeout"],"mappings":"AAAAA,OAAOC,QAAQ,EAAEC,MAAM,WAGvBF,OAAO,kBAAkB,EAAEG,QAAQ,EAAEC,KAAK,WACxC,GAAwD,GAAnDC,EAAIL,OAAOM,IAAI,EAAEC,IAAI,kBAAkB,GAAGC,QAAmB,oBAALH,EAE5D,OADAL,OAAO,kBAAkB,EAAEO,IAAI,aAAcF,CAAC,EACvC,CAAA,CAEV,CAAC,EAGA,IAAII,EAAgBT,OAAO,kBAAkB,EAAEU,KAAK,EAAEC,KAAK,EAAEJ,IAAI,OAAO,EAGpEK,GAFJZ,OAAO,kBAAkB,EAAEO,IAAI,QAASE,CAAa,EAEtCT,OAAO,kBAAkB,GAExCA,OAAOY,CAAQ,EAAER,KAAK,SAASS,EAAMC,IACpCC,UAAYf,OAAOc,CAAI,GACbE,OAAO,EAAEC,QAAQF,SAAS,CACrC,CAAC,EAGDf,OAAO,aAAa,EAAEkB,GAAG,QAAS,WAEjC,IAAIC,EAAoBnB,OAAOM,IAAI,EAClCc,EAAmBpB,OAAOM,IAAI,EAAEe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=function(){var e,t=this;for(e in arguments)var c=t.substring(0,t.indexOf("%s",0)),a=t.substring(t.indexOf("%s",0)+2,t.length),t=c+arguments[e]+a;return t};var ct_working=!(document.cookie="ct_check_users__amount=100; path=/; samesite=lax"),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctUsersCheck.ct_prev_accurate,ct_prev_from=ctUsersCheck.ct_prev_from,ct_prev_till=ctUsersCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctUsersCheck.ct_ajax_nonce,ct_users_total=0,ct_users_checked=0,ct_users_spam=0,ct_users_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function apbct_cookie__get(_,r){var s={};return"string"==typeof(_=_||null)&&(_=_.split()),"string"==typeof(r="none"===(r=r||["apbct_","ct_"])?null:r)&&(r=r.split()),document.cookie.split(";").forEach(function(e,t,c){var a=e.trim().split("=");_&&_.forEach(function(e,t,c){a[0]===e&&(s[a[0]]=a[1])}),r&&r.forEach(function(e,t,c){0===a[0].indexOf(e)&&(s[a[0]]=a[1])})}),s}function apbct_get_cookie(e){var t=apbct_cookie__get(e,e);return"object"==typeof t&&void 0!==t[e]?t[e]:null}function animate_comment(e,t){ct_close_animate?.3===e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_users(){var e=0,t=0,c=(jQuery("#ct_allow_date_range").is(":checked")&&(e=jQuery("#ct_date_range_from").val(),t=jQuery("#ct_date_range_till").val()),"https:"===location.protocol?"; secure":""),c=(document.cookie="apbct_check_users_offset=0; path=/; samesite=lax"+c,{action:"ajax_clear_users",security:ct_ajax_nonce,from:e,till:t,no_cache:Math.random()});jQuery.ajax({type:"POST",url:ajaxurl,data:c,success:function(e){ct_show_users_info(),ct_send_users()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_users(),ct_show_users_info()}function ct_send_users(){if(!0!==ct_cooling_down_flag){if(ct_max_requests<=ct_requests_counter)return setTimeout(ct_cooling_down_toggle,ct_cool_down_time),void(ct_cooling_down_flag=!(ct_requests_counter=0));ct_requests_counter++;var a=apbct_get_cookie("ct_check_users__amount"),e={action:"ajax_check_users",security:ct_ajax_nonce,new_check:ct_new_check,unchecked:ct_unchecked,amount:a,no_cache:Math.random(),offset:Number(getCookie("apbct_check_users_offset"))};ct_accurate_check&&(e.accurate_check=!0),ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t;e=jQuery.parseJSON(e),parseInt(e.error)?(ct_working=!1,confirm(e.error_message+". Do you want to proceed?")?ct_send_users():(t="users.php?page=ct_check_users",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t)):(ct_new_check=!1,1==parseInt(e.end)||1==ct_pause?(1==parseInt(e.end)&&(document.cookie="ct_paused_users_check=0; path=/; samesite=lax"),ct_working=!1,jQuery("#ct_working_message").hide(),t="users.php?page=ct_check_users&ct_worked=1",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t):0==parseInt(e.end)&&(ct_users_checked=parseInt(ct_users_checked)+parseInt(e.checked),ct_users_spam=parseInt(ct_users_spam)+parseInt(e.spam),ct_users_bad=parseInt(e.bad),ct_unchecked=ct_users_total-ct_users_checked-ct_users_bad,t=(t=String(ctUsersCheck.ct_status_string)).printf(ct_users_checked,ct_users_spam,ct_users_bad),0<parseInt(ct_users_spam)&&(t+=ctUsersCheck.ct_status_string_warning),jQuery("#ct_checking_status").html(t),jQuery("#ct_error_message").hide(),e=Number(getCookie("apbct_check_users_offset"))+100,t="https:"===location.protocol?"; secure":"",document.cookie="apbct_check_users_offset="+e+"; path=/; samesite=lax"+t,ct_send_users()))},error:function(e,t,c){20<a&&(a-=20,document.cookie="ct_check_users__amount="+a+"; path=/; samesite=lax"),jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check users"),setTimeout(ct_send_users(),3e3)},timeout:25e3})}}function ct_show_users_info(){var e;ct_working&&(!0===ct_cooling_down_flag?jQuery("#ct_cooling_notice").html("Waiting for API to cool down. (About a minute)").show():(jQuery("#ct_cooling_notice").hide(),ct_users_total||(e={action:"ajax_info_users",security:ct_ajax_nonce,no_cache:Math.random()},ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){e=jQuery.parseJSON(e),jQuery("#ct_checking_status").html(e.message),ct_users_spam=e.spam,ct_users_checked=e.checked,ct_users_bad=e.bad},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Show users"),setTimeout(ct_show_users_info(),3e3)},timeout:15e3}))))}function ct_toggle_depended(e,t){t=t||null;var c=jQuery(e.data("depended"));e.data("state")||t?(e.data("state",!1),c.prop("disabled",!0),c.removeProp("checked"),c.data("depended")&&ct_toggle_depended(c,!0)):(e.data("state",!0),c.removeProp("disabled"))}function ct_start_check(e){e=e||null,jQuery("#ct_allow_date_range").is(":checked")&&(ct_date_from=jQuery("#ct_date_range_from").val(),ct_date_till=jQuery("#ct_date_range_till").val(),""===ct_date_from||""===ct_date_till)?alert(ctUsersCheck.ct_specify_date_range):(jQuery("#ct_accurate_check").is(":checked")&&(ct_accurate_check=!0),jQuery("#ct_accurate_check").is(":checked")&&!jQuery("#ct_allow_date_range").is(":checked")?alert(ctUsersCheck.ct_select_date_range):(jQuery(".ct_to_hide").hide(),jQuery("#ct_working_message").show(),jQuery("#ct_preloader").show(),jQuery("#ct_pause").show(),ct_working=!0,e?(ct_show_users_info(),ct_send_users()):ct_clear_users()))}function ct_delete_all_users(a){var t={action:"ajax_delete_all_users",security:ct_ajax_nonce,no_cache:Math.random()};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:t,success:function(e){0<e?(jQuery("#cleantalk_users_left").html(e),ct_delete_all_users(a,t)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="users.php?page=ct_check_users")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("All users deleteion"),setTimeout(ct_delete_all_users(a),3e3)},timeout:25e3})}function getCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}jQuery(document).ready(function(){ct_prev_accurate&&jQuery("#ct_accurate_check").prop("checked",!0),ct_prev_from&&(jQuery("#ct_allow_date_range").prop("checked",!0).data("state",!0),jQuery("#ct_date_range_from").removeProp("disabled").val(ct_prev_from),jQuery("#ct_date_range_till").removeProp("disabled").val(ct_prev_till)),jQuery("#ct_allow_date_range").on("change",function(){document.cookie="ct_users_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_users_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax",this.checked?(document.cookie="ct_users_dates_allowed=1; path=/; samesite=lax",jQuery(".ct_date").prop("checked",!0).attr("disabled",!1)):(document.cookie="ct_users_dates_allowed=0; path=/; samesite=lax",jQuery(".ct_date").prop("disabled",!0).attr("disabled",!0))}),jQuery.datepicker.setDefaults(jQuery.datepicker.regional.en);var a=jQuery("#ct_date_range_from, #ct_date_range_till").datepicker({dateFormat:"M d yy",maxDate:"+0D",changeMonth:!0,changeYear:!0,showAnim:"slideDown",onSelect:function(e){var t="ct_date_range_from"==this.id?"minDate":"maxDate",c=jQuery(this).data("datepicker"),e=jQuery.datepicker.parseDate(c.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,e,c.settings);a.not(this).datepicker("option",t,e),document.cookie="ct_users_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_users_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax"}});function t(t){t=t||null;var e={action:"ajax_insert_users",security:ct_ajax_nonce,no_cache:Math.random()};t&&(e.delete=!0),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){t?alert("Deleted "+e+" users"):alert("Inserted "+e+" users")}})}jQuery("#ct_check_spam_button").click(function(){ct_start_check(!(document.cookie="ct_paused_users_check=0; path=/; samesite=lax"))}),jQuery("#ct_proceed_check_button").click(function(){ct_start_check(!0)}),jQuery("#ct_pause").on("click",function(){ct_pause=!0;var e={accurate:ct_accurate_check,from:ct_date_from,till:ct_date_till};document.cookie="ct_paused_users_check="+JSON.stringify(e)+"; path=/; samesite=lax"}),jQuery(".cleantalk_delete_from_list_button").click(function(){ct_id=jQuery(this).attr("data-id");var e={action:"ajax_ct_approve_user",security:ct_ajax_nonce,id:ct_id,no_cache:Math.random()},e=(jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){jQuery("#comment-"+ct_id).fadeOut("slow",function(){jQuery("#comment-"+ct_id).remove()})}}),{action:"ct_feedback_user",security:ct_ajax_nonce,user_id:ct_id,status:"approve",no_cache:Math.random()});jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){},error:function(e,t,c){},timeout:5e3})}),jQuery(".ct_get_csv_file").click(function(c){var e={action:"ajax_ct_get_csv_file",security:ct_ajax_nonce,filename:ctUsersCheck.ct_csv_filename,no_cache:Math.random()};jQuery("."+c.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t;0===parseInt(e)?alert(ctUsersCheck.ct_bad_csv):(e=URL.createObjectURL(new Blob([e])),(t=document.createElement("a")).href=e,t.download=ctUsersCheck.ct_csv_filename+".csv",document.body.appendChild(t),t.click()),jQuery("."+c.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden")}})}),jQuery(".ct_insert_users").click(function(e){t()}),jQuery(".ct_insert_users__delete").click(function(e){t(!0)}),jQuery(".ct_delete_all_users").click(function(e){if(!confirm(ctUsersCheck.ct_confirm_deletion_all))return!1;ct_delete_all_users(e)}),jQuery("#ct_accurate_check").change(function(){this.checked&&(jQuery("#ct_allow_date_range").prop("checked",!0),jQuery(".ct_date").prop("checked",!0).attr("disabled",!1))})});
|
2 |
//# sourceMappingURL=cleantalk-users-checkspam.min.js.map
|
1 |
+
String.prototype.printf=function(){var e,t=this;for(e in arguments)var c=t.substring(0,t.indexOf("%s",0)),a=t.substring(t.indexOf("%s",0)+2,t.length),t=c+arguments[e]+a;return t};var ct_working=!(document.cookie="ct_check_users__amount=100; path=/; samesite=lax"),ct_new_check=!0,ct_cooling_down_flag=!1,ct_close_animate=!0,ct_accurate_check=!1,ct_pause=!1,ct_prev_accurate=ctUsersCheck.ct_prev_accurate,ct_prev_from=ctUsersCheck.ct_prev_from,ct_prev_till=ctUsersCheck.ct_prev_till,ct_cool_down_time=9e4,ct_requests_counter=0,ct_max_requests=60,ct_ajax_nonce=ctUsersCheck.ct_ajax_nonce,ct_users_total=0,ct_users_checked=0,ct_users_spam=0,ct_users_bad=0,ct_unchecked="unset",ct_date_from=0,ct_date_till=0;function apbct_cookie__get(_,r){var s={};return"string"==typeof(_=_||null)&&(_=_.split()),"string"==typeof(r="none"===(r=r||["apbct_","ct_"])?null:r)&&(r=r.split()),document.cookie.split(";").forEach(function(e,t,c){var a=e.trim().split("=");_&&_.forEach(function(e,t,c){a[0]===e&&(s[a[0]]=a[1])}),r&&r.forEach(function(e,t,c){0===a[0].indexOf(e)&&(s[a[0]]=a[1])})}),s}function apbct_get_cookie(e){var t=apbct_cookie__get(e,e);return"object"==typeof t&&void 0!==t[e]?t[e]:null}function animate_comment(e,t){ct_close_animate?.3===e?jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(1,t)}):jQuery("#comment-"+t).fadeTo(200,e,function(){animate_comment(.3,t)}):ct_close_animate=!0}function ct_clear_users(){var e=0,t=0,c=(jQuery("#ct_allow_date_range").is(":checked")&&(e=jQuery("#ct_date_range_from").val(),t=jQuery("#ct_date_range_till").val()),"https:"===location.protocol?"; secure":""),c=(document.cookie="apbct_check_users_offset=0; path=/; samesite=lax"+c,{action:"ajax_clear_users",security:ct_ajax_nonce,from:e,till:t,no_cache:Math.random()});jQuery.ajax({type:"POST",url:ajaxurl,data:c,success:function(e){ct_show_users_info(),ct_send_users()}})}function ct_cooling_down_toggle(){ct_cooling_down_flag=!1,ct_send_users(),ct_show_users_info()}function ct_send_users(){var a,e;!0!==ct_cooling_down_flag&&(ct_max_requests<=ct_requests_counter?(setTimeout(ct_cooling_down_toggle,ct_cool_down_time),ct_cooling_down_flag=!(ct_requests_counter=0)):(ct_requests_counter++,a=apbct_get_cookie("ct_check_users__amount"),e={action:"ajax_check_users",security:ct_ajax_nonce,new_check:ct_new_check,unchecked:ct_unchecked,amount:a,no_cache:Math.random(),offset:Number(getCookie("apbct_check_users_offset"))},ct_accurate_check&&(e.accurate_check=!0),ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t;e=jQuery.parseJSON(e),parseInt(e.error)?(ct_working=!1,confirm(e.error_message+". Do you want to proceed?")?ct_send_users():(t="users.php?page=ct_check_users",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t)):(ct_new_check=!1,1==parseInt(e.end)||1==ct_pause?(1==parseInt(e.end)&&(document.cookie="ct_paused_users_check=0; path=/; samesite=lax"),ct_working=!1,jQuery("#ct_working_message").hide(),t="users.php?page=ct_check_users&ct_worked=1",0!=ct_date_from&&0!=ct_date_till&&(t+="&from="+ct_date_from+"&till="+ct_date_till),location.href=t):0==parseInt(e.end)&&(ct_users_checked=parseInt(ct_users_checked)+parseInt(e.checked),ct_users_spam=parseInt(ct_users_spam)+parseInt(e.spam),ct_users_bad=parseInt(e.bad),ct_unchecked=ct_users_total-ct_users_checked-ct_users_bad,t=(t=String(ctUsersCheck.ct_status_string)).printf(ct_users_checked,ct_users_spam,ct_users_bad),0<parseInt(ct_users_spam)&&(t+=ctUsersCheck.ct_status_string_warning),jQuery("#ct_checking_status").html(t),jQuery("#ct_error_message").hide(),e=Number(getCookie("apbct_check_users_offset"))+100,t="https:"===location.protocol?"; secure":"",document.cookie="apbct_check_users_offset="+e+"; path=/; samesite=lax"+t,ct_send_users()))},error:function(e,t,c){20<a&&(a-=20,document.cookie="ct_check_users__amount="+a+"; path=/; samesite=lax"),jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Check users"),setTimeout(ct_send_users(),3e3)},timeout:25e3})))}function ct_show_users_info(){var e;ct_working&&(!0===ct_cooling_down_flag?jQuery("#ct_cooling_notice").html("Waiting for API to cool down. (About a minute)").show():(jQuery("#ct_cooling_notice").hide(),ct_users_total||(e={action:"ajax_info_users",security:ct_ajax_nonce,no_cache:Math.random()},ct_date_from&&ct_date_till&&(e.from=ct_date_from,e.till=ct_date_till),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){e=jQuery.parseJSON(e),jQuery("#ct_checking_status").html(e.message),ct_users_spam=e.spam,ct_users_checked=e.checked,ct_users_bad=e.bad},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("Show users"),setTimeout(ct_show_users_info(),3e3)},timeout:15e3}))))}function ct_toggle_depended(e,t){t=t||null;var c=jQuery(e.data("depended"));e.data("state")||t?(e.data("state",!1),c.prop("disabled",!0),c.removeProp("checked"),c.data("depended")&&ct_toggle_depended(c,!0)):(e.data("state",!0),c.removeProp("disabled"))}function ct_start_check(e){e=e||null,jQuery("#ct_allow_date_range").is(":checked")&&(ct_date_from=jQuery("#ct_date_range_from").val(),ct_date_till=jQuery("#ct_date_range_till").val(),""===ct_date_from||""===ct_date_till)?alert(ctUsersCheck.ct_specify_date_range):(jQuery("#ct_accurate_check").is(":checked")&&(ct_accurate_check=!0),jQuery("#ct_accurate_check").is(":checked")&&!jQuery("#ct_allow_date_range").is(":checked")?alert(ctUsersCheck.ct_select_date_range):(jQuery(".ct_to_hide").hide(),jQuery("#ct_working_message").show(),jQuery("#ct_preloader").show(),jQuery("#ct_pause").show(),ct_working=!0,(e?(ct_show_users_info(),ct_send_users):ct_clear_users)()))}function ct_delete_all_users(a){var t={action:"ajax_delete_all_users",security:ct_ajax_nonce,no_cache:Math.random()};jQuery("."+a.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:t,success:function(e){0<e?(jQuery("#cleantalk_users_left").html(e),ct_delete_all_users(a,t)):(jQuery("."+a.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden"),location.href="users.php?page=ct_check_users")},error:function(e,t,c){jQuery("#ct_error_message").show(),jQuery("#cleantalk_ajax_error").html(t),jQuery("#cleantalk_js_func").html("All users deleteion"),setTimeout(ct_delete_all_users(a),3e3)},timeout:25e3})}function getCookie(e){e=document.cookie.match(new RegExp("(?:^|; )"+e.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return e?decodeURIComponent(e[1]):void 0}jQuery(document).ready(function(){ct_prev_accurate&&jQuery("#ct_accurate_check").prop("checked",!0),ct_prev_from&&(jQuery("#ct_allow_date_range").prop("checked",!0).data("state",!0),jQuery("#ct_date_range_from").removeProp("disabled").val(ct_prev_from),jQuery("#ct_date_range_till").removeProp("disabled").val(ct_prev_till)),jQuery("#ct_allow_date_range").on("change",function(){document.cookie="ct_users_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_users_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax",this.checked?(document.cookie="ct_users_dates_allowed=1; path=/; samesite=lax",jQuery(".ct_date").prop("checked",!0).attr("disabled",!1)):(document.cookie="ct_users_dates_allowed=0; path=/; samesite=lax",jQuery(".ct_date").prop("disabled",!0).attr("disabled",!0))}),jQuery.datepicker.setDefaults(jQuery.datepicker.regional.en);var a=jQuery("#ct_date_range_from, #ct_date_range_till").datepicker({dateFormat:"M d yy",maxDate:"+0D",changeMonth:!0,changeYear:!0,showAnim:"slideDown",onSelect:function(e){var t="ct_date_range_from"==this.id?"minDate":"maxDate",c=jQuery(this).data("datepicker"),e=jQuery.datepicker.parseDate(c.settings.dateFormat||jQuery.datepicker._defaults.dateFormat,e,c.settings);a.not(this).datepicker("option",t,e),document.cookie="ct_users_dates_from="+jQuery("#ct_date_range_from").val()+"; path=/; samesite=lax",document.cookie="ct_users_dates_till="+jQuery("#ct_date_range_till").val()+"; path=/; samesite=lax"}});function t(t){t=t||null;var e={action:"ajax_insert_users",security:ct_ajax_nonce,no_cache:Math.random()};t&&(e.delete=!0),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){t?alert("Deleted "+e+" users"):alert("Inserted "+e+" users")}})}jQuery("#ct_check_spam_button").click(function(){ct_start_check(!(document.cookie="ct_paused_users_check=0; path=/; samesite=lax"))}),jQuery("#ct_proceed_check_button").click(function(){ct_start_check(!0)}),jQuery("#ct_pause").on("click",function(){ct_pause=!0;var e={accurate:ct_accurate_check,from:ct_date_from,till:ct_date_till};document.cookie="ct_paused_users_check="+JSON.stringify(e)+"; path=/; samesite=lax"}),jQuery(".cleantalk_delete_from_list_button").click(function(){ct_id=jQuery(this).attr("data-id");var e={action:"ajax_ct_approve_user",security:ct_ajax_nonce,id:ct_id,no_cache:Math.random()},e=(jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){jQuery("#comment-"+ct_id).fadeOut("slow",function(){jQuery("#comment-"+ct_id).remove()})}}),{action:"ct_feedback_user",security:ct_ajax_nonce,user_id:ct_id,status:"approve",no_cache:Math.random()});jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){},error:function(e,t,c){},timeout:5e3})}),jQuery(".ct_get_csv_file").click(function(c){var e={action:"ajax_ct_get_csv_file",security:ct_ajax_nonce,filename:ctUsersCheck.ct_csv_filename,no_cache:Math.random()};jQuery("."+c.target.id).addClass("disabled"),jQuery(".spinner").css("visibility","visible"),jQuery.ajax({type:"POST",url:ajaxurl,data:e,success:function(e){var t;0===parseInt(e)?alert(ctUsersCheck.ct_bad_csv):(e=URL.createObjectURL(new Blob([e])),(t=document.createElement("a")).href=e,t.download=ctUsersCheck.ct_csv_filename+".csv",document.body.appendChild(t),t.click()),jQuery("."+c.target.id).removeClass("disabled"),jQuery(".spinner").css("visibility","hidden")}})}),jQuery(".ct_insert_users").click(function(e){t()}),jQuery(".ct_insert_users__delete").click(function(e){t(!0)}),jQuery(".ct_delete_all_users").click(function(e){if(!confirm(ctUsersCheck.ct_confirm_deletion_all))return!1;ct_delete_all_users(e)}),jQuery("#ct_accurate_check").change(function(){this.checked&&(jQuery("#ct_allow_date_range").prop("checked",!0),jQuery(".ct_date").prop("checked",!0).attr("disabled",!1))})});
|
2 |
//# sourceMappingURL=cleantalk-users-checkspam.min.js.map
|
js/cleantalk-users-checkspam.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-users-checkspam.min.js","sources":["cleantalk-users-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Set deafult amount to check by request.\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/; samesite=lax\";\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctUsersCheck.ct_prev_accurate,\n\tct_prev_from = ctUsersCheck.ct_prev_from,\t\n\tct_prev_till = ctUsersCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,\n\tct_users_total = 0,\n\tct_users_checked = 0,\n\tct_users_spam = 0,\n\tct_users_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\n/* Function: Reuturns cookie with prefix */\nfunction apbct_cookie__get(names, prefixes){\n\tvar cookie = {};\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes === 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t});\n\treturn cookie;\n}\n\nfunction apbct_get_cookie( name ){\n\tvar cookie = apbct_cookie__get( name, name );\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\n\t\treturn cookie[name];\n\t}else\n\t\treturn null;\n}\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to === 0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_users(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\n\tvar data = {\n\t\t'action' : 'ajax_clear_users',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_users_info();\n\t\t\tct_send_users();\n\t\t}\n\t});\n\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_users();\n\tct_show_users_info();\n}\n\nfunction ct_send_users(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\n\n\tvar data = {\n\t\taction: 'ajax_check_users',\n\t\tsecurity: ct_ajax_nonce,\n\t\tnew_check: ct_new_check,\n\t\tunchecked: ct_unchecked,\n\t\tamount: check_amount,\n\t\t'no_cache': Math.random(),\n\t\t'offset' : Number(getCookie('apbct_check_users_offset'))\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_users();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause == true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_users_checked = parseInt( ct_users_checked ) + parseInt( msg.checked );\n\t\t\t\t\tct_users_spam = parseInt( ct_users_spam ) + parseInt (msg.spam );\n\t\t\t\t\tct_users_bad = parseInt( msg.bad );\n\t\t\t\t\tct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;\n\t\t\t\t\tvar status_string = String(ctUsersCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_users_checked, ct_users_spam, ct_users_bad);\n\t\t\t\t\tif(parseInt(ct_users_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctUsersCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\n\t\t\t\t\tvar offset = Number(getCookie('apbct_check_users_offset')) + 100;\n\t\t\t\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\t\t\t\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + offset + \"; path=/; samesite=lax\" + ctSecure;\n\t\t\t\t\t\n\t\t\t\t\tct_send_users();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tif(check_amount > 20){\n\t\t\t\tcheck_amount -= 20;\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/; samesite=lax\";\n\t\t\t}\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check users');\n\t\t\tsetTimeout(ct_send_users(), 3000);\n },\n timeout: 25000\n\t});\n}\nfunction ct_show_users_info(){\n\t\n\tif( ct_working ){\n\t\t\n\t\tif(ct_cooling_down_flag === true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif( ! ct_users_total ){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_users',\n\t\t\t\t'security': ct_ajax_nonce,\n\t\t\t\t'no_cache': Math.random()\n\t\t\t};\n\t\t\t\n\t\t\tif( ct_date_from && ct_date_till ){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_users_spam = msg.spam;\n\t\t\t\t\tct_users_checked = msg.checked;\n\t\t\t\t\tct_users_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Show users');\n\t\t\t\t\tsetTimeout(ct_show_users_info(), 3000);\n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\n// Main function of checking\nfunction ct_start_check( continue_check ){\n\n\tcontinue_check = continue_check || null;\n\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\n\t\t\talert(ctUsersCheck.ct_specify_date_range);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\tct_accurate_check = true;\n\t}\n\n\t//\n\tif (\n\t\tjQuery('#ct_accurate_check').is(':checked') &&\n\t\t! jQuery('#ct_allow_date_range').is(':checked')\n\t) {\n\t\talert(ctUsersCheck.ct_select_date_range);\n\t\treturn;\n\t}\n\n\tjQuery('.ct_to_hide').hide();\n\tjQuery('#ct_working_message').show();\n\tjQuery('#ct_preloader').show();\n\tjQuery('#ct_pause').show();\n\n\tct_working = true;\n\n\tif( continue_check ){\n\t\tct_show_users_info();\n\t\tct_send_users();\n\t} else {\n\t\tct_clear_users();\n\t}\n\n}\n\nfunction ct_delete_all_users( e ){\n\n\tvar data = {\n\t\t'action': 'ajax_delete_all_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_users_left').html(msg);\n\t\t\t\tct_delete_all_users( e, data );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='users.php?page=ct_check_users';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('All users deleteion');\n\t\t\tsetTimeout(ct_delete_all_users( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\n\t\t//\n\n\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\t\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\t\t\n\t//Approve button\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\n\t\tct_id = jQuery(this).attr(\"data-id\");\n\t\t\n\t\t// Approving\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_approve_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'id': ct_id,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tjQuery(\"#comment-\"+ct_id).fadeOut('slow', function(){\n\t\t\t\t\tjQuery(\"#comment-\"+ct_id).remove();\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t\t\n\t\t// Positive feedback\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'user_id': ct_id,\n\t\t\t'status': 'approve',\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(msg == 1){\n\t\t\t\t\t// Success\n\t\t\t\t}\n\t\t\t\tif(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t}\n\t\t\t\tif(msg == 'no_hash'){\n\t\t\t\t\t// No hash\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t\t\n\t});\n\t\n\t// Request to Download CSV file.\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_get_csv_file',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'filename': ctUsersCheck.ct_csv_filename,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery('.' + e.target.id).addClass('disabled');\n\t\tjQuery('.spinner').css('visibility', 'visible');\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif( parseInt(msg) === 0 ) {\n\t\t\t\t\talert(ctUsersCheck.ct_bad_csv);\n\t\t\t\t} else {\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\n\n\t\t\t\t\tvar dummy = document.createElement('a');\n\t\t\t\t\tdummy.href = url;\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\n\n\t\t\t\t\tdocument.body.appendChild(dummy);\n\t\t\t\t\tdummy.click();\n\t\t\t\t}\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Delete inserted users\n\tjQuery(\".ct_insert_users\").click(function( e ){\n\t\tct_insert_users();\n\t});\n\n\t// Insert users\n\tjQuery(\".ct_insert_users__delete\").click(function( e ){\n\t\tct_insert_users( true );\n\t});\n\n\t// Delete all spam users\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\n\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\n\t\t\treturn false;\n\n\t\tct_delete_all_users( e );\n\n\t});\n\n\tfunction ct_insert_users(delete_accounts){\n\n\t\tdelete_accounts = delete_accounts || null;\n\n\t\tvar data = {\n\t\t\t'action': 'ajax_insert_users',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\n\t\tif(delete_accounts)\n\t\t\tdata['delete'] = true;\n\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(delete_accounts)\n\t\t\t\t\talert('Deleted ' + msg + ' users');\n\t\t\t\telse\n\t\t\t\t\talert('Inserted ' + msg + ' users');\n\t\t\t}\n\t\t});\n\t}\n\n\n\t/**\n\t * Checked ct_accurate_check\n\t */\n\tjQuery('#ct_accurate_check').change(function () {\n\t\tif(this.checked) {\n\t\t\tjQuery('#ct_allow_date_range').prop('checked', true);\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t}\n\t});\n});\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction getCookie(name) {\n\tlet matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}"],"names":["String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctUsersCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_users_total","ct_users_checked","ct_users_spam","ct_users_bad","ct_unchecked","ct_date_from","ct_date_till","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","ctSecure","is","val","location","protocol","data","action","security","no_cache","Math","random","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","setTimeout","check_amount","new_check","unchecked","amount","offset","Number","getCookie","parseJSON","parseInt","error","confirm","error_message","new_href","href","end","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_specify_date_range","ct_select_date_range","ct_delete_all_users","e","target","addClass","css","removeClass","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_insert_users","delete_accounts","click","ct_check","accurate","JSON","stringify","ct_id","fadeOut","remove","user_id","status","filename","ct_csv_filename","dummy","ct_bad_csv","URL","createObjectURL","Blob","createElement","download","body","appendChild","ct_confirm_deletion_all","change"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,IAClEC,EAAmBN,EAAUI,UAAUJ,EAAUK,QAAQ,KAAM,GAAG,EAAGL,EAAUO,QACnFP,EAAYG,EAAmBD,UAAUH,GAAOO,EAE9C,OAAON,GAOX,IAAIQ,aAHJC,SAASC,OAAS,oDAIjBC,cAAe,EACfC,sBAAuB,EACvBC,kBAAmB,EACnBC,mBAAoB,EACpBC,UAAW,EACXC,iBAAmBC,aAAaD,iBAChCE,aAAmBD,aAAaC,aAChCC,aAAmBF,aAAaE,aAE7BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,aAAaM,cAChCC,eAAiB,EACjBC,iBAAmB,EACnBC,cAAgB,EAChBC,aAAe,EACfC,aAAe,QACfC,aAAe,EACfC,aAAe,EAGhB,SAASC,kBAAkBC,EAAOC,GACjC,IAAIvB,EAAS,GAuBb,MArBmB,iBADnBsB,EAAQA,GAAS,QACYA,EAAQA,EAAME,S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EAAO,CACVC,OAAU,uBACVC,SAAYrC,cACZwI,SAAY9I,aAAa+I,gBACzBnG,SAAYC,KAAKC,UAElBf,OAAO,IAAMmE,EAAEC,OAAOrE,IAAIsE,SAAS,YACnCrE,OAAO,YAAYsE,IAAI,aAAc,WACrCtE,OAAOgB,KAAK,CACXC,KAAM,OACNC,IAAKC,QACLT,KAAMA,EACNU,QAAS,SAASC,GACjB,IAKK4F,EALiB,IAAlB/E,SAASb,GACZ0C,MAAM9F,aAAaiJ,aAEfhG,EAAMiG,IAAIC,gBAAgB,IAAIC,KAAK,CAAChG,MAEpC4F,EAAQxJ,SAAS6J,cAAc,MAC7B/E,KAAOrB,EACb+F,EAAMM,SAAWtJ,aAAa+I,gBAAkB,OAEhDvJ,SAAS+J,KAAKC,YAAYR,GAC1BA,EAAMZ,SAEPrG,OAAO,IAAMmE,EAAEC,OAAOrE,IAAIwE,YAAY,YACtCvE,OAAO,YAAYsE,IAAI,aAAc,eAMxCtE,OAAO,oBAAoBqG,MAAM,SAAUlC,GAC1CgC,MAIDnG,OAAO,4BAA4BqG,MAAM,SAAUlC,GAClDgC,GAAiB,KAIlBnG,OAAO,wBAAwBqG,MAAM,SAAUlC,GAE9C,IAAO/B,QAASnE,aAAayJ,yBAC5B,OAAO,EAERxD,oBAAqBC,KAkCtBnE,OAAO,sBAAsB2H,OAAO,WAChC1K,KAAKyF,UACP1C,OAAO,wBAAwB2D,KAAK,WAAW,GAC/C3D,OAAO,YAAY2D,KAAK,WAAW,GAAMqB,KAAK,YAAW"}
|
1 |
+
{"version":3,"file":"cleantalk-users-checkspam.min.js","sources":["cleantalk-users-checkspam.js"],"sourcesContent":["// Printf for JS\nString.prototype.printf = function(){\n var formatted = this;\n for( var arg in arguments ) {\n\t\tvar before_formatted = formatted.substring(0, formatted.indexOf(\"%s\", 0));\n\t\tvar after_formatted = formatted.substring(formatted.indexOf(\"%s\", 0)+2, formatted.length);\n\t\tformatted = before_formatted + arguments[arg] + after_formatted;\n }\n return formatted;\n};\n\n// Set deafult amount to check by request.\ndocument.cookie = \"ct_check_users__amount=\" + 100 + \"; path=/; samesite=lax\";\n\n// Flags\nvar ct_working = false,\n\tct_new_check = true,\n\tct_cooling_down_flag = false,\n\tct_close_animate = true,\n\tct_accurate_check = false,\n\tct_pause = false,\n\tct_prev_accurate = ctUsersCheck.ct_prev_accurate,\n\tct_prev_from = ctUsersCheck.ct_prev_from,\t\n\tct_prev_till = ctUsersCheck.ct_prev_till;\n// Settings\nvar ct_cool_down_time = 90000,\n\tct_requests_counter = 0,\n\tct_max_requests = 60;\n// Variables\nvar ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,\n\tct_users_total = 0,\n\tct_users_checked = 0,\n\tct_users_spam = 0,\n\tct_users_bad = 0,\n\tct_unchecked = 'unset',\n\tct_date_from = 0,\n\tct_date_till = 0;\n\n/* Function: Reuturns cookie with prefix */\nfunction apbct_cookie__get(names, prefixes){\n\tvar cookie = {};\n\tnames = names || null;\n\tif(typeof names == 'string') names = names.split();\n\tprefixes = prefixes || ['apbct_', 'ct_'];\n\tif(prefixes === 'none') prefixes = null;\n\tif(typeof prefixes == 'string') prefixes = prefixes.split();\n\tdocument.cookie.split(';').forEach(function(item, i, arr){\n\t\tvar curr = item.trim().split('=');\n\t\t// Detect by full cookie name\n\t\tif(names){\n\t\t\tnames.forEach(function(name, i, all){\n\t\t\t\tif(curr[0] === name)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t\t// Detect by name prefix\n\t\tif(prefixes){\n\t\t\tprefixes.forEach(function(prefix, i, all){\n\t\t\t\tif(curr[0].indexOf(prefix) === 0)\n\t\t\t\t\tcookie[curr[0]] = (curr[1]);\n\t\t\t});\n\t\t}\n\t});\n\treturn cookie;\n}\n\nfunction apbct_get_cookie( name ){\n\tvar cookie = apbct_cookie__get( name, name );\n\tif(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){\n\t\treturn cookie[name];\n\t}else\n\t\treturn null;\n}\n\nfunction animate_comment(to,id){\n\tif(ct_close_animate){\n\t\tif(to === 0.3){\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(1,id)\n\t\t\t});\n\t\t}else{\n\t\t\tjQuery('#comment-'+id).fadeTo(200,to,function(){\n\t\t\t\tanimate_comment(0.3,id)\n\t\t\t});\n\t\t}\n\t}else{\n\t\tct_close_animate=true;\n\t}\n}\n\nfunction ct_clear_users(){\n\n\tvar from = 0, till = 0;\n\tif(jQuery('#ct_allow_date_range').is(':checked')) {\n\t\tfrom = jQuery('#ct_date_range_from').val();\n\t\ttill = jQuery('#ct_date_range_till').val();\n\t}\n\n\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + 0 + \"; path=/; samesite=lax\" + ctSecure;\n\n\tvar data = {\n\t\t'action' : 'ajax_clear_users',\n\t\t'security' : ct_ajax_nonce,\n\t\t'from' : from,\n\t\t'till' : till,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\tct_show_users_info();\n\t\t\tct_send_users();\n\t\t}\n\t});\n\n}\n\n//Continues the check after cooldown time\n//Called by ct_send_users();\nfunction ct_cooling_down_toggle(){\n\tct_cooling_down_flag = false;\n\tct_send_users();\n\tct_show_users_info();\n}\n\nfunction ct_send_users(){\n\t\n\tif(ct_cooling_down_flag === true)\n\t\treturn;\n\t\n\tif(ct_requests_counter >= ct_max_requests){\n\t\tsetTimeout(ct_cooling_down_toggle, ct_cool_down_time);\n\t\tct_requests_counter = 0;\n\t\tct_cooling_down_flag = true;\n\t\treturn;\n\t}else{\n\t\tct_requests_counter++;\n\t}\n\n\tvar check_amount = apbct_get_cookie('ct_check_users__amount');\n\n\tvar data = {\n\t\taction: 'ajax_check_users',\n\t\tsecurity: ct_ajax_nonce,\n\t\tnew_check: ct_new_check,\n\t\tunchecked: ct_unchecked,\n\t\tamount: check_amount,\n\t\t'no_cache': Math.random(),\n\t\t'offset' : Number(getCookie('apbct_check_users_offset'))\n\t};\n\t\n\tif(ct_accurate_check)\n\t\tdata['accurate_check'] = true;\n\t\n\tif(ct_date_from && ct_date_till){\n\t\tdata['from'] = ct_date_from;\n\t\tdata['till'] = ct_date_till;\n\t}\n\t\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function(msg){\n\t\t\t\n\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\n\t\t\tif(parseInt(msg.error)){\n\t\t\t\tct_working=false;\n\t\t\t\tif(!confirm(msg.error_message+\". Do you want to proceed?\")){\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else\n\t\t\t\t\tct_send_users();\n\t\t\t}else{\n\t\t\t\tct_new_check = false;\n\t\t\t\tif(parseInt(msg.end) == 1 || ct_pause == true){\n\t\t\t\t\tif(parseInt(msg.end) == 1)\n\t\t\t\t\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\t\t\t\t\tct_working=false;\n\t\t\t\t\tjQuery('#ct_working_message').hide();\n\t\t\t\t\tvar new_href = 'users.php?page=ct_check_users&ct_worked=1';\n\t\t\t\t\tif(ct_date_from != 0 && ct_date_till != 0)\n\t\t\t\t\t\tnew_href+='&from='+ct_date_from+'&till='+ct_date_till;\n\t\t\t\t\tlocation.href = new_href;\n\t\t\t\t}else if(parseInt(msg.end) == 0){\n\t\t\t\t\tct_users_checked = parseInt( ct_users_checked ) + parseInt( msg.checked );\n\t\t\t\t\tct_users_spam = parseInt( ct_users_spam ) + parseInt (msg.spam );\n\t\t\t\t\tct_users_bad = parseInt( msg.bad );\n\t\t\t\t\tct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;\n\t\t\t\t\tvar status_string = String(ctUsersCheck.ct_status_string);\n\t\t\t\t\tvar status_string = status_string.printf(ct_users_checked, ct_users_spam, ct_users_bad);\n\t\t\t\t\tif(parseInt(ct_users_spam) > 0)\n\t\t\t\t\t\tstatus_string += ctUsersCheck.ct_status_string_warning;\n\t\t\t\t\tjQuery('#ct_checking_status').html(status_string);\n\t\t\t\t\tjQuery('#ct_error_message').hide();\n\n\t\t\t\t\tvar offset = Number(getCookie('apbct_check_users_offset')) + 100;\n\t\t\t\t\tvar ctSecure = location.protocol === 'https:' ? '; secure' : '';\n\t\t\t\t\tdocument.cookie = 'apbct_check_users_offset' + \"=\" + offset + \"; path=/; samesite=lax\" + ctSecure;\n\t\t\t\t\t\n\t\t\t\t\tct_send_users();\n\t\t\t\t}\n\t\t\t}\n\t\t},\n error: function(jqXHR, textStatus, errorThrown) {\n\t\t\tif(check_amount > 20){\n\t\t\t\tcheck_amount -= 20;\n\t\t\t\tdocument.cookie = \"ct_check_users__amount=\" + check_amount + \"; path=/; samesite=lax\";\n\t\t\t}\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('Check users');\n\t\t\tsetTimeout(ct_send_users(), 3000);\n },\n timeout: 25000\n\t});\n}\nfunction ct_show_users_info(){\n\t\n\tif( ct_working ){\n\t\t\n\t\tif(ct_cooling_down_flag === true){\n\t\t\tjQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)').show();\n\t\t\treturn;\t\t\t\n\t\t}else{\n\t\t\tjQuery('#ct_cooling_notice').hide();\n\t\t}\n\t\t\n\t\tif( ! ct_users_total ){\n\t\t\t\n\t\t\tvar data = {\n\t\t\t\t'action': 'ajax_info_users',\n\t\t\t\t'security': ct_ajax_nonce,\n\t\t\t\t'no_cache': Math.random()\n\t\t\t};\n\t\t\t\n\t\t\tif( ct_date_from && ct_date_till ){\n\t\t\t\tdata['from'] = ct_date_from;\n\t\t\t\tdata['till'] = ct_date_till;\n\t\t\t}\n\t\t\t\n\t\t\tjQuery.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: ajaxurl,\n\t\t\t\tdata: data,\n\t\t\t\tsuccess: function(msg){\n\t\t\t\t\tmsg = jQuery.parseJSON(msg);\n\t\t\t\t\tjQuery('#ct_checking_status').html(msg.message);\n\t\t\t\t\tct_users_spam = msg.spam;\n\t\t\t\t\tct_users_checked = msg.checked;\n\t\t\t\t\tct_users_bad = msg.bad;\n\t\t\t\t},\n\t\t\t\terror: function (jqXHR, textStatus, errorThrown){\n\t\t\t\t\tjQuery('#ct_error_message').show();\n\t\t\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\t\t\tjQuery('#cleantalk_js_func').html('Show users');\n\t\t\t\t\tsetTimeout(ct_show_users_info(), 3000);\n\t\t\t\t},\n\t\t\t\ttimeout: 15000\n\t\t\t});\n\t\t}\n\t}\n}\n// Function to toggle dependences\nfunction ct_toggle_depended(obj, secondary){\n\n secondary = secondary || null;\n\n\tvar depended = jQuery(obj.data('depended')),\n\t\tstate = obj.data('state');\n\t\t\n\tif(!state && !secondary){\n\t\tobj.data('state', true);\n\t\tdepended.removeProp('disabled');\n\t}else{\n\t\tobj.data('state', false);\n\t\tdepended.prop('disabled', true);\n\t\tdepended.removeProp('checked');\n\t\tif(depended.data('depended'))\n\t\t\tct_toggle_depended(depended, true);\n\t}\n}\n\n// Main function of checking\nfunction ct_start_check( continue_check ){\n\n\tcontinue_check = continue_check || null;\n\n\tif(jQuery('#ct_allow_date_range').is(':checked')){\n\n\t\tct_date_from = jQuery('#ct_date_range_from').val();\n\t\tct_date_till = jQuery('#ct_date_range_till').val();\n\n\t\tif(!(ct_date_from !== '' && ct_date_till !== '')){\n\t\t\talert(ctUsersCheck.ct_specify_date_range);\n\t\t\treturn;\n\t\t}\n\t}\n\n\tif(jQuery('#ct_accurate_check').is(':checked')){\n\t\tct_accurate_check = true;\n\t}\n\n\t//\n\tif (\n\t\tjQuery('#ct_accurate_check').is(':checked') &&\n\t\t! jQuery('#ct_allow_date_range').is(':checked')\n\t) {\n\t\talert(ctUsersCheck.ct_select_date_range);\n\t\treturn;\n\t}\n\n\tjQuery('.ct_to_hide').hide();\n\tjQuery('#ct_working_message').show();\n\tjQuery('#ct_preloader').show();\n\tjQuery('#ct_pause').show();\n\n\tct_working = true;\n\n\tif( continue_check ){\n\t\tct_show_users_info();\n\t\tct_send_users();\n\t} else {\n\t\tct_clear_users();\n\t}\n\n}\n\nfunction ct_delete_all_users( e ){\n\n\tvar data = {\n\t\t'action': 'ajax_delete_all_users',\n\t\t'security': ct_ajax_nonce,\n\t\t'no_cache': Math.random()\n\t};\n\n\tjQuery('.' + e.target.id).addClass('disabled');\n\tjQuery('.spinner').css('visibility', 'visible');\n\tjQuery.ajax({\n\t\ttype: \"POST\",\n\t\turl: ajaxurl,\n\t\tdata: data,\n\t\tsuccess: function( msg ){\n\t\t\tif( msg > 0 ){\n\t\t\t\tjQuery('#cleantalk_users_left').html(msg);\n\t\t\t\tct_delete_all_users( e, data );\n\t\t\t}else{\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t\tlocation.href='users.php?page=ct_check_users';\n\t\t\t}\n\t\t},\n\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\tjQuery('#ct_error_message').show();\n\t\t\tjQuery('#cleantalk_ajax_error').html(textStatus);\n\t\t\tjQuery('#cleantalk_js_func').html('All users deleteion');\n\t\t\tsetTimeout(ct_delete_all_users( e ), 3000);\n\t\t},\n\t\ttimeout: 25000\n\t});\n}\n\njQuery(document).ready(function(){\n\n\t// Setting dependences\n\t\n\t// Prev check parameters\n\tif(ct_prev_accurate){\n\t\tjQuery(\"#ct_accurate_check\").prop('checked', true);\n\t}\n\tif(ct_prev_from){\n\t\tjQuery(\"#ct_allow_date_range\").prop('checked', true).data('state', true);\n\t\tjQuery(\"#ct_date_range_from\").removeProp('disabled').val(ct_prev_from);\n\t\tjQuery(\"#ct_date_range_till\").removeProp('disabled').val(ct_prev_till);\n\t}\n\t\n\t// Toggle dependences\n\tjQuery(\"#ct_allow_date_range\").on('change', function(){\n\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\tif( this.checked ) {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t} else {\n\t\t\tdocument.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';\n\t\t\tjQuery('.ct_date').prop('disabled', true).attr('disabled',true);\n\t\t}\n\t});\n\n\tjQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);\n\tvar dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(\n\t\t{\n\t\t\tdateFormat: 'M d yy',\n\t\t\tmaxDate:\"+0D\",\n\t\t\tchangeMonth:true,\n\t\t\tchangeYear:true,\n\t\t\tshowAnim: 'slideDown',\n\t\t\tonSelect: function(selectedDate){\n\t\t\tvar option = this.id == \"ct_date_range_from\" ? \"minDate\" : \"maxDate\",\n\t\t\t\tinstance = jQuery( this ).data( \"datepicker\" ),\n\t\t\t\tdate = jQuery.datepicker.parseDate(\n\t\t\t\t\tinstance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,\n\t\t\t\t\tselectedDate, instance.settings);\n\t\t\t\tdates.not(this).datepicker(\"option\", option, date);\n\t\t\t\tdocument.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';\n\t\t\t\tdocument.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';\n\t\t\t}\n\t\t}\n\t);\n\t\n\t// Check users\n\tjQuery(\"#ct_check_spam_button\").click(function(){\n\t\tdocument.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';\n\n\t\t//\n\n\n\t\tct_start_check(false);\n\t});\n\tjQuery(\"#ct_proceed_check_button\").click(function(){\n\t\tct_start_check(true);\n\t});\n\t\n\t// Pause the check\n\tjQuery('#ct_pause').on('click', function(){\n\t\tct_pause = true;\n\t\tvar ct_check = {\n\t\t\t'accurate': ct_accurate_check,\n\t\t\t'from' : ct_date_from,\n\t\t\t'till' : ct_date_till\n\t\t};\n\t\tdocument.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';\n\t});\n\t\t\n\t//Approve button\n\tjQuery(\".cleantalk_delete_from_list_button\").click(function(){\n\t\tct_id = jQuery(this).attr(\"data-id\");\n\t\t\n\t\t// Approving\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_approve_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'id': ct_id,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tjQuery(\"#comment-\"+ct_id).fadeOut('slow', function(){\n\t\t\t\t\tjQuery(\"#comment-\"+ct_id).remove();\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t\t\n\t\t// Positive feedback\n\t\tvar data = {\n\t\t\t'action': 'ct_feedback_user',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'user_id': ct_id,\n\t\t\t'status': 'approve',\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(msg == 1){\n\t\t\t\t\t// Success\n\t\t\t\t}\n\t\t\t\tif(msg == 0){\n\t\t\t\t\t// Error occurred\n\t\t\t\t}\n\t\t\t\tif(msg == 'no_hash'){\n\t\t\t\t\t// No hash\n\t\t\t\t}\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\t\n\t\t\t},\n\t\t\ttimeout: 5000\n\t\t});\n\t\t\n\t});\n\t\n\t// Request to Download CSV file.\n\tjQuery(\".ct_get_csv_file\").click(function( e ){\n\t\tvar data = {\n\t\t\t'action': 'ajax_ct_get_csv_file',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'filename': ctUsersCheck.ct_csv_filename,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\t\tjQuery('.' + e.target.id).addClass('disabled');\n\t\tjQuery('.spinner').css('visibility', 'visible');\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif( parseInt(msg) === 0 ) {\n\t\t\t\t\talert(ctUsersCheck.ct_bad_csv);\n\t\t\t\t} else {\n\t\t\t\t\tvar url = URL.createObjectURL(new Blob([msg]));\n\n\t\t\t\t\tvar dummy = document.createElement('a');\n\t\t\t\t\tdummy.href = url;\n\t\t\t\t\tdummy.download = ctUsersCheck.ct_csv_filename + '.csv';\n\n\t\t\t\t\tdocument.body.appendChild(dummy);\n\t\t\t\t\tdummy.click();\n\t\t\t\t}\n\t\t\t\tjQuery('.' + e.target.id).removeClass('disabled');\n\t\t\t\tjQuery('.spinner').css('visibility', 'hidden');\n\t\t\t}\n\t\t});\n\t});\n\n\t// Delete inserted users\n\tjQuery(\".ct_insert_users\").click(function( e ){\n\t\tct_insert_users();\n\t});\n\n\t// Insert users\n\tjQuery(\".ct_insert_users__delete\").click(function( e ){\n\t\tct_insert_users( true );\n\t});\n\n\t// Delete all spam users\n\tjQuery(\".ct_delete_all_users\").click(function( e ){\n\n\t\tif ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )\n\t\t\treturn false;\n\n\t\tct_delete_all_users( e );\n\n\t});\n\n\tfunction ct_insert_users(delete_accounts){\n\n\t\tdelete_accounts = delete_accounts || null;\n\n\t\tvar data = {\n\t\t\t'action': 'ajax_insert_users',\n\t\t\t'security': ct_ajax_nonce,\n\t\t\t'no_cache': Math.random()\n\t\t};\n\n\t\tif(delete_accounts)\n\t\t\tdata['delete'] = true;\n\n\t\tjQuery.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: ajaxurl,\n\t\t\tdata: data,\n\t\t\tsuccess: function(msg){\n\t\t\t\tif(delete_accounts)\n\t\t\t\t\talert('Deleted ' + msg + ' users');\n\t\t\t\telse\n\t\t\t\t\talert('Inserted ' + msg + ' users');\n\t\t\t}\n\t\t});\n\t}\n\n\n\t/**\n\t * Checked ct_accurate_check\n\t */\n\tjQuery('#ct_accurate_check').change(function () {\n\t\tif(this.checked) {\n\t\t\tjQuery('#ct_allow_date_range').prop('checked', true);\n\t\t\tjQuery('.ct_date').prop('checked', true).attr('disabled',false);\n\t\t}\n\t});\n});\n\n/**\n * Get cookie by name\n * @param name\n * @returns {string|undefined}\n */\nfunction getCookie(name) {\n\tlet matches = document.cookie.match(new RegExp(\n\t\t\"(?:^|; )\" + name.replace(/([\\.$?*|{}\\(\\)\\[\\]\\\\\\/\\+^])/g, '\\\\$1') + \"=([^;]*)\"\n\t));\n\treturn matches ? decodeURIComponent(matches[1]) : undefined;\n}"],"names":["String","prototype","printf","arg","formatted","this","arguments","before_formatted","substring","indexOf","after_formatted","length","ct_working","document","cookie","ct_new_check","ct_cooling_down_flag","ct_close_animate","ct_accurate_check","ct_pause","ct_prev_accurate","ctUsersCheck","ct_prev_from","ct_prev_till","ct_cool_down_time","ct_requests_counter","ct_max_requests","ct_ajax_nonce","ct_users_total","ct_users_checked","ct_users_spam","ct_users_bad","ct_unchecked","ct_date_from","ct_date_till","apbct_cookie__get","names","prefixes","split","forEach","item","i","arr","curr","trim","name","all","prefix","apbct_get_cookie","animate_comment","to","id","jQuery","fadeTo","ct_clear_users","from","till","ctSecure","is","val","location","protocol","data","action","security","no_cache","Math","random","ajax","type","url","ajaxurl","success","msg","ct_show_users_info","ct_send_users","ct_cooling_down_toggle","check_amount","setTimeout","new_check","unchecked","amount","offset","Number","getCookie","parseJSON","parseInt","error","confirm","error_message","new_href","href","end","hide","checked","spam","bad","status_string","ct_status_string","ct_status_string_warning","html","jqXHR","textStatus","errorThrown","show","timeout","message","ct_toggle_depended","obj","secondary","depended","prop","removeProp","ct_start_check","continue_check","alert","ct_specify_date_range","ct_select_date_range","ct_delete_all_users","e","target","addClass","css","removeClass","matches","match","RegExp","replace","decodeURIComponent","undefined","ready","on","attr","datepicker","setDefaults","regional","dates","dateFormat","maxDate","changeMonth","changeYear","showAnim","onSelect","selectedDate","option","instance","date","parseDate","settings","_defaults","not","ct_insert_users","delete_accounts","click","ct_check","accurate","JSON","stringify","ct_id","fadeOut","remove","user_id","status","filename","ct_csv_filename","dummy","ct_bad_csv","URL","createObjectURL","Blob","createElement","download","body","appendChild","ct_confirm_deletion_all","change"],"mappings":"AACAA,OAAOC,UAAUC,OAAS,WACtB,IACSC,EADLC,EAAYC,KAChB,IAASF,KAAOG,UAClB,IAAIC,EAAmBH,EAAUI,UAAU,EAAGJ,EAAUK,QAAQ,KAAM,CAAC,CAAC,EACpEC,EAAmBN,EAAUI,UAAUJ,EAAUK,QAAQ,KAAM,CAAC,EAAE,EAAGL,EAAUO,MAAM,EACzFP,EAAYG,EAAmBD,UAAUH,GAAOO,EAE9C,OAAON,CACX,EAMA,IAAIQ,WAAa,EAHjBC,SAASC,OAAS,oDAIjBC,aAAe,CAAA,EACfC,qBAAuB,CAAA,EACvBC,iBAAmB,CAAA,EACnBC,kBAAoB,CAAA,EACpBC,SAAW,CAAA,EACXC,iBAAmBC,aAAaD,iBAChCE,aAAmBD,aAAaC,aAChCC,aAAmBF,aAAaE,aAE7BC,kBAAoB,IACvBC,oBAAsB,EACtBC,gBAAkB,GAEfC,cAAgBN,aAAaM,cA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AAKC,YAAYR,CAAK,EAC/BA,EAAMZ,MAAM,GAEbrG,OAAO,IAAMmE,EAAEC,OAAOrE,EAAE,EAAEwE,YAAY,UAAU,EAChDvE,OAAO,UAAU,EAAEsE,IAAI,aAAc,QAAQ,CAC9C,CACD,CAAC,CACF,CAAC,EAGDtE,OAAO,kBAAkB,EAAEqG,MAAM,SAAUlC,GAC1CgC,EAAgB,CACjB,CAAC,EAGDnG,OAAO,0BAA0B,EAAEqG,MAAM,SAAUlC,GAClDgC,EAAiB,CAAA,CAAK,CACvB,CAAC,EAGDnG,OAAO,sBAAsB,EAAEqG,MAAM,SAAUlC,GAE9C,GAAK,CAAE/B,QAASnE,aAAayJ,uBAAwB,EACpD,MAAO,CAAA,EAERxD,oBAAqBC,CAAE,CAExB,CAAC,EAgCDnE,OAAO,oBAAoB,EAAE2H,OAAO,WAChC1K,KAAKyF,UACP1C,OAAO,sBAAsB,EAAE2D,KAAK,UAAW,CAAA,CAAI,EACnD3D,OAAO,UAAU,EAAE2D,KAAK,UAAW,CAAA,CAAI,EAAEqB,KAAK,WAAW,CAAA,CAAK,EAEhE,CAAC,CACF,CAAC"}
|
js/cleantalk-users-editscreen.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"cleantalk-users-editscreen.min.js","sources":["cleantalk-users-editscreen.js"],"sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\n\tif(parseInt(ctUsersScreen.ct_show_check_links)) {\n\n\t\t/* Shows link to blacklists near every email and IP address */\n\t\tjQuery('.column-email a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif( ct_is_email(ct_curr_str) !== -1 ){\n\t\t\t\tjQuery(this).after(' <a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctUsersScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n\n\t\t/* Show checked ico near avatar */\n\t\tjQuery('.username.column-username').each(function(){\n\n\t\t\tvar apbct_checking_el = jQuery(this).siblings('.apbct_status').children('span');\n\t\t\tvar apbct_checking_status = apbct_checking_el.attr('id');\n\t\t\tvar apbct_checking_status_text = apbct_checking_el.text();\n\n\t\t\tvar apbct_add_text_element = jQuery('<span>', {\n\t\t\t\ttext : apbct_checking_status_text\n\t\t\t});\n\t\t\tvar apbct_add_ico_ok = jQuery('<i>', {\n\t\t\t\tclass : 'apbct-icon-ok'\n\t\t\t});\n\t\t\tvar apbct_add_ico_cancel = jQuery('<i>', {\n\t\t\t\tclass : 'apbct-icon-cancel',\n\t\t\t\tcss : {\n\t\t\t\t\tcolor : 'red'\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif( apbct_checking_status ==='apbct_not_checked' ) {\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\n\t\t\t}\n\t\t\tif( apbct_checking_status ==='apbct_checked_not_spam' ) {\n\t\t\t\tapbct_add_ico_ok.attr('style', 'color:green;');\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\n\t\t\t}\n\t\t\tif( apbct_checking_status ==='apbct_checked_spam' ) {\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_cancel).before(apbct_add_text_element);\n\t\t\t}\n\n\t\t});\n\n\t}\n\n});"],"names":["ct_is_email","str","search","ct_is_ip","jQuery","document","ready","parseInt","ctUsersScreen","ct_show_check_links","each","ct_curr_str","this","html","after","ct_img_src_new_tab","apbct_checking_el","siblings","children","apbct_checking_status","attr","apbct_checking_status_text","text","apbct_add_text_element","apbct_add_ico_ok","class","apbct_add_ico_cancel","css","color","before"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,
|
1 |
+
{"version":3,"file":"cleantalk-users-editscreen.min.js","sources":["cleantalk-users-editscreen.js"],"sourcesContent":["function ct_is_email(str){\n\treturn str.search(/.*@.*\\..*/);\n}\nfunction ct_is_ip(str){\n\treturn str.search(/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/);\n}\n\njQuery(document).ready(function(){\n\n\n\tif(parseInt(ctUsersScreen.ct_show_check_links)) {\n\n\t\t/* Shows link to blacklists near every email and IP address */\n\t\tjQuery('.column-email a').each(function(){\n\t\t\tvar ct_curr_str = jQuery(this).html();\n\t\t\tif( ct_is_email(ct_curr_str) !== -1 ){\n\t\t\t\tjQuery(this).after(' <a href=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" target=\"_blank\" title=\"https://cleantalk.org/blacklists/'+ct_curr_str+'\" class=\"ct_link_new_tab\"><img src=\"'+ctUsersScreen.ct_img_src_new_tab+'\"></a>');\n\t\t\t}\n\t\t});\n\n\t\t/* Show checked ico near avatar */\n\t\tjQuery('.username.column-username').each(function(){\n\n\t\t\tvar apbct_checking_el = jQuery(this).siblings('.apbct_status').children('span');\n\t\t\tvar apbct_checking_status = apbct_checking_el.attr('id');\n\t\t\tvar apbct_checking_status_text = apbct_checking_el.text();\n\n\t\t\tvar apbct_add_text_element = jQuery('<span>', {\n\t\t\t\ttext : apbct_checking_status_text\n\t\t\t});\n\t\t\tvar apbct_add_ico_ok = jQuery('<i>', {\n\t\t\t\tclass : 'apbct-icon-ok'\n\t\t\t});\n\t\t\tvar apbct_add_ico_cancel = jQuery('<i>', {\n\t\t\t\tclass : 'apbct-icon-cancel',\n\t\t\t\tcss : {\n\t\t\t\t\tcolor : 'red'\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tif( apbct_checking_status ==='apbct_not_checked' ) {\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\n\t\t\t}\n\t\t\tif( apbct_checking_status ==='apbct_checked_not_spam' ) {\n\t\t\t\tapbct_add_ico_ok.attr('style', 'color:green;');\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);\n\t\t\t}\n\t\t\tif( apbct_checking_status ==='apbct_checked_spam' ) {\n\t\t\t\tjQuery(this).children('.row-actions').before(apbct_add_ico_cancel).before(apbct_add_text_element);\n\t\t\t}\n\n\t\t});\n\n\t}\n\n});"],"names":["ct_is_email","str","search","ct_is_ip","jQuery","document","ready","parseInt","ctUsersScreen","ct_show_check_links","each","ct_curr_str","this","html","after","ct_img_src_new_tab","apbct_checking_el","siblings","children","apbct_checking_status","attr","apbct_checking_status_text","text","apbct_add_text_element","apbct_add_ico_ok","class","apbct_add_ico_cancel","css","color","before"],"mappings":"AAAA,SAASA,YAAYC,GACpB,OAAOA,EAAIC,OAAO,WAAW,CAC9B,CACA,SAASC,SAASF,GACjB,OAAOA,EAAIC,OAAO,sCAAsC,CACzD,CAEAE,OAAOC,QAAQ,EAAEC,MAAM,WAGnBC,SAASC,cAAcC,mBAAmB,IAG5CL,OAAO,iBAAiB,EAAEM,KAAK,WAC9B,IAAIC,EAAcP,OAAOQ,IAAI,EAAEC,KAAK,EACH,CAAC,IAA9Bb,YAAYW,CAAW,GAC1BP,OAAOQ,IAAI,EAAEE,MAAM,mDAAmDH,EAAY,6DAA6DA,EAAY,uCAAuCH,cAAcO,mBAAmB,QAAQ,CAE7O,CAAC,EAGDX,OAAO,2BAA2B,EAAEM,KAAK,WAExC,IAAIM,EAAoBZ,OAAOQ,IAAI,EAAEK,SAAS,eAAe,EAAEC,SAAS,MAAM,EAC1EC,EAAwBH,EAAkBI,KAAK,IAAI,EACnDC,EAA6BL,EAAkBM,KAAK,EAEpDC,EAAyBnB,OAAO,SAAU,CAC7CkB,KAAOD,CACR,CAAC,EACGG,EAAmBpB,OAAO,MAAO,CACpCqB,MAAS,eACV,CAAC,EACGC,EAAuBtB,OAAO,MAAO,CACxCqB,MAAS,oBACTE,IAAM,CACLC,MAAQ,KACT,CACD,CAAC,EAE4B,sBAAzBT,GACHf,OAAOQ,IAAI,EAAEM,SAAS,cAAc,EAAEW,OAAOL,CAAgB,EAAEK,OAAON,CAAsB,EAEhE,2BAAzBJ,IACHK,EAAiBJ,KAAK,QAAS,cAAc,EAC7ChB,OAAOQ,IAAI,EAAEM,SAAS,cAAc,EAAEW,OAAOL,CAAgB,EAAEK,OAAON,CAAsB,GAEhE,uBAAzBJ,GACHf,OAAOQ,IAAI,EAAEM,SAAS,cAAc,EAAEW,OAAOH,CAAoB,EAAEG,OAAON,CAAsB,CAGlG,CAAC,EAIH,CAAC"}
|
js/src/apbct-disable-comments.js
DELETED
@@ -1,10 +0,0 @@
|
|
1 |
-
"use strict";
|
2 |
-
wp.domReady(function () {
|
3 |
-
if (wp.blocks) {
|
4 |
-
wp.blocks.getBlockTypes().forEach(function (block) {
|
5 |
-
if (apbctDisableComments.disabled_blocks.includes(block.name)) {
|
6 |
-
wp.blocks.unregisterBlockType(block.name);
|
7 |
-
}
|
8 |
-
});
|
9 |
-
}
|
10 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/apbct-public--0--LibBundle.js
DELETED
@@ -1,865 +0,0 @@
|
|
1 |
-
class ApbctCore{
|
2 |
-
|
3 |
-
ajax_parameters = {};
|
4 |
-
rest_parameters = {};
|
5 |
-
|
6 |
-
#selector = null;
|
7 |
-
elements = [];
|
8 |
-
|
9 |
-
// Event properties
|
10 |
-
#eventCallback;
|
11 |
-
#eventSelector;
|
12 |
-
#event;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Default constructor
|
16 |
-
*/
|
17 |
-
constructor(selector){
|
18 |
-
this.select(selector);
|
19 |
-
}
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Get elements by CSS selector
|
23 |
-
*
|
24 |
-
* @param selector
|
25 |
-
* @returns {*}
|
26 |
-
*/
|
27 |
-
select(selector) {
|
28 |
-
|
29 |
-
if(selector instanceof HTMLCollection){
|
30 |
-
this.#selector = null;
|
31 |
-
this.elements = [];
|
32 |
-
this.elements = Array.prototype.slice.call(selector);
|
33 |
-
}else if( typeof selector === 'object' ){
|
34 |
-
this.#selector = null;
|
35 |
-
this.elements = [];
|
36 |
-
this.elements[0] = selector;
|
37 |
-
}else if( typeof selector === 'string' ){
|
38 |
-
this.#selector = selector;
|
39 |
-
this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));
|
40 |
-
// this.elements = document.querySelectorAll(selector)[0];
|
41 |
-
}else{
|
42 |
-
this.#deselect();
|
43 |
-
}
|
44 |
-
|
45 |
-
return this;
|
46 |
-
}
|
47 |
-
|
48 |
-
#addElement(elemToAdd){
|
49 |
-
if( typeof elemToAdd === 'object' ){
|
50 |
-
this.elements.push(elemToAdd);
|
51 |
-
}else if( typeof elemToAdd === 'string' ){
|
52 |
-
this.#selector = elemToAdd;
|
53 |
-
this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));
|
54 |
-
}else{
|
55 |
-
this.#deselect();
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
#push(elem){
|
60 |
-
this.elements.push(elem);
|
61 |
-
}
|
62 |
-
|
63 |
-
#reduce(){
|
64 |
-
this.elements = this.elements.slice(0,-1);
|
65 |
-
}
|
66 |
-
|
67 |
-
#deselect(){
|
68 |
-
this.elements = [];
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Set or get CSS for/of currently selected element
|
73 |
-
*
|
74 |
-
* @param style
|
75 |
-
* @param getRaw
|
76 |
-
*
|
77 |
-
* @returns {boolean|*}
|
78 |
-
*/
|
79 |
-
css(style, getRaw){
|
80 |
-
|
81 |
-
getRaw = getRaw | false;
|
82 |
-
|
83 |
-
// Set style
|
84 |
-
if(typeof style === "object"){
|
85 |
-
|
86 |
-
const stringToCamelCase = str =>
|
87 |
-
str.replace(/([-_][a-z])/g, group =>
|
88 |
-
group
|
89 |
-
.toUpperCase()
|
90 |
-
.replace('-', '')
|
91 |
-
.replace('_', '')
|
92 |
-
);
|
93 |
-
|
94 |
-
// Apply multiple styles
|
95 |
-
for(let style_name in style){
|
96 |
-
let DOM_style_name = stringToCamelCase(style_name);
|
97 |
-
|
98 |
-
// Apply to multiple elements (currently selected)
|
99 |
-
for(let i=0; i<this.elements.length; i++){
|
100 |
-
this.elements[i].style[DOM_style_name] = style[style_name];
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
return this;
|
105 |
-
}
|
106 |
-
|
107 |
-
// Get style of first currently selected element
|
108 |
-
if(typeof style === 'string'){
|
109 |
-
|
110 |
-
let computedStyle = getComputedStyle(this.elements[0])[style];
|
111 |
-
|
112 |
-
console.log(computedStyle);
|
113 |
-
|
114 |
-
// Process
|
115 |
-
if( typeof computedStyle !== 'undefined' && ! getRaw){
|
116 |
-
computedStyle = computedStyle.replace(/(\d)(em|pt|%|px){1,2}$/, '$1'); // Cut of units
|
117 |
-
computedStyle = Number(computedStyle) == computedStyle ? Number(computedStyle) : computedStyle; // Cast to INT
|
118 |
-
return computedStyle;
|
119 |
-
}
|
120 |
-
|
121 |
-
// Return unprocessed
|
122 |
-
return computedStyle;
|
123 |
-
}
|
124 |
-
}
|
125 |
-
|
126 |
-
hide(){
|
127 |
-
this.prop('prev-display', this.css('display'));
|
128 |
-
this.css({'display': 'none'});
|
129 |
-
}
|
130 |
-
|
131 |
-
show(){
|
132 |
-
this.css({'display': this.prop('prev-display')});
|
133 |
-
}
|
134 |
-
|
135 |
-
addClass(){
|
136 |
-
for(let i=0; i<this.elements.length; i++){
|
137 |
-
this.elements[i].classList.add(className);
|
138 |
-
}
|
139 |
-
}
|
140 |
-
|
141 |
-
removeClass(){
|
142 |
-
for(let i=0; i<this.elements.length; i++){
|
143 |
-
this.elements[i].classList.remove(className);
|
144 |
-
}
|
145 |
-
}
|
146 |
-
|
147 |
-
toggleClass(className){
|
148 |
-
for(let i=0; i<this.elements.length; i++){
|
149 |
-
this.elements[i].classList.toggle(className);
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* Wrapper for apbctAJAX class
|
155 |
-
*
|
156 |
-
* @param ajax_parameters
|
157 |
-
* @returns {ApbctAjax}
|
158 |
-
*/
|
159 |
-
ajax(ajax_parameters){
|
160 |
-
this.ajax_parameters = ajax_parameters;
|
161 |
-
return new ApbctAjax(ajax_parameters);
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Wrapper for apbctREST class
|
166 |
-
*
|
167 |
-
* @param rest_parameters
|
168 |
-
* @returns {ApbctRest}
|
169 |
-
*/
|
170 |
-
rest(rest_parameters){
|
171 |
-
this.rest_parameters = rest_parameters;
|
172 |
-
return new ApbctRest(rest_parameters);
|
173 |
-
}
|
174 |
-
|
175 |
-
/************** EVENTS **************/
|
176 |
-
|
177 |
-
/**
|
178 |
-
*
|
179 |
-
* Why the mess with arguments?
|
180 |
-
*
|
181 |
-
* Because we need to support the following function signatures:
|
182 |
-
* on('click', function(){ alert('some'); });
|
183 |
-
* on('click', 'inner_selector', function(){ alert('some'); });
|
184 |
-
*
|
185 |
-
* @param args
|
186 |
-
*/
|
187 |
-
on(...args){
|
188 |
-
|
189 |
-
this.#event = args[0];
|
190 |
-
this.#eventCallback = args[2] || args[1];
|
191 |
-
this.#eventSelector = typeof args[1] === "string" ? args[1] : null;
|
192 |
-
|
193 |
-
for(let i=0; i<this.elements.length; i++){
|
194 |
-
this.elements[i].addEventListener(
|
195 |
-
this.#event,
|
196 |
-
this.#eventSelector !== null
|
197 |
-
? this.#onChecker.bind(this)
|
198 |
-
: this.#eventCallback
|
199 |
-
);
|
200 |
-
}
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Check if a selector of an event matches current target
|
205 |
-
*
|
206 |
-
* @param event
|
207 |
-
* @returns {*}
|
208 |
-
*/
|
209 |
-
#onChecker(event){
|
210 |
-
if(event.target === document.querySelector(this.#eventSelector)){
|
211 |
-
event.stopPropagation();
|
212 |
-
return this.#eventCallback(event);
|
213 |
-
}
|
214 |
-
}
|
215 |
-
|
216 |
-
ready(callback){
|
217 |
-
document.addEventListener('DOMContentLoaded', callback);
|
218 |
-
}
|
219 |
-
|
220 |
-
change(callback){
|
221 |
-
this.on('change', callback);
|
222 |
-
}
|
223 |
-
|
224 |
-
/************** ATTRIBUTES **************/
|
225 |
-
|
226 |
-
/**
|
227 |
-
* Get an attribute or property of an element
|
228 |
-
*
|
229 |
-
* @param attrName
|
230 |
-
* @returns {*|*[]}
|
231 |
-
*/
|
232 |
-
attr(attrName){
|
233 |
-
|
234 |
-
let outputValue = [];
|
235 |
-
|
236 |
-
for(let i=0; i<this.elements.length; i++){
|
237 |
-
|
238 |
-
// Use property instead of attribute if possible
|
239 |
-
if(typeof this.elements[i][attrName] !== undefined){
|
240 |
-
outputValue.push(this.elements[i][attrName]);
|
241 |
-
}else{
|
242 |
-
outputValue.push(this.elements[i].getAttribute(attrName));
|
243 |
-
}
|
244 |
-
}
|
245 |
-
|
246 |
-
// Return a single value instead of array if only one value is present
|
247 |
-
return outputValue.length === 1 ? outputValue[0] : outputValue;
|
248 |
-
}
|
249 |
-
|
250 |
-
prop(propName, value){
|
251 |
-
|
252 |
-
// Setting values
|
253 |
-
if(typeof value !== "undefined"){
|
254 |
-
for(let i=0; i<this.elements.length; i++){
|
255 |
-
this.elements[i][propName] = value;
|
256 |
-
}
|
257 |
-
|
258 |
-
return this;
|
259 |
-
|
260 |
-
// Getting values
|
261 |
-
}else{
|
262 |
-
|
263 |
-
let outputValue = [];
|
264 |
-
|
265 |
-
for(let i=0; i<this.elements.length; i++){
|
266 |
-
outputValue.push(this.elements[i][propName]);
|
267 |
-
}
|
268 |
-
|
269 |
-
// Return a single value instead of array if only one value is present
|
270 |
-
return outputValue.length === 1 ? outputValue[0] : outputValue;
|
271 |
-
}
|
272 |
-
}
|
273 |
-
|
274 |
-
/**
|
275 |
-
* Set or get inner HTML
|
276 |
-
*
|
277 |
-
* @param value
|
278 |
-
* @returns {*|*[]}
|
279 |
-
*/
|
280 |
-
html(value){
|
281 |
-
return typeof value !== 'undefined'
|
282 |
-
? this.prop('innerHTML', value)
|
283 |
-
: this.prop('innerHTML');
|
284 |
-
}
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Set or get value of input tags
|
288 |
-
*
|
289 |
-
* @param value
|
290 |
-
* @returns {*|*[]|undefined}
|
291 |
-
*/
|
292 |
-
val(value){
|
293 |
-
return typeof value !== 'undefined'
|
294 |
-
? this.prop('value', value)
|
295 |
-
: this.prop('value');
|
296 |
-
}
|
297 |
-
|
298 |
-
data(name, value){
|
299 |
-
return typeof value !== 'undefined'
|
300 |
-
? this.prop('apbct-data', name, value)
|
301 |
-
: this.prop('apbct-data');
|
302 |
-
}
|
303 |
-
|
304 |
-
/************** END OF ATTRIBUTES **************/
|
305 |
-
|
306 |
-
/************** FILTERS **************/
|
307 |
-
|
308 |
-
/**
|
309 |
-
* Check if the current elements are corresponding to filter
|
310 |
-
*
|
311 |
-
* @param filter
|
312 |
-
* @returns {boolean}
|
313 |
-
*/
|
314 |
-
is(filter){
|
315 |
-
|
316 |
-
let outputValue = false;
|
317 |
-
|
318 |
-
for(let elem of this.elements){
|
319 |
-
outputValue ||= this.#isElem(elem, filter);
|
320 |
-
}
|
321 |
-
|
322 |
-
return outputValue;
|
323 |
-
}
|
324 |
-
|
325 |
-
#isElem(elemToCheck, filter){
|
326 |
-
|
327 |
-
let is = false;
|
328 |
-
let isRegisteredTagName = function(name){
|
329 |
-
let newlyCreatedElement = document.createElement(name).constructor;
|
330 |
-
return ! Boolean( ~[HTMLElement, HTMLUnknownElement].indexOf(newlyCreatedElement) );
|
331 |
-
};
|
332 |
-
|
333 |
-
// Check for filter function
|
334 |
-
if(typeof filter === 'function') {
|
335 |
-
is ||= filter.call(this, elemToCheck);
|
336 |
-
}
|
337 |
-
|
338 |
-
// Check for filter function
|
339 |
-
if(typeof filter === 'string') {
|
340 |
-
|
341 |
-
// Filter is tag name
|
342 |
-
if( filter.match(/^[a-z]/) && isRegisteredTagName(filter) ){
|
343 |
-
is ||= elemToCheck.tagName.toLowerCase() === filter.toLowerCase();
|
344 |
-
|
345 |
-
// Filter is property
|
346 |
-
}else if( filter.match(/^[a-z]/) ){
|
347 |
-
is ||= Boolean(elemToCheck[filter]);
|
348 |
-
|
349 |
-
// Filter is CSS selector
|
350 |
-
}else {
|
351 |
-
is ||= this.#selector !== null
|
352 |
-
? document.querySelector(this.#selector + filter) !== null // If possible
|
353 |
-
: this.#isWithoutSelector(elemToCheck, filter); // Search through all elems with such selector
|
354 |
-
}
|
355 |
-
}
|
356 |
-
|
357 |
-
return is;
|
358 |
-
}
|
359 |
-
|
360 |
-
#isWithoutSelector(elemToCheck, filter){
|
361 |
-
|
362 |
-
let elems = document.querySelectorAll(filter);
|
363 |
-
let outputValue = false;
|
364 |
-
|
365 |
-
for(let elem of elems){
|
366 |
-
outputValue ||= elemToCheck === elem;
|
367 |
-
}
|
368 |
-
|
369 |
-
return outputValue;
|
370 |
-
}
|
371 |
-
|
372 |
-
filter(filter){
|
373 |
-
|
374 |
-
this.#selector = null;
|
375 |
-
|
376 |
-
for( let i = this.elements.length - 1; i >= 0; i-- ){
|
377 |
-
if( ! this.#isElem(this.elements[i], filter) ){
|
378 |
-
this.elements.splice(Number(i), 1);
|
379 |
-
}
|
380 |
-
}
|
381 |
-
|
382 |
-
return this;
|
383 |
-
}
|
384 |
-
|
385 |
-
/************** NODES **************/
|
386 |
-
|
387 |
-
parent(filter){
|
388 |
-
|
389 |
-
this.select(this.elements[0].parentElement);
|
390 |
-
|
391 |
-
if( typeof filter !== 'undefined' && ! this.is(filter) ){
|
392 |
-
this.#deselect();
|
393 |
-
}
|
394 |
-
|
395 |
-
return this;
|
396 |
-
}
|
397 |
-
|
398 |
-
parents(filter){
|
399 |
-
|
400 |
-
this.select(this.elements[0]);
|
401 |
-
|
402 |
-
for ( ; this.elements[ this.elements.length - 1].parentElement !== null ; ) {
|
403 |
-
this.#push(this.elements[ this.elements.length - 1].parentElement);
|
404 |
-
}
|
405 |
-
|
406 |
-
this.elements.splice(0,1); // Deleting initial element from the set
|
407 |
-
|
408 |
-
if( typeof filter !== 'undefined' ){
|
409 |
-
this.filter(filter);
|
410 |
-
}
|
411 |
-
|
412 |
-
return this;
|
413 |
-
}
|
414 |
-
|
415 |
-
children(filter){
|
416 |
-
|
417 |
-
this.select(this.elements[0].children);
|
418 |
-
|
419 |
-
if( typeof filter !== 'undefined' ){
|
420 |
-
this.filter(filter);
|
421 |
-
}
|
422 |
-
|
423 |
-
return this;
|
424 |
-
}
|
425 |
-
|
426 |
-
siblings(filter){
|
427 |
-
|
428 |
-
let current = this.elements[0]; // Remember current to delete it later
|
429 |
-
|
430 |
-
this.parent();
|
431 |
-
this.children(filter);
|
432 |
-
this.elements.splice(this.elements.indexOf(current), 1); // Remove current element
|
433 |
-
|
434 |
-
return this;
|
435 |
-
}
|
436 |
-
|
437 |
-
/************** DOM MANIPULATIONS **************/
|
438 |
-
remove(){
|
439 |
-
for(let elem of this.elements){
|
440 |
-
elem.remove();
|
441 |
-
}
|
442 |
-
}
|
443 |
-
|
444 |
-
after(content){
|
445 |
-
for(let elem of this.elements){
|
446 |
-
elem.after(content);
|
447 |
-
}
|
448 |
-
}
|
449 |
-
|
450 |
-
append(content){
|
451 |
-
for(let elem of this.elements){
|
452 |
-
elem.append(content);
|
453 |
-
}
|
454 |
-
}
|
455 |
-
|
456 |
-
/** ANIMATION **/
|
457 |
-
fadeIn(time) {
|
458 |
-
for(let elem of this.elements){
|
459 |
-
elem.style.opacity = 0;
|
460 |
-
elem.style.display = 'block';
|
461 |
-
|
462 |
-
let last = +new Date();
|
463 |
-
const tick = function () {
|
464 |
-
elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;
|
465 |
-
last = +new Date();
|
466 |
-
|
467 |
-
if (+elem.style.opacity < 1) {
|
468 |
-
(window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);
|
469 |
-
}
|
470 |
-
};
|
471 |
-
|
472 |
-
tick();
|
473 |
-
}
|
474 |
-
}
|
475 |
-
|
476 |
-
fadeOut(time) {
|
477 |
-
for(let elem of this.elements){
|
478 |
-
elem.style.opacity = 1;
|
479 |
-
|
480 |
-
let last = +new Date();
|
481 |
-
const tick = function () {
|
482 |
-
elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;
|
483 |
-
last = +new Date();
|
484 |
-
|
485 |
-
if (+elem.style.opacity > 0) {
|
486 |
-
(window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);
|
487 |
-
} else {
|
488 |
-
elem.style.display = 'none';
|
489 |
-
}
|
490 |
-
};
|
491 |
-
|
492 |
-
tick();
|
493 |
-
}
|
494 |
-
}
|
495 |
-
|
496 |
-
}
|
497 |
-
|
498 |
-
/**
|
499 |
-
* Hack
|
500 |
-
*
|
501 |
-
* Make a proxy to keep both properties and methods from:
|
502 |
-
* - the native object and
|
503 |
-
* - the new one from ApbctCore for selected element.
|
504 |
-
*
|
505 |
-
* For example:
|
506 |
-
* apbct('#id).innerHTML = 'some';
|
507 |
-
* apbct('#id).css({'backgorund-color': 'black'});
|
508 |
-
*/
|
509 |
-
// apbct = new Proxy(
|
510 |
-
// apbct,
|
511 |
-
// {
|
512 |
-
// get(target, prop) {
|
513 |
-
// if (target.elements.length) {
|
514 |
-
// return target.elements[0][prop];
|
515 |
-
// } else {
|
516 |
-
// return null;
|
517 |
-
// }
|
518 |
-
// },
|
519 |
-
// set(target, prop, value){
|
520 |
-
// if (target.elements.length) {
|
521 |
-
// target.elements[0][prop] = value;
|
522 |
-
// return true;
|
523 |
-
// } else {
|
524 |
-
// return false;
|
525 |
-
// }
|
526 |
-
// },
|
527 |
-
// apply(target, thisArg, argArray) {
|
528 |
-
//
|
529 |
-
// }
|
530 |
-
// }
|
531 |
-
// );
|
532 |
-
|
533 |
-
/**
|
534 |
-
* Enter point to ApbctCore class
|
535 |
-
*
|
536 |
-
* @param params
|
537 |
-
* @returns {*}
|
538 |
-
*/
|
539 |
-
function apbct(params){
|
540 |
-
return new ApbctCore()
|
541 |
-
.select(params);
|
542 |
-
}
|
543 |
-
class ApbctXhr{
|
544 |
-
|
545 |
-
#xhr = new XMLHttpRequest();
|
546 |
-
|
547 |
-
// Base parameters
|
548 |
-
method = 'POST'; // HTTP-request type
|
549 |
-
url = ''; // URL to send the request
|
550 |
-
async = true;
|
551 |
-
user = null; // HTTP-authorization username
|
552 |
-
password = null; // HTTP-authorization password
|
553 |
-
data = {}; // Data to send
|
554 |
-
|
555 |
-
|
556 |
-
// Optional params
|
557 |
-
button = null; // Button that should be disabled when request is performing
|
558 |
-
spinner = null; // Spinner that should appear when request is in process
|
559 |
-
progressbar = null; // Progress bar for the current request
|
560 |
-
context = this; // Context
|
561 |
-
callback = null;
|
562 |
-
onErrorCallback = null;
|
563 |
-
|
564 |
-
responseType = 'json'; // Expected data type from server
|
565 |
-
headers = {};
|
566 |
-
timeout = 15000; // Request timeout in milliseconds
|
567 |
-
|
568 |
-
#methods_to_convert_data_to_URL = [
|
569 |
-
'GET',
|
570 |
-
'HEAD',
|
571 |
-
];
|
572 |
-
|
573 |
-
#body = null;
|
574 |
-
#http_code = 0;
|
575 |
-
#status_text = '';
|
576 |
-
|
577 |
-
constructor(parameters){
|
578 |
-
|
579 |
-
console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');
|
580 |
-
|
581 |
-
// Set class properties
|
582 |
-
for( let key in parameters ){
|
583 |
-
if( typeof this[key] !== 'undefined' ){
|
584 |
-
this[key] = parameters[key];
|
585 |
-
}
|
586 |
-
}
|
587 |
-
|
588 |
-
// Modifying DOM-elements
|
589 |
-
this.#prepare();
|
590 |
-
|
591 |
-
// Modify URL with data for GET and HEAD requests
|
592 |
-
if ( Object.keys(this.data).length ) {
|
593 |
-
this.deleteDoubleJSONEncoding(this.data);
|
594 |
-
this.convertData();
|
595 |
-
}
|
596 |
-
|
597 |
-
if( ! this.url ){
|
598 |
-
console.log('%cXHR%c not URL provided', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;')
|
599 |
-
return false;
|
600 |
-
}
|
601 |
-
|
602 |
-
// Configure the request
|
603 |
-
this.#xhr.open(this.method, this.url, this.async, this.user, this.password);
|
604 |
-
this.setHeaders();
|
605 |
-
|
606 |
-
this.#xhr.responseType = this.responseType;
|
607 |
-
this.#xhr.timeout = this.timeout;
|
608 |
-
|
609 |
-
/* EVENTS */
|
610 |
-
// Monitoring status
|
611 |
-
this.#xhr.onreadystatechange = function(){
|
612 |
-
this.onReadyStateChange();
|
613 |
-
}.bind(this);
|
614 |
-
|
615 |
-
// Run callback
|
616 |
-
this.#xhr.onload = function(){
|
617 |
-
this.onLoad();
|
618 |
-
}.bind(this);
|
619 |
-
|
620 |
-
// On progress
|
621 |
-
this.#xhr.onprogress = function(event){
|
622 |
-
this.onProgress(event);
|
623 |
-
}.bind(this);
|
624 |
-
|
625 |
-
// On error
|
626 |
-
this.#xhr.onerror = function(){
|
627 |
-
this.onError();
|
628 |
-
}.bind(this);
|
629 |
-
|
630 |
-
this.#xhr.ontimeout = function(){
|
631 |
-
this.onTimeout();
|
632 |
-
}.bind(this);
|
633 |
-
|
634 |
-
// Send the request
|
635 |
-
this.#xhr.send(this.#body);
|
636 |
-
}
|
637 |
-
|
638 |
-
#prepare(){
|
639 |
-
|
640 |
-
// Disable button
|
641 |
-
if(this.button){
|
642 |
-
this.button.setAttribute('disabled', 'disabled');
|
643 |
-
this.button.style.cursor = 'not-allowed';
|
644 |
-
}
|
645 |
-
|
646 |
-
// Enable spinner
|
647 |
-
if(this.spinner) {
|
648 |
-
this.spinner.style.display = 'inline';
|
649 |
-
}
|
650 |
-
}
|
651 |
-
|
652 |
-
#complete(){
|
653 |
-
|
654 |
-
this.#http_code = this.#xhr.status;
|
655 |
-
this.#status_text = this.#xhr.statusText;
|
656 |
-
|
657 |
-
// Disable button
|
658 |
-
if(this.button){
|
659 |
-
this.button.removeAttribute('disabled');
|
660 |
-
this.button.style.cursor = 'auto';
|
661 |
-
}
|
662 |
-
|
663 |
-
// Enable spinner
|
664 |
-
if(this.spinner) {
|
665 |
-
this.spinner.style.display = 'none';
|
666 |
-
}
|
667 |
-
|
668 |
-
if( this.progressbar ) {
|
669 |
-
this.progressbar.fadeOut('slow');
|
670 |
-
}
|
671 |
-
}
|
672 |
-
|
673 |
-
onReadyStateChange(){
|
674 |
-
if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function'){
|
675 |
-
this.on_ready_state_change();
|
676 |
-
}
|
677 |
-
}
|
678 |
-
|
679 |
-
onProgress(event) {
|
680 |
-
if (this.on_progress !== null && typeof this.on_progress === 'function'){
|
681 |
-
this.on_progress();
|
682 |
-
}
|
683 |
-
}
|
684 |
-
|
685 |
-
onError(){
|
686 |
-
|
687 |
-
console.log('error');
|
688 |
-
|
689 |
-
this.#complete();
|
690 |
-
this.#error(
|
691 |
-
this.#http_code,
|
692 |
-
this.#status_text
|
693 |
-
);
|
694 |
-
|
695 |
-
if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){
|
696 |
-
this.onErrorCallback(this.#status_text);
|
697 |
-
}
|
698 |
-
}
|
699 |
-
|
700 |
-
onTimeout(){
|
701 |
-
this.#complete();
|
702 |
-
this.#error(
|
703 |
-
0,
|
704 |
-
'timeout'
|
705 |
-
);
|
706 |
-
|
707 |
-
if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){
|
708 |
-
this.onErrorCallback('Timeout');
|
709 |
-
}
|
710 |
-
}
|
711 |
-
|
712 |
-
onLoad(){
|
713 |
-
|
714 |
-
this.#complete();
|
715 |
-
|
716 |
-
if (this.responseType === 'json' ){
|
717 |
-
if(this.#xhr.response === null){
|
718 |
-
this.#error(this.#http_code, this.#status_text, 'No response');
|
719 |
-
return false;
|
720 |
-
}else if( typeof this.#xhr.response.error !== 'undefined') {
|
721 |
-
this.#error(this.#http_code, this.#status_text, this.#xhr.response.error);
|
722 |
-
return false;
|
723 |
-
}
|
724 |
-
}
|
725 |
-
|
726 |
-
if (this.callback !== null && typeof this.callback === 'function') {
|
727 |
-
this.callback.call(this.context, this.#xhr.response, this.data);
|
728 |
-
}
|
729 |
-
}
|
730 |
-
|
731 |
-
#error(http_code, status_text, additional_msg){
|
732 |
-
|
733 |
-
let error_string = '';
|
734 |
-
|
735 |
-
if( status_text === 'timeout' ){
|
736 |
-
error_string += 'Server response timeout'
|
737 |
-
|
738 |
-
}else if( http_code === 200 ){
|
739 |
-
|
740 |
-
if( status_text === 'parsererror' ){
|
741 |
-
error_string += 'Unexpected response from server. See console for details.';
|
742 |
-
}else {
|
743 |
-
error_string += 'Unexpected error. Status: ' + status_text + '.';
|
744 |
-
if( typeof additional_msg !== 'undefined' )
|
745 |
-
error_string += ' Additional error info: ' + additional_msg;
|
746 |
-
}
|
747 |
-
|
748 |
-
}else if(http_code === 500){
|
749 |
-
error_string += 'Internal server error.';
|
750 |
-
|
751 |
-
}else {
|
752 |
-
error_string += 'Unexpected response code:' + http_code;
|
753 |
-
}
|
754 |
-
|
755 |
-
this.errorOutput( error_string );
|
756 |
-
}
|
757 |
-
|
758 |
-
errorOutput(error_msg){
|
759 |
-
console.log( '%c ctXHR error: %c' + error_msg, 'color: red;', 'color: grey;' );
|
760 |
-
}
|
761 |
-
|
762 |
-
setHeaders(){
|
763 |
-
// Set headers if passed
|
764 |
-
for( let header_name in this.headers ){
|
765 |
-
if( typeof this.headers[header_name] !== 'undefined' ){
|
766 |
-
this.#xhr.setRequestHeader(header_name, this.headers[header_name]);
|
767 |
-
}
|
768 |
-
}
|
769 |
-
}
|
770 |
-
|
771 |
-
convertData()
|
772 |
-
{
|
773 |
-
// GET, HEAD request-type
|
774 |
-
if( ~this.#methods_to_convert_data_to_URL.indexOf( this.method ) ){
|
775 |
-
return this.convertDataToURL();
|
776 |
-
|
777 |
-
// POST request-type
|
778 |
-
}else{
|
779 |
-
return this.convertDataToBody()
|
780 |
-
}
|
781 |
-
}
|
782 |
-
|
783 |
-
convertDataToURL(){
|
784 |
-
let params_appendix = new URLSearchParams(this.data).toString();
|
785 |
-
let params_prefix = this.url.match(/^(https?:\/{2})?[a-z0-9.]+\?/) ? '&' : '?';
|
786 |
-
this.url += params_prefix + params_appendix;
|
787 |
-
|
788 |
-
return this.url;
|
789 |
-
}
|
790 |
-
|
791 |
-
/**
|
792 |
-
*
|
793 |
-
* @returns {null}
|
794 |
-
*/
|
795 |
-
convertDataToBody()
|
796 |
-
{
|
797 |
-
this.#body = new FormData();
|
798 |
-
|
799 |
-
for (let dataKey in this.data) {
|
800 |
-
this.#body.append(
|
801 |
-
dataKey,
|
802 |
-
typeof this.data[dataKey] === 'object'
|
803 |
-
? JSON.stringify(this.data[dataKey])
|
804 |
-
: this.data[dataKey]
|
805 |
-
);
|
806 |
-
}
|
807 |
-
|
808 |
-
return this.#body;
|
809 |
-
}
|
810 |
-
|
811 |
-
/**
|
812 |
-
* Recursive
|
813 |
-
*
|
814 |
-
* Recursively decode JSON-encoded properties
|
815 |
-
*
|
816 |
-
* @param object
|
817 |
-
* @returns {*}
|
818 |
-
*/
|
819 |
-
deleteDoubleJSONEncoding(object){
|
820 |
-
|
821 |
-
if( typeof object === 'object'){
|
822 |
-
|
823 |
-
for (let objectKey in object) {
|
824 |
-
|
825 |
-
// Recursion
|
826 |
-
if( typeof object[objectKey] === 'object'){
|
827 |
-
object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);
|
828 |
-
}
|
829 |
-
|
830 |
-
// Common case (out)
|
831 |
-
if(
|
832 |
-
typeof object[objectKey] === 'string' &&
|
833 |
-
object[objectKey].match(/^[\[{].*?[\]}]$/) !== null // is like JSON
|
834 |
-
){
|
835 |
-
let parsedValue = JSON.parse(object[objectKey]);
|
836 |
-
if( typeof parsedValue === 'object' ){
|
837 |
-
object[objectKey] = parsedValue;
|
838 |
-
}
|
839 |
-
}
|
840 |
-
}
|
841 |
-
}
|
842 |
-
|
843 |
-
return object;
|
844 |
-
}
|
845 |
-
}
|
846 |
-
class ApbctAjax extends ApbctXhr{
|
847 |
-
|
848 |
-
constructor(...args) {
|
849 |
-
super(args[0]);
|
850 |
-
}
|
851 |
-
}
|
852 |
-
class ApbctRest extends ApbctXhr{
|
853 |
-
|
854 |
-
static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';
|
855 |
-
route = '';
|
856 |
-
|
857 |
-
constructor(...args) {
|
858 |
-
args = args[0];
|
859 |
-
args.url = ApbctRest.default_route + args.route;
|
860 |
-
args.headers = {
|
861 |
-
"X-WP-Nonce": ctPublicFunctions._rest_nonce
|
862 |
-
};
|
863 |
-
super(args);
|
864 |
-
}
|
865 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/apbct-public--1--functions.js
DELETED
@@ -1,187 +0,0 @@
|
|
1 |
-
function ctSetCookie( cookies, value, expires ){
|
2 |
-
|
3 |
-
if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){
|
4 |
-
var skip_alt = cookies === 'ct_pointer_data';
|
5 |
-
cookies = [ [ cookies, value, expires ] ];
|
6 |
-
}
|
7 |
-
|
8 |
-
// Cookies disabled
|
9 |
-
if( ctPublicFunctions.data__cookies_type === 'none' ){
|
10 |
-
cookies.forEach( function (item, i, arr ) {
|
11 |
-
apbctLocalStorage.set(item[0], encodeURIComponent(item[1]))
|
12 |
-
});
|
13 |
-
ctNoCookieAttachHiddenFieldsToForms()
|
14 |
-
// Using traditional cookies
|
15 |
-
}else if( ctPublicFunctions.data__cookies_type === 'native' ){
|
16 |
-
cookies.forEach( function (item, i, arr ) {
|
17 |
-
var expires = typeof item[2] !== 'undefined' ? "expires=" + expires + '; ' : '';
|
18 |
-
var ctSecure = location.protocol === 'https:' ? '; secure' : '';
|
19 |
-
document.cookie = ctPublicFunctions.cookiePrefix + item[0] + "=" + encodeURIComponent(item[1]) + "; " + expires + "path=/; samesite=lax" + ctSecure;
|
20 |
-
});
|
21 |
-
|
22 |
-
// Using alternative cookies
|
23 |
-
}else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ){
|
24 |
-
|
25 |
-
if (typeof (getJavascriptClientData) === "function"){
|
26 |
-
//reprocess already gained cookies data
|
27 |
-
cookies = getJavascriptClientData(cookies);
|
28 |
-
} else {
|
29 |
-
console.log('APBCT ERROR: getJavascriptClientData() is not loaded')
|
30 |
-
}
|
31 |
-
|
32 |
-
try {
|
33 |
-
JSON.parse(cookies)
|
34 |
-
} catch (e){
|
35 |
-
console.log('APBCT ERROR: JSON parse error:' + e)
|
36 |
-
return
|
37 |
-
}
|
38 |
-
|
39 |
-
// Using REST API handler
|
40 |
-
if( ctPublicFunctions.data__ajax_type === 'rest' ){
|
41 |
-
apbct_public_sendREST(
|
42 |
-
'alt_sessions',
|
43 |
-
{
|
44 |
-
method: 'POST',
|
45 |
-
data: { cookies: cookies }
|
46 |
-
}
|
47 |
-
);
|
48 |
-
|
49 |
-
// Using AJAX request and handler
|
50 |
-
} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {
|
51 |
-
apbct_public_sendAJAX(
|
52 |
-
{
|
53 |
-
action: 'apbct_alt_session__save__AJAX',
|
54 |
-
cookies: cookies,
|
55 |
-
},
|
56 |
-
{
|
57 |
-
notJson: 1,
|
58 |
-
}
|
59 |
-
);
|
60 |
-
}
|
61 |
-
}
|
62 |
-
}
|
63 |
-
|
64 |
-
/**
|
65 |
-
* Get cookie by name
|
66 |
-
* @param name
|
67 |
-
* @returns {string|undefined}
|
68 |
-
*/
|
69 |
-
function ctGetCookie(name) {
|
70 |
-
var matches = document.cookie.match(new RegExp(
|
71 |
-
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
72 |
-
));
|
73 |
-
return matches ? decodeURIComponent(matches[1]) : undefined;
|
74 |
-
}
|
75 |
-
|
76 |
-
function ctDeleteCookie(cookieName) {
|
77 |
-
// Cookies disabled
|
78 |
-
if( ctPublicFunctions.data__cookies_type === 'none' ){
|
79 |
-
return;
|
80 |
-
|
81 |
-
// Using traditional cookies
|
82 |
-
}else if( ctPublicFunctions.data__cookies_type === 'native' ){
|
83 |
-
|
84 |
-
var ctSecure = location.protocol === 'https:' ? '; secure' : '';
|
85 |
-
document.cookie = cookieName + "=\"\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax" + ctSecure;
|
86 |
-
|
87 |
-
// Using alternative cookies
|
88 |
-
}else if( ctPublicFunctions.data__cookies_type === 'alternative' ){
|
89 |
-
// @ToDo implement this logic
|
90 |
-
}
|
91 |
-
}
|
92 |
-
|
93 |
-
function apbct_public_sendAJAX(data, params, obj){
|
94 |
-
|
95 |
-
// Default params
|
96 |
-
let _params = [];
|
97 |
-
_params["callback"] = params.callback || null;
|
98 |
-
_params["onErrorCallback"] = params.onErrorCallback || null;
|
99 |
-
_params["callback_context"] = params.callback_context || null;
|
100 |
-
_params["callback_params"] = params.callback_params || null;
|
101 |
-
_params["async"] = params.async || true;
|
102 |
-
_params["notJson"] = params.notJson || null;
|
103 |
-
_params["timeout"] = params.timeout || 15000;
|
104 |
-
_params["obj"] = obj || null;
|
105 |
-
_params["button"] = params.button || null;
|
106 |
-
_params["progressbar"] = params.progressbar || null;
|
107 |
-
_params["silent"] = params.silent || null;
|
108 |
-
_params["no_nonce"] = params.no_nonce || null;
|
109 |
-
_params["data"] = data;
|
110 |
-
_params["url"] = ctPublicFunctions._ajax_url;
|
111 |
-
|
112 |
-
if(typeof (data) === 'string') {
|
113 |
-
if( ! _params["no_nonce"] ) {
|
114 |
-
_params["data"] = _params["data"] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;
|
115 |
-
}
|
116 |
-
_params["data"] = _params["data"] + '&no_cache=' + Math.random()
|
117 |
-
} else {
|
118 |
-
if( ! _params["no_nonce"] ) {
|
119 |
-
_params["data"]._ajax_nonce = ctPublicFunctions._ajax_nonce;
|
120 |
-
}
|
121 |
-
_params["data"].no_cache = Math.random();
|
122 |
-
}
|
123 |
-
|
124 |
-
new ApbctCore().ajax(_params);
|
125 |
-
}
|
126 |
-
|
127 |
-
function apbct_public_sendREST( route, params ) {
|
128 |
-
|
129 |
-
let _params = [];
|
130 |
-
_params["route"] = route;
|
131 |
-
_params["callback"] = params.callback || null;
|
132 |
-
_params["onErrorCallback"] = params.onErrorCallback || null;
|
133 |
-
_params["data"] = params.data || [];
|
134 |
-
_params["method"] = params.method || 'POST';
|
135 |
-
|
136 |
-
new ApbctCore().rest(_params);
|
137 |
-
}
|
138 |
-
|
139 |
-
apbctLocalStorage = {
|
140 |
-
get : function(key, property) {
|
141 |
-
if ( typeof property === 'undefined' ) {
|
142 |
-
property = 'value';
|
143 |
-
}
|
144 |
-
const storageValue = localStorage.getItem(key);
|
145 |
-
if ( storageValue !== null ) {
|
146 |
-
try {
|
147 |
-
const json = JSON.parse(storageValue);
|
148 |
-
return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;
|
149 |
-
} catch (e) {
|
150 |
-
return storageValue;
|
151 |
-
}
|
152 |
-
}
|
153 |
-
return false;
|
154 |
-
},
|
155 |
-
set : function(key, value, is_json = true) {
|
156 |
-
if (is_json){
|
157 |
-
let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};
|
158 |
-
localStorage.setItem(key, JSON.stringify(objToSave));
|
159 |
-
} else {
|
160 |
-
localStorage.setItem(key, value);
|
161 |
-
}
|
162 |
-
},
|
163 |
-
isAlive : function(key, maxLifetime) {
|
164 |
-
if ( typeof maxLifetime === 'undefined' ) {
|
165 |
-
maxLifetime = 86400;
|
166 |
-
}
|
167 |
-
const keyTimestamp = this.get(key, 'timestamp');
|
168 |
-
return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);
|
169 |
-
},
|
170 |
-
isSet : function(key) {
|
171 |
-
return localStorage.getItem(key) !== null;
|
172 |
-
},
|
173 |
-
delete : function (key) {
|
174 |
-
localStorage.removeItem(key);
|
175 |
-
},
|
176 |
-
getCleanTalkData : function () {
|
177 |
-
let data = {}
|
178 |
-
for(let i=0; i<localStorage.length; i++) {
|
179 |
-
let key = localStorage.key(i);
|
180 |
-
if (key.indexOf('ct_') !==-1 || key.indexOf('apbct_') !==-1){
|
181 |
-
data[key.toString()] = apbctLocalStorage.get(key)
|
182 |
-
}
|
183 |
-
}
|
184 |
-
return data
|
185 |
-
},
|
186 |
-
|
187 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/apbct-public--2--public.js
DELETED
@@ -1,789 +0,0 @@
|
|
1 |
-
var ct_date = new Date(),
|
2 |
-
ctTimeMs = new Date().getTime(),
|
3 |
-
ctMouseEventTimerFlag = true, //Reading interval flag
|
4 |
-
ctMouseData = [],
|
5 |
-
ctMouseDataCounter = 0,
|
6 |
-
ctCheckedEmails = {};
|
7 |
-
|
8 |
-
function apbct_attach_event_handler(elem, event, callback){
|
9 |
-
if(typeof window.addEventListener === "function") elem.addEventListener(event, callback);
|
10 |
-
else elem.attachEvent(event, callback);
|
11 |
-
}
|
12 |
-
|
13 |
-
function apbct_remove_event_handler(elem, event, callback){
|
14 |
-
if(typeof window.removeEventListener === "function") elem.removeEventListener(event, callback);
|
15 |
-
else elem.detachEvent(event, callback);
|
16 |
-
}
|
17 |
-
|
18 |
-
//Writing first key press timestamp
|
19 |
-
var ctFunctionFirstKey = function output(event){
|
20 |
-
var KeyTimestamp = Math.floor(new Date().getTime()/1000);
|
21 |
-
ctSetCookie("ct_fkp_timestamp", KeyTimestamp);
|
22 |
-
ctKeyStopStopListening();
|
23 |
-
};
|
24 |
-
|
25 |
-
//Reading interval
|
26 |
-
var ctMouseReadInterval = setInterval(function(){
|
27 |
-
ctMouseEventTimerFlag = true;
|
28 |
-
}, 150);
|
29 |
-
|
30 |
-
//Writting interval
|
31 |
-
var ctMouseWriteDataInterval = setInterval(function(){
|
32 |
-
ctSetCookie("ct_pointer_data", JSON.stringify(ctMouseData));
|
33 |
-
}, 1200);
|
34 |
-
|
35 |
-
//Logging mouse position each 150 ms
|
36 |
-
var ctFunctionMouseMove = function output(event){
|
37 |
-
ctSetMouseMoved();
|
38 |
-
if(ctMouseEventTimerFlag === true){
|
39 |
-
|
40 |
-
ctMouseData.push([
|
41 |
-
Math.round(event.clientY),
|
42 |
-
Math.round(event.clientX),
|
43 |
-
Math.round(new Date().getTime() - ctTimeMs)
|
44 |
-
]);
|
45 |
-
|
46 |
-
ctMouseDataCounter++;
|
47 |
-
ctMouseEventTimerFlag = false;
|
48 |
-
if(ctMouseDataCounter >= 50){
|
49 |
-
ctMouseStopData();
|
50 |
-
}
|
51 |
-
}
|
52 |
-
};
|
53 |
-
|
54 |
-
//Stop mouse observing function
|
55 |
-
function ctMouseStopData(){
|
56 |
-
apbct_remove_event_handler(window, "mousemove", ctFunctionMouseMove);
|
57 |
-
clearInterval(ctMouseReadInterval);
|
58 |
-
clearInterval(ctMouseWriteDataInterval);
|
59 |
-
}
|
60 |
-
|
61 |
-
//Stop key listening function
|
62 |
-
function ctKeyStopStopListening(){
|
63 |
-
apbct_remove_event_handler(window, "mousedown", ctFunctionFirstKey);
|
64 |
-
apbct_remove_event_handler(window, "keydown", ctFunctionFirstKey);
|
65 |
-
}
|
66 |
-
|
67 |
-
function checkEmail(e) {
|
68 |
-
var current_email = e.target.value;
|
69 |
-
if (current_email && !(current_email in ctCheckedEmails)) {
|
70 |
-
// Using REST API handler
|
71 |
-
if( ctPublicFunctions.data__ajax_type === 'rest' ){
|
72 |
-
apbct_public_sendREST(
|
73 |
-
'check_email_before_post',
|
74 |
-
{
|
75 |
-
method: 'POST',
|
76 |
-
data: {'email' : current_email},
|
77 |
-
callback: function (result) {
|
78 |
-
if (result.result) {
|
79 |
-
ctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};
|
80 |
-
ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));
|
81 |
-
}
|
82 |
-
},
|
83 |
-
}
|
84 |
-
);
|
85 |
-
// Using AJAX request and handler
|
86 |
-
} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {
|
87 |
-
apbct_public_sendAJAX(
|
88 |
-
{
|
89 |
-
action: 'apbct_email_check_before_post',
|
90 |
-
email : current_email,
|
91 |
-
},
|
92 |
-
{
|
93 |
-
callback: function (result) {
|
94 |
-
if (result.result) {
|
95 |
-
ctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};
|
96 |
-
ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));
|
97 |
-
}
|
98 |
-
},
|
99 |
-
}
|
100 |
-
);
|
101 |
-
}
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
function ctSetPixelImg(pixelUrl) {
|
106 |
-
ctSetCookie('apbct_pixel_url', pixelUrl);
|
107 |
-
if( +ctPublic.pixel__enabled ){
|
108 |
-
if( ! document.getElementById('apbct_pixel') ) {
|
109 |
-
let insertedImg = document.createElement('img');
|
110 |
-
insertedImg.setAttribute('alt', 'CleanTalk Pixel');
|
111 |
-
insertedImg.setAttribute('id', 'apbct_pixel');
|
112 |
-
insertedImg.setAttribute('style', 'display: none; left: 99999px;');
|
113 |
-
insertedImg.setAttribute('src', pixelUrl);
|
114 |
-
apbct('body').append(insertedImg);
|
115 |
-
}
|
116 |
-
}
|
117 |
-
}
|
118 |
-
|
119 |
-
function ctGetPixelUrl() {
|
120 |
-
// Check if pixel is already in localstorage and is not outdated
|
121 |
-
let local_storage_pixel_url = apbctLocalStorage.get('apbct_pixel_url');
|
122 |
-
if ( local_storage_pixel_url !== false ) {
|
123 |
-
if ( apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {
|
124 |
-
apbctLocalStorage.delete('apbct_pixel_url')
|
125 |
-
} else {
|
126 |
-
//if so - load pixel from localstorage and draw it skipping AJAX
|
127 |
-
ctSetPixelImg(local_storage_pixel_url);
|
128 |
-
return;
|
129 |
-
}
|
130 |
-
}
|
131 |
-
// Using REST API handler
|
132 |
-
if( ctPublicFunctions.data__ajax_type === 'rest' ){
|
133 |
-
apbct_public_sendREST(
|
134 |
-
'apbct_get_pixel_url',
|
135 |
-
{
|
136 |
-
method: 'POST',
|
137 |
-
callback: function (result) {
|
138 |
-
if (result) {
|
139 |
-
//set pixel url to localstorage
|
140 |
-
if ( ! apbctLocalStorage.get('apbct_pixel_url') ){
|
141 |
-
//set pixel to the storage
|
142 |
-
apbctLocalStorage.set('apbct_pixel_url', result)
|
143 |
-
//update pixel data in the hidden fields
|
144 |
-
ctNoCookieAttachHiddenFieldsToForms()
|
145 |
-
}
|
146 |
-
//then run pixel drawing
|
147 |
-
ctSetPixelImg(result);
|
148 |
-
}
|
149 |
-
},
|
150 |
-
}
|
151 |
-
);
|
152 |
-
// Using AJAX request and handler
|
153 |
-
}else{
|
154 |
-
apbct_public_sendAJAX(
|
155 |
-
{
|
156 |
-
action: 'apbct_get_pixel_url',
|
157 |
-
},
|
158 |
-
{
|
159 |
-
notJson: true,
|
160 |
-
callback: function (result) {
|
161 |
-
if (result) {
|
162 |
-
//set pixel url to localstorage
|
163 |
-
if ( ! apbctLocalStorage.get('apbct_pixel_url') ){
|
164 |
-
//set pixel to the storage
|
165 |
-
apbctLocalStorage.set('apbct_pixel_url', result)
|
166 |
-
//update pixel data in the hidden fields
|
167 |
-
ctNoCookieAttachHiddenFieldsToForms()
|
168 |
-
}
|
169 |
-
//then run pixel drawing
|
170 |
-
ctSetPixelImg(result);
|
171 |
-
}
|
172 |
-
},
|
173 |
-
}
|
174 |
-
);
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
function ctSetHasScrolled() {
|
179 |
-
if( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {
|
180 |
-
ctSetCookie("ct_has_scrolled", 'true');
|
181 |
-
apbctLocalStorage.set('ct_has_scrolled', true);
|
182 |
-
}
|
183 |
-
}
|
184 |
-
|
185 |
-
function ctSetMouseMoved() {
|
186 |
-
if( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {
|
187 |
-
ctSetCookie("ct_mouse_moved", 'true');
|
188 |
-
apbctLocalStorage.set('ct_mouse_moved', true);
|
189 |
-
}
|
190 |
-
}
|
191 |
-
|
192 |
-
function ctPreloadLocalStorage(){
|
193 |
-
if (ctPublic.data__to_local_storage){
|
194 |
-
let data = Object.entries(ctPublic.data__to_local_storage)
|
195 |
-
data.forEach(([key, value]) => {
|
196 |
-
apbctLocalStorage.set(key,value)
|
197 |
-
});
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
apbct_attach_event_handler(window, "mousemove", ctFunctionMouseMove);
|
202 |
-
apbct_attach_event_handler(window, "mousedown", ctFunctionFirstKey);
|
203 |
-
apbct_attach_event_handler(window, "keydown", ctFunctionFirstKey);
|
204 |
-
apbct_attach_event_handler(window, "scroll", ctSetHasScrolled);
|
205 |
-
|
206 |
-
// Ready function
|
207 |
-
function apbct_ready(){
|
208 |
-
|
209 |
-
ctPreloadLocalStorage()
|
210 |
-
|
211 |
-
let cookiesType = apbctLocalStorage.get('ct_cookies_type');
|
212 |
-
if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {
|
213 |
-
apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);
|
214 |
-
apbctLocalStorage.delete('ct_mouse_moved');
|
215 |
-
apbctLocalStorage.delete('ct_has_scrolled');
|
216 |
-
}
|
217 |
-
|
218 |
-
// Collect scrolling info
|
219 |
-
var initCookies = [
|
220 |
-
["ct_ps_timestamp", Math.floor(new Date().getTime() / 1000)],
|
221 |
-
["ct_fkp_timestamp", "0"],
|
222 |
-
["ct_pointer_data", "0"],
|
223 |
-
["ct_timezone", ct_date.getTimezoneOffset()/60*(-1) ],
|
224 |
-
["ct_screen_info", apbctGetScreenInfo()],
|
225 |
-
["apbct_headless", navigator.webdriver],
|
226 |
-
];
|
227 |
-
|
228 |
-
apbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));
|
229 |
-
apbctLocalStorage.set('ct_fkp_timestamp', "0");
|
230 |
-
apbctLocalStorage.set('ct_pointer_data', "0");
|
231 |
-
apbctLocalStorage.set('ct_timezone', ct_date.getTimezoneOffset()/60*(-1) );
|
232 |
-
apbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());
|
233 |
-
apbctLocalStorage.set('apbct_headless', navigator.webdriver);
|
234 |
-
|
235 |
-
if( ctPublic.data__cookies_type !== 'native' ) {
|
236 |
-
initCookies.push(['apbct_visible_fields', '0']);
|
237 |
-
} else {
|
238 |
-
// Delete all visible fields cookies on load the page
|
239 |
-
var cookiesArray = document.cookie.split(";");
|
240 |
-
if( cookiesArray.length !== 0 ) {
|
241 |
-
for ( var i = 0; i < cookiesArray.length; i++ ) {
|
242 |
-
var currentCookie = cookiesArray[i].trim();
|
243 |
-
var cookieName = currentCookie.split("=")[0];
|
244 |
-
if( cookieName.indexOf("apbct_visible_fields_") === 0 ) {
|
245 |
-
ctDeleteCookie(cookieName);
|
246 |
-
}
|
247 |
-
}
|
248 |
-
}
|
249 |
-
}
|
250 |
-
|
251 |
-
if( +ctPublic.pixel__setting ){
|
252 |
-
if( +ctPublic.pixel__enabled ){
|
253 |
-
ctGetPixelUrl()
|
254 |
-
} else {
|
255 |
-
initCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);
|
256 |
-
}
|
257 |
-
}
|
258 |
-
|
259 |
-
if ( +ctPublic.data__email_check_before_post) {
|
260 |
-
initCookies.push(['ct_checked_emails', '0']);
|
261 |
-
apbct("input[type = 'email'], #email").on('blur', checkEmail);
|
262 |
-
}
|
263 |
-
|
264 |
-
if (apbctLocalStorage.isSet('ct_checkjs')) {
|
265 |
-
initCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);
|
266 |
-
} else {
|
267 |
-
initCookies.push(['ct_checkjs', 0]);
|
268 |
-
}
|
269 |
-
|
270 |
-
ctSetCookie(initCookies);
|
271 |
-
|
272 |
-
setTimeout(function(){
|
273 |
-
|
274 |
-
ctNoCookieAttachHiddenFieldsToForms()
|
275 |
-
|
276 |
-
for(var i = 0; i < document.forms.length; i++){
|
277 |
-
var form = document.forms[i];
|
278 |
-
|
279 |
-
//Exclusion for forms
|
280 |
-
if (
|
281 |
-
+ctPublic.data__visible_fields_required === 0 ||
|
282 |
-
form.method.toString().toLowerCase() === 'get' ||
|
283 |
-
form.classList.contains('slp_search_form') || //StoreLocatorPlus form
|
284 |
-
form.parentElement.classList.contains('mec-booking') ||
|
285 |
-
form.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign
|
286 |
-
(form.id && form.id === 'caspioform') || //Caspio Form
|
287 |
-
(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm
|
288 |
-
(form.classList && form.classList.contains('give-form')) || // GiveWP
|
289 |
-
(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password
|
290 |
-
(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm
|
291 |
-
(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat
|
292 |
-
(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form
|
293 |
-
(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form
|
294 |
-
form.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form
|
295 |
-
(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar
|
296 |
-
) {
|
297 |
-
continue;
|
298 |
-
}
|
299 |
-
|
300 |
-
var hiddenInput = document.createElement( 'input' );
|
301 |
-
hiddenInput.setAttribute( 'type', 'hidden' );
|
302 |
-
hiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );
|
303 |
-
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
|
304 |
-
var visibleFieldsToInput = {};
|
305 |
-
visibleFieldsToInput[0] = apbct_collect_visible_fields(form);
|
306 |
-
hiddenInput.value = JSON.stringify(visibleFieldsToInput);
|
307 |
-
form.append( hiddenInput );
|
308 |
-
|
309 |
-
form.onsubmit_prev = form.onsubmit;
|
310 |
-
|
311 |
-
form.ctFormIndex = i;
|
312 |
-
form.onsubmit = function (event) {
|
313 |
-
|
314 |
-
if ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {
|
315 |
-
|
316 |
-
var visible_fields = {};
|
317 |
-
visible_fields[0] = apbct_collect_visible_fields(this);
|
318 |
-
console.log("visible_fields[0]" + visible_fields[0])
|
319 |
-
apbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );
|
320 |
-
}
|
321 |
-
|
322 |
-
// Call previous submit action
|
323 |
-
if (event.target.onsubmit_prev instanceof Function) {
|
324 |
-
setTimeout(function () {
|
325 |
-
event.target.onsubmit_prev.call(event.target, event);
|
326 |
-
}, 500);
|
327 |
-
}
|
328 |
-
};
|
329 |
-
}
|
330 |
-
|
331 |
-
}, 1000);
|
332 |
-
|
333 |
-
// Listen clicks on encoded emails
|
334 |
-
let decodedEmailNodes = document.querySelectorAll("[data-original-string]");
|
335 |
-
if (decodedEmailNodes.length) {
|
336 |
-
for (let i = 0; i < decodedEmailNodes.length; ++i) {
|
337 |
-
if (
|
338 |
-
decodedEmailNodes[i].parentElement.href ||
|
339 |
-
decodedEmailNodes[i].parentElement.parentElement.href
|
340 |
-
) {
|
341 |
-
// Skip listening click on hyperlinks
|
342 |
-
continue;
|
343 |
-
}
|
344 |
-
decodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);
|
345 |
-
}
|
346 |
-
}
|
347 |
-
}
|
348 |
-
apbct_attach_event_handler(window, "DOMContentLoaded", apbct_ready);
|
349 |
-
|
350 |
-
function ctFillDecodedEmailHandler(event) {
|
351 |
-
this.removeEventListener('click', ctFillDecodedEmailHandler);
|
352 |
-
apbctAjaxEmailDecode(event, this);
|
353 |
-
}
|
354 |
-
|
355 |
-
function apbctAjaxEmailDecode(event, baseElement){
|
356 |
-
const element = event.target;
|
357 |
-
const javascriptClientData = getJavascriptClientData();
|
358 |
-
let data = {
|
359 |
-
event_javascript_data: javascriptClientData,
|
360 |
-
post_url: document.location.href,
|
361 |
-
referrer: document.referrer,
|
362 |
-
};
|
363 |
-
|
364 |
-
if (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {
|
365 |
-
event.preventDefault();
|
366 |
-
} else {
|
367 |
-
element.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);
|
368 |
-
element.style.cursor = 'progress';
|
369 |
-
|
370 |
-
// Adding a tooltip
|
371 |
-
let apbctTooltip = document.createElement('div');
|
372 |
-
apbctTooltip.setAttribute('class', 'apbct-tooltip');
|
373 |
-
let apbctTooltipText = document.createElement('div');
|
374 |
-
apbctTooltipText.setAttribute('class', 'apbct-tooltip--text');
|
375 |
-
let apbctTooltipArrow = document.createElement('div');
|
376 |
-
apbctTooltipArrow.setAttribute('class', 'apbct-tooltip--arrow');
|
377 |
-
apbct(element).append(apbctTooltip);
|
378 |
-
apbct(apbctTooltip).append(apbctTooltipText);
|
379 |
-
apbct(apbctTooltip).append(apbctTooltipArrow);
|
380 |
-
ctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);
|
381 |
-
}
|
382 |
-
|
383 |
-
let encodedEmail = event.target.dataset.originalString;
|
384 |
-
|
385 |
-
if (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {
|
386 |
-
encodedEmail = baseElement.dataset.originalString;
|
387 |
-
}
|
388 |
-
|
389 |
-
data.encodedEmail = encodedEmail;
|
390 |
-
|
391 |
-
// Using REST API handler
|
392 |
-
if( ctPublicFunctions.data__ajax_type === 'rest' ){
|
393 |
-
apbct_public_sendREST(
|
394 |
-
'apbct_decode_email',
|
395 |
-
{
|
396 |
-
data: data,
|
397 |
-
method: 'POST',
|
398 |
-
callback: function (result) {
|
399 |
-
if (result.success) {
|
400 |
-
if (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {
|
401 |
-
let encodedEmail = baseElement.href.replace('mailto:', '');
|
402 |
-
let baseElementContent = baseElement.innerHTML;
|
403 |
-
baseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);
|
404 |
-
baseElement.href = 'mailto:' + result.data.decoded_email;
|
405 |
-
baseElement.click();
|
406 |
-
} else {
|
407 |
-
setTimeout(function(){
|
408 |
-
ctProcessDecodedDataResult(result.data, event.target);
|
409 |
-
}, 3000);
|
410 |
-
}
|
411 |
-
}
|
412 |
-
setTimeout(function () {
|
413 |
-
apbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);
|
414 |
-
}, 4000);
|
415 |
-
},
|
416 |
-
onErrorCallback: function (res) {
|
417 |
-
element.addEventListener('click', ctFillDecodedEmailHandler);
|
418 |
-
element.removeAttribute('style');
|
419 |
-
ctShowDecodeComment(element, 'Error occurred: ' + res);
|
420 |
-
},
|
421 |
-
}
|
422 |
-
);
|
423 |
-
|
424 |
-
// Using AJAX request and handler
|
425 |
-
}else{
|
426 |
-
data.action = 'apbct_decode_email';
|
427 |
-
apbct_public_sendAJAX(
|
428 |
-
data,
|
429 |
-
{
|
430 |
-
notJson: true,
|
431 |
-
callback: function (result) {
|
432 |
-
if (result.success) {
|
433 |
-
if (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {
|
434 |
-
let encodedEmail = baseElement.href.replace('mailto:', '');
|
435 |
-
let baseElementContent = baseElement.innerHTML;
|
436 |
-
baseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);
|
437 |
-
baseElement.href = 'mailto:' + result.data.decoded_email;
|
438 |
-
baseElement.click();
|
439 |
-
} else {
|
440 |
-
setTimeout(function(){
|
441 |
-
ctProcessDecodedDataResult(result.data, event.target);
|
442 |
-
}, 3000);
|
443 |
-
}
|
444 |
-
}
|
445 |
-
setTimeout(function () {
|
446 |
-
apbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);
|
447 |
-
}, 4000);
|
448 |
-
},
|
449 |
-
onErrorCallback: function (res) {
|
450 |
-
element.addEventListener('click', ctFillDecodedEmailHandler);
|
451 |
-
element.removeAttribute('style');
|
452 |
-
ctShowDecodeComment(element, 'Error occurred: ' + res);
|
453 |
-
},
|
454 |
-
}
|
455 |
-
);
|
456 |
-
}
|
457 |
-
}
|
458 |
-
|
459 |
-
function getJavascriptClientData(common_cookies = []) {
|
460 |
-
let resultDataJson = {};
|
461 |
-
|
462 |
-
resultDataJson.apbct_headless = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');
|
463 |
-
resultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');
|
464 |
-
resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');
|
465 |
-
resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');
|
466 |
-
resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');
|
467 |
-
resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');
|
468 |
-
resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');
|
469 |
-
resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');
|
470 |
-
resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');
|
471 |
-
|
472 |
-
// collecting data from localstorage
|
473 |
-
const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');
|
474 |
-
const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');
|
475 |
-
const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');
|
476 |
-
|
477 |
-
// collecting data from cookies
|
478 |
-
const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');
|
479 |
-
const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');
|
480 |
-
const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');
|
481 |
-
|
482 |
-
resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;
|
483 |
-
resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;
|
484 |
-
resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;
|
485 |
-
|
486 |
-
if (
|
487 |
-
typeof (common_cookies) === "object"
|
488 |
-
&& common_cookies !== []
|
489 |
-
){
|
490 |
-
for (let i = 0; i < common_cookies.length; ++i){
|
491 |
-
if ( typeof (common_cookies[i][1]) === "object" ){
|
492 |
-
//this is for handle SFW cookies
|
493 |
-
resultDataJson[common_cookies[i][1][0]] = common_cookies[i][1][1]
|
494 |
-
} else {
|
495 |
-
resultDataJson[common_cookies[i][0]] = common_cookies[i][1]
|
496 |
-
}
|
497 |
-
}
|
498 |
-
} else {
|
499 |
-
console.log('APBCT JS ERROR: Collecting data type mismatch')
|
500 |
-
}
|
501 |
-
|
502 |
-
// Parse JSON properties to prevent double JSON encoding
|
503 |
-
resultDataJson = removeDoubleJsonEncoding(resultDataJson);
|
504 |
-
|
505 |
-
return JSON.stringify(resultDataJson);
|
506 |
-
}
|
507 |
-
|
508 |
-
/**
|
509 |
-
* Recursive
|
510 |
-
*
|
511 |
-
* Recursively decode JSON-encoded properties
|
512 |
-
*
|
513 |
-
* @param object
|
514 |
-
* @returns {*}
|
515 |
-
*/
|
516 |
-
function removeDoubleJsonEncoding(object){
|
517 |
-
|
518 |
-
if( typeof object === 'object'){
|
519 |
-
|
520 |
-
for (let objectKey in object) {
|
521 |
-
|
522 |
-
// Recursion
|
523 |
-
if( typeof object[objectKey] === 'object'){
|
524 |
-
object[objectKey] = removeDoubleJsonEncoding(object[objectKey]);
|
525 |
-
}
|
526 |
-
|
527 |
-
// Common case (out)
|
528 |
-
if(
|
529 |
-
typeof object[objectKey] === 'string' &&
|
530 |
-
object[objectKey].match(/^[\[{].*?[\]}]$/) !== null // is like JSON
|
531 |
-
){
|
532 |
-
let parsedValue = JSON.parse(object[objectKey]);
|
533 |
-
if( typeof parsedValue === 'object' ){
|
534 |
-
object[objectKey] = parsedValue;
|
535 |
-
}
|
536 |
-
}
|
537 |
-
}
|
538 |
-
}
|
539 |
-
|
540 |
-
return object;
|
541 |
-
}
|
542 |
-
|
543 |
-
function ctProcessDecodedDataResult(response, targetElement) {
|
544 |
-
|
545 |
-
targetElement.setAttribute('title', '');
|
546 |
-
targetElement.removeAttribute('style');
|
547 |
-
|
548 |
-
if( !! response.is_allowed) {
|
549 |
-
ctFillDecodedEmail(targetElement, response.decoded_email);
|
550 |
-
}
|
551 |
-
|
552 |
-
if( !! response.show_comment ){
|
553 |
-
ctShowDecodeComment(targetElement, response.comment);
|
554 |
-
}
|
555 |
-
}
|
556 |
-
|
557 |
-
function ctFillDecodedEmail(target, email){
|
558 |
-
apbct(target).html(
|
559 |
-
apbct(target)
|
560 |
-
.html()
|
561 |
-
.replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/, email + "$1")
|
562 |
-
);
|
563 |
-
}
|
564 |
-
|
565 |
-
function ctShowDecodeComment(target, comment){
|
566 |
-
|
567 |
-
if( ! comment ){
|
568 |
-
return;
|
569 |
-
}
|
570 |
-
|
571 |
-
apbct(target.getElementsByClassName('apbct-tooltip')).fadeIn(300);
|
572 |
-
apbct(target.getElementsByClassName('apbct-tooltip--text')).html(comment);
|
573 |
-
setTimeout(function(){
|
574 |
-
apbct(target.getElementsByClassName('apbct-tooltip')).fadeOut(700);
|
575 |
-
}, 5000);
|
576 |
-
}
|
577 |
-
|
578 |
-
function apbct_collect_visible_fields( form ) {
|
579 |
-
|
580 |
-
// Get only fields
|
581 |
-
var inputs = [],
|
582 |
-
inputs_visible = '',
|
583 |
-
inputs_visible_count = 0,
|
584 |
-
inputs_invisible = '',
|
585 |
-
inputs_invisible_count = 0,
|
586 |
-
inputs_with_duplicate_names = [];
|
587 |
-
|
588 |
-
for(var key in form.elements){
|
589 |
-
if(!isNaN(+key))
|
590 |
-
inputs[key] = form.elements[key];
|
591 |
-
}
|
592 |
-
|
593 |
-
// Filter fields
|
594 |
-
inputs = inputs.filter(function(elem){
|
595 |
-
|
596 |
-
// Filter already added fields
|
597 |
-
if( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){
|
598 |
-
return false;
|
599 |
-
}
|
600 |
-
// Filter inputs with same names for type == radio
|
601 |
-
if( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute("type") )){
|
602 |
-
inputs_with_duplicate_names.push( elem.getAttribute('name') );
|
603 |
-
return false;
|
604 |
-
}
|
605 |
-
return true;
|
606 |
-
});
|
607 |
-
|
608 |
-
// Visible fields
|
609 |
-
inputs.forEach(function(elem, i, elements){
|
610 |
-
// Unnecessary fields
|
611 |
-
if(
|
612 |
-
elem.getAttribute("type") === "submit" || // type == submit
|
613 |
-
elem.getAttribute('name') === null ||
|
614 |
-
elem.getAttribute('name') === 'ct_checkjs'
|
615 |
-
) {
|
616 |
-
return;
|
617 |
-
}
|
618 |
-
// Invisible fields
|
619 |
-
if(
|
620 |
-
getComputedStyle(elem).display === "none" || // hidden
|
621 |
-
getComputedStyle(elem).visibility === "hidden" || // hidden
|
622 |
-
getComputedStyle(elem).opacity === "0" || // hidden
|
623 |
-
elem.getAttribute("type") === "hidden" // type == hidden
|
624 |
-
) {
|
625 |
-
if( elem.classList.contains("wp-editor-area") ) {
|
626 |
-
inputs_visible += " " + elem.getAttribute("name");
|
627 |
-
inputs_visible_count++;
|
628 |
-
} else {
|
629 |
-
inputs_invisible += " " + elem.getAttribute("name");
|
630 |
-
inputs_invisible_count++;
|
631 |
-
}
|
632 |
-
}
|
633 |
-
// Visible fields
|
634 |
-
else {
|
635 |
-
inputs_visible += " " + elem.getAttribute("name");
|
636 |
-
inputs_visible_count++;
|
637 |
-
}
|
638 |
-
|
639 |
-
});
|
640 |
-
|
641 |
-
inputs_invisible = inputs_invisible.trim();
|
642 |
-
inputs_visible = inputs_visible.trim();
|
643 |
-
|
644 |
-
return {
|
645 |
-
visible_fields : inputs_visible,
|
646 |
-
visible_fields_count : inputs_visible_count,
|
647 |
-
invisible_fields : inputs_invisible,
|
648 |
-
invisible_fields_count : inputs_invisible_count,
|
649 |
-
}
|
650 |
-
|
651 |
-
}
|
652 |
-
|
653 |
-
function apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {
|
654 |
-
|
655 |
-
var collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};
|
656 |
-
|
657 |
-
if( ctPublic.data__cookies_type === 'native' ) {
|
658 |
-
for ( var i in collection ) {
|
659 |
-
if ( i > 10 ) {
|
660 |
-
// Do not generate more than 10 cookies
|
661 |
-
return;
|
662 |
-
}
|
663 |
-
var collectionIndex = form_id !== undefined ? form_id : i;
|
664 |
-
ctSetCookie("apbct_visible_fields_" + collectionIndex, JSON.stringify( collection[i] ) );
|
665 |
-
}
|
666 |
-
} else {
|
667 |
-
if (ctPublic.data__cookies_type === 'none'){
|
668 |
-
ctSetCookie("apbct_visible_fields", JSON.stringify( collection[0] ) );
|
669 |
-
} else {
|
670 |
-
ctSetCookie("apbct_visible_fields", JSON.stringify( collection ) );
|
671 |
-
}
|
672 |
-
|
673 |
-
}
|
674 |
-
}
|
675 |
-
|
676 |
-
function apbct_js_keys__set_input_value(result, data, params, obj){
|
677 |
-
if( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {
|
678 |
-
var elements = document.querySelectorAll('[name^=ct_checkjs]');
|
679 |
-
for ( var i = 0; i < elements.length; i++ ) {
|
680 |
-
elements[i].value = result.js_key;
|
681 |
-
}
|
682 |
-
}
|
683 |
-
}
|
684 |
-
|
685 |
-
function apbctGetScreenInfo() {
|
686 |
-
return JSON.stringify({
|
687 |
-
fullWidth : document.documentElement.scrollWidth,
|
688 |
-
fullHeight : Math.max(
|
689 |
-
document.body.scrollHeight, document.documentElement.scrollHeight,
|
690 |
-
document.body.offsetHeight, document.documentElement.offsetHeight,
|
691 |
-
document.body.clientHeight, document.documentElement.clientHeight
|
692 |
-
),
|
693 |
-
visibleWidth : document.documentElement.clientWidth,
|
694 |
-
visibleHeight : document.documentElement.clientHeight,
|
695 |
-
});
|
696 |
-
}
|
697 |
-
|
698 |
-
if(typeof jQuery !== 'undefined') {
|
699 |
-
|
700 |
-
// Capturing responses and output block message for unknown AJAX forms
|
701 |
-
jQuery(document).ajaxComplete(function (event, xhr, settings) {
|
702 |
-
if (xhr.responseText && xhr.responseText.indexOf('"apbct') !== -1) {
|
703 |
-
try {
|
704 |
-
var response = JSON.parse(responseText);
|
705 |
-
} catch (e) {
|
706 |
-
console.log(e.toString());
|
707 |
-
return;
|
708 |
-
}
|
709 |
-
ctParseBlockMessage(response);
|
710 |
-
}
|
711 |
-
});
|
712 |
-
}
|
713 |
-
|
714 |
-
function ctParseBlockMessage(response) {
|
715 |
-
|
716 |
-
if (typeof response.apbct !== 'undefined') {
|
717 |
-
response = response.apbct;
|
718 |
-
if (response.blocked) {
|
719 |
-
document.dispatchEvent(
|
720 |
-
new CustomEvent( "apbctAjaxBockAlert", {
|
721 |
-
bubbles: true,
|
722 |
-
detail: { message: response.comment }
|
723 |
-
} )
|
724 |
-
);
|
725 |
-
|
726 |
-
// Show the result by modal
|
727 |
-
cleantalkModal.loaded = response.comment;
|
728 |
-
cleantalkModal.open();
|
729 |
-
|
730 |
-
if(+response.stop_script == 1)
|
731 |
-
window.stop();
|
732 |
-
}
|
733 |
-
}
|
734 |
-
}
|
735 |
-
|
736 |
-
function ctSetPixelUrlLocalstorage(ajax_pixel_url) {
|
737 |
-
//set pixel to the storage
|
738 |
-
ctSetCookie('apbct_pixel_url', ajax_pixel_url)
|
739 |
-
}
|
740 |
-
|
741 |
-
function ctNoCookieConstructHiddenField(){
|
742 |
-
let field = ''
|
743 |
-
let no_cookie_data = apbctLocalStorage.getCleanTalkData()
|
744 |
-
no_cookie_data = JSON.stringify(no_cookie_data)
|
745 |
-
no_cookie_data = btoa(no_cookie_data)
|
746 |
-
field = document.createElement('input')
|
747 |
-
field.setAttribute('id','ct_no_cookie_hidden_field')
|
748 |
-
field.setAttribute('name','ct_no_cookie_hidden_field')
|
749 |
-
field.setAttribute('value', no_cookie_data)
|
750 |
-
field.setAttribute('type', 'hidden')
|
751 |
-
return field
|
752 |
-
}
|
753 |
-
|
754 |
-
function ctNoCookieGetForms(){
|
755 |
-
let forms = document.forms
|
756 |
-
if (forms) {
|
757 |
-
return forms
|
758 |
-
}
|
759 |
-
return false
|
760 |
-
}
|
761 |
-
|
762 |
-
function ctNoCookieAttachHiddenFieldsToForms(){
|
763 |
-
|
764 |
-
if (ctPublic.data__cookies_type !== 'none'){
|
765 |
-
return
|
766 |
-
}
|
767 |
-
|
768 |
-
let forms = ctNoCookieGetForms()
|
769 |
-
|
770 |
-
if (forms){
|
771 |
-
for ( let i = 0; i < forms.length; i++ ){
|
772 |
-
//ignore forms with get method @todo We need to think about this
|
773 |
-
if (document.forms[i].getAttribute('method') === null ||
|
774 |
-
document.forms[i].getAttribute('method').toLowerCase() === 'post'){
|
775 |
-
|
776 |
-
let elements = document.getElementsByName('ct_no_cookie_hidden_field')
|
777 |
-
//clear previous hidden set
|
778 |
-
if (elements){
|
779 |
-
for (let j = 0; j < elements.length; j++) {
|
780 |
-
elements[j].parentNode.removeCh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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/apbct-public--3--cleantalk-modal.js
DELETED
@@ -1,180 +0,0 @@
|
|
1 |
-
/* Cleantalk Modal object */
|
2 |
-
cleantalkModal = {
|
3 |
-
|
4 |
-
// Flags
|
5 |
-
loaded: false,
|
6 |
-
loading: false,
|
7 |
-
opened: false,
|
8 |
-
opening: false,
|
9 |
-
|
10 |
-
// Methods
|
11 |
-
load: function( action ) {
|
12 |
-
if( ! this.loaded ) {
|
13 |
-
this.loading = true;
|
14 |
-
callback = function( result, data, params, obj ) {
|
15 |
-
cleantalkModal.loading = false;
|
16 |
-
cleantalkModal.loaded = result;
|
17 |
-
document.dispatchEvent(
|
18 |
-
new CustomEvent( "cleantalkModalContentLoaded", {
|
19 |
-
bubbles: true,
|
20 |
-
} )
|
21 |
-
);
|
22 |
-
};
|
23 |
-
if( typeof apbct_admin_sendAJAX === "function" ) {
|
24 |
-
apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );
|
25 |
-
} else {
|
26 |
-
apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );
|
27 |
-
}
|
28 |
-
|
29 |
-
}
|
30 |
-
},
|
31 |
-
|
32 |
-
open: function () {
|
33 |
-
/* Cleantalk Modal CSS start */
|
34 |
-
var renderCss = function () {
|
35 |
-
var cssStr = '';
|
36 |
-
for ( key in this.styles ) {
|
37 |
-
cssStr += key + ':' + this.styles[key] + ';';
|
38 |
-
}
|
39 |
-
return cssStr;
|
40 |
-
};
|
41 |
-
var overlayCss = {
|
42 |
-
styles: {
|
43 |
-
"z-index": "9999",
|
44 |
-
"position": "fixed",
|
45 |
-
"top": "0",
|
46 |
-
"left": "0",
|
47 |
-
"width": "100%",
|
48 |
-
"height": "100%",
|
49 |
-
"background": "rgba(0,0,0,0.5)",
|
50 |
-
"display": "flex",
|
51 |
-
"justify-content" : "center",
|
52 |
-
"align-items" : "center",
|
53 |
-
},
|
54 |
-
toString: renderCss
|
55 |
-
};
|
56 |
-
var innerCss = {
|
57 |
-
styles: {
|
58 |
-
"position" : "relative",
|
59 |
-
"padding" : "30px",
|
60 |
-
"background" : "#FFF",
|
61 |
-
"border" : "1px solid rgba(0,0,0,0.75)",
|
62 |
-
"border-radius" : "4px",
|
63 |
-
"box-shadow" : "7px 7px 5px 0px rgba(50,50,50,0.75)",
|
64 |
-
},
|
65 |
-
toString: renderCss
|
66 |
-
};
|
67 |
-
var closeCss = {
|
68 |
-
styles: {
|
69 |
-
"position" : "absolute",
|
70 |
-
"background" : "#FFF",
|
71 |
-
"width" : "20px",
|
72 |
-
"height" : "20px",
|
73 |
-
"border" : "2px solid rgba(0,0,0,0.75)",
|
74 |
-
"border-radius" : "15px",
|
75 |
-
"cursor" : "pointer",
|
76 |
-
"top" : "-8px",
|
77 |
-
"right" : "-8px",
|
78 |
-
"box-sizing" : "content-box",
|
79 |
-
},
|
80 |
-
toString: renderCss
|
81 |
-
};
|
82 |
-
var closeCssBefore = {
|
83 |
-
styles: {
|
84 |
-
"content" : "\"\"",
|
85 |
-
"display" : "block",
|
86 |
-
"position" : "absolute",
|
87 |
-
"background" : "#000",
|
88 |
-
"border-radius" : "1px",
|
89 |
-
"width" : "2px",
|
90 |
-
"height" : "16px",
|
91 |
-
"top" : "2px",
|
92 |
-
"left" : "9px",
|
93 |
-
"transform" : "rotate(45deg)",
|
94 |
-
},
|
95 |
-
toString: renderCss
|
96 |
-
};
|
97 |
-
var closeCssAfter = {
|
98 |
-
styles: {
|
99 |
-
"content" : "\"\"",
|
100 |
-
"display" : "block",
|
101 |
-
"position" : "absolute",
|
102 |
-
"background" : "#000",
|
103 |
-
"border-radius" : "1px",
|
104 |
-
"width" : "2px",
|
105 |
-
"height" : "16px",
|
106 |
-
"top" : "2px",
|
107 |
-
"left" : "9px",
|
108 |
-
"transform" : "rotate(-45deg)",
|
109 |
-
},
|
110 |
-
toString: renderCss
|
111 |
-
};
|
112 |
-
var bodyCss = {
|
113 |
-
styles: {
|
114 |
-
"overflow" : "hidden",
|
115 |
-
},
|
116 |
-
toString: renderCss
|
117 |
-
};
|
118 |
-
var cleantalkModalStyle = document.createElement( 'style' );
|
119 |
-
cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );
|
120 |
-
cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';
|
121 |
-
cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';
|
122 |
-
cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';
|
123 |
-
cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';
|
124 |
-
cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';
|
125 |
-
document.body.append( cleantalkModalStyle );
|
126 |
-
/* Cleantalk Modal CSS end */
|
127 |
-
|
128 |
-
var overlay = document.createElement( 'div' );
|
129 |
-
overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );
|
130 |
-
document.body.append( overlay );
|
131 |
-
|
132 |
-
document.body.classList.add( 'cleantalk-modal-opened' );
|
133 |
-
|
134 |
-
var inner = document.createElement( 'div' );
|
135 |
-
inner.setAttribute( 'id', 'cleantalk-modal-inner' );
|
136 |
-
inner.setAttribute( 'style', innerCss );
|
137 |
-
overlay.append( inner );
|
138 |
-
|
139 |
-
var close = document.createElement( 'div' );
|
140 |
-
close.setAttribute( 'id', 'cleantalk-modal-close' );
|
141 |
-
inner.append( close );
|
142 |
-
|
143 |
-
var content = document.createElement( 'div' );
|
144 |
-
if ( this.loaded ) {
|
145 |
-
content.innerHTML = this.loaded;
|
146 |
-
} else {
|
147 |
-
content.innerHTML = 'Loading...';
|
148 |
-
// @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.
|
149 |
-
this.load( 'get_options_template' );
|
150 |
-
}
|
151 |
-
content.setAttribute( 'id', 'cleantalk-modal-content' );
|
152 |
-
inner.append( content );
|
153 |
-
|
154 |
-
this.opened = true;
|
155 |
-
},
|
156 |
-
|
157 |
-
close: function () {
|
158 |
-
document.body.classList.remove( 'cleantalk-modal-opened' );
|
159 |
-
document.getElementById( 'cleantalk-modal-overlay' ).remove();
|
160 |
-
document.getElementById( 'cleantalk-modal-styles' ).remove();
|
161 |
-
document.dispatchEvent(
|
162 |
-
new CustomEvent( "cleantalkModalClosed", {
|
163 |
-
bubbles: true,
|
164 |
-
} )
|
165 |
-
);
|
166 |
-
}
|
167 |
-
|
168 |
-
};
|
169 |
-
|
170 |
-
/* Cleantalk Modal helpers */
|
171 |
-
document.addEventListener('click',function( e ){
|
172 |
-
if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){
|
173 |
-
cleantalkModal.close();
|
174 |
-
}
|
175 |
-
});
|
176 |
-
document.addEventListener("cleantalkModalContentLoaded", function( e ) {
|
177 |
-
if( cleantalkModal.opened && cleantalkModal.loaded ) {
|
178 |
-
document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;
|
179 |
-
}
|
180 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/apbct-public--4--gdpr.js
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
let buttons_to_handle = []
|
2 |
-
let gdpr_notice_for_button = 'Please, apply the GDPR agreement.'
|
3 |
-
|
4 |
-
document.addEventListener('DOMContentLoaded', function(){
|
5 |
-
buttons_to_handle = []
|
6 |
-
if(
|
7 |
-
typeof ctPublicGDPR === 'undefined' ||
|
8 |
-
! ctPublicGDPR.gdpr_forms.length
|
9 |
-
) {
|
10 |
-
return;
|
11 |
-
}
|
12 |
-
|
13 |
-
if ( typeof jQuery === 'undefined' ) {
|
14 |
-
return;
|
15 |
-
}
|
16 |
-
try {
|
17 |
-
ctPublicGDPR.gdpr_forms.forEach(function(item, i){
|
18 |
-
|
19 |
-
let elem = jQuery('#'+item+', .'+item);
|
20 |
-
|
21 |
-
// Filter forms
|
22 |
-
if (!elem.is('form')){
|
23 |
-
// Caldera
|
24 |
-
if (elem.find('form')[0])
|
25 |
-
elem = elem.children('form').first();
|
26 |
-
// Contact Form 7
|
27 |
-
else if(
|
28 |
-
jQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]')
|
29 |
-
.attr('id')
|
30 |
-
.indexOf('wpcf7-f'+item) !== -1
|
31 |
-
) {
|
32 |
-
elem = jQuery('.wpcf7[role=form]').children('form');
|
33 |
-
}
|
34 |
-
|
35 |
-
// Formidable
|
36 |
-
else if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)
|
37 |
-
elem = jQuery('.frm_forms').first().children('form');
|
38 |
-
// WPForms
|
39 |
-
else if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)
|
40 |
-
elem = jQuery('.wpforms-form');
|
41 |
-
}
|
42 |
-
|
43 |
-
//disable forms buttons
|
44 |
-
let button = false
|
45 |
-
let buttons_collection= elem.find('input[type|="submit"]')
|
46 |
-
|
47 |
-
if (!buttons_collection.length) {
|
48 |
-
return
|
49 |
-
} else {
|
50 |
-
button = buttons_collection[0]
|
51 |
-
}
|
52 |
-
|
53 |
-
if (button !== false){
|
54 |
-
console.log(buttons_collection)
|
55 |
-
button.disabled = true
|
56 |
-
let old_notice = jQuery(button).prop('title') ? jQuery(button).prop('title') : ''
|
57 |
-
buttons_to_handle.push({index:i,button:button,old_notice:old_notice})
|
58 |
-
jQuery(button).prop('title', gdpr_notice_for_button)
|
59 |
-
}
|
60 |
-
|
61 |
-
// Adding notice and checkbox
|
62 |
-
if(elem.is('form') || elem.attr('role') === 'form'){
|
63 |
-
elem.append('<input id="apbct_gdpr_'+i+'" type="checkbox" required="required" style=" margin-right: 10px;" onchange="apbct_gdpr_handle_buttons()">')
|
64 |
-
.append('<label style="display: inline;" for="apbct_gdpr_'+i+'">'+ctPublicGDPR.gdpr_text+'</label>');
|
65 |
-
}
|
66 |
-
});
|
67 |
-
} catch (e) {
|
68 |
-
console.info('APBCT GDPR JS ERROR: Can not add GDPR notice' + e)
|
69 |
-
}
|
70 |
-
});
|
71 |
-
|
72 |
-
function apbct_gdpr_handle_buttons(){
|
73 |
-
|
74 |
-
try {
|
75 |
-
|
76 |
-
if (buttons_to_handle === []){
|
77 |
-
return
|
78 |
-
}
|
79 |
-
|
80 |
-
buttons_to_handle.forEach((button) => {
|
81 |
-
let selector = '[id="apbct_gdpr_' + button.index + '"]'
|
82 |
-
let apbct_gdpr_item = jQuery(selector)
|
83 |
-
//chek if apbct_gdpr checkbox is set
|
84 |
-
if (jQuery(apbct_gdpr_item).prop("checked")){
|
85 |
-
button.button.disabled = false
|
86 |
-
jQuery(button.button).prop('title', button.old_notice)
|
87 |
-
} else {
|
88 |
-
button.button.disabled = true
|
89 |
-
jQuery(button.button).prop('title', gdpr_notice_for_button)
|
90 |
-
}
|
91 |
-
})
|
92 |
-
} catch (e) {
|
93 |
-
console.info('APBCT GDPR JS ERROR: Can not handle form buttons ' + e)
|
94 |
-
}
|
95 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/apbct-public--5--external-forms.js
DELETED
@@ -1,253 +0,0 @@
|
|
1 |
-
/**
|
2 |
-
* Handle external forms
|
3 |
-
*/
|
4 |
-
function ct_protect_external() {
|
5 |
-
for(var i = 0; i < document.forms.length; i++) {
|
6 |
-
|
7 |
-
if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {
|
8 |
-
|
9 |
-
// current form
|
10 |
-
var currentForm = document.forms[i];
|
11 |
-
|
12 |
-
if (currentForm.parentElement && currentForm.parentElement.classList.length > 0 && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1){
|
13 |
-
return
|
14 |
-
}
|
15 |
-
|
16 |
-
if(typeof(currentForm.action) == 'string') {
|
17 |
-
|
18 |
-
// Ajax checking for the integrated forms
|
19 |
-
if(isIntegratedForm(currentForm)) {
|
20 |
-
|
21 |
-
var cleantalk_placeholder = document.createElement("i");
|
22 |
-
cleantalk_placeholder.className = 'cleantalk_placeholder';
|
23 |
-
cleantalk_placeholder.style = 'display: none';
|
24 |
-
currentForm.parentElement.insertBefore(cleantalk_placeholder, currentForm);
|
25 |
-
|
26 |
-
// Deleting form to prevent submit event
|
27 |
-
var prev = currentForm.previousSibling,
|
28 |
-
form_html = currentForm.outerHTML,
|
29 |
-
form_original = currentForm;
|
30 |
-
|
31 |
-
// Remove the original form
|
32 |
-
currentForm.parentElement.removeChild(currentForm);
|
33 |
-
|
34 |
-
// Insert a clone
|
35 |
-
const placeholder = document.createElement("div");
|
36 |
-
placeholder.innerHTML = form_html;
|
37 |
-
prev.after(placeholder.firstElementChild);
|
38 |
-
|
39 |
-
var force_action = document.createElement("input");
|
40 |
-
force_action.name = 'action';
|
41 |
-
force_action.value = 'cleantalk_force_ajax_check';
|
42 |
-
force_action.type = 'hidden';
|
43 |
-
|
44 |
-
let reUseCurrentForm = document.forms[i];
|
45 |
-
|
46 |
-
reUseCurrentForm.appendChild(force_action);
|
47 |
-
reUseCurrentForm.apbctPrev = prev;
|
48 |
-
reUseCurrentForm.apbctFormOriginal = form_original;
|
49 |
-
|
50 |
-
// mailerlite integration - disable click on submit button
|
51 |
-
let mailerlite_detected_class = false
|
52 |
-
if (reUseCurrentForm.classList !== undefined) {
|
53 |
-
//list there all the mailerlite classes
|
54 |
-
let mailerlite_classes = ['newsletterform', 'ml-block-form']
|
55 |
-
mailerlite_classes.forEach(function(mailerlite_class) {
|
56 |
-
if (reUseCurrentForm.classList.contains(mailerlite_class)){
|
57 |
-
mailerlite_detected_class = mailerlite_class
|
58 |
-
}
|
59 |
-
});
|
60 |
-
}
|
61 |
-
if ( mailerlite_detected_class ) {
|
62 |
-
let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type="submit"]');
|
63 |
-
if ( mailerliteSubmitButton !== undefined ) {
|
64 |
-
mailerliteSubmitButton.click(function (event) {
|
65 |
-
event.preventDefault();
|
66 |
-
sendAjaxCheckingFormData(event.currentTarget);
|
67 |
-
});
|
68 |
-
}
|
69 |
-
} else {
|
70 |
-
document.forms[i].onsubmit = function ( event ){
|
71 |
-
event.preventDefault();
|
72 |
-
|
73 |
-
const prev = jQuery(event.currentTarget).prev();
|
74 |
-
const form_original = jQuery(event.currentTarget).clone();
|
75 |
-
|
76 |
-
sendAjaxCheckingFormData(event.currentTarget);
|
77 |
-
};
|
78 |
-
}
|
79 |
-
|
80 |
-
// Common flow - modify form's action
|
81 |
-
}else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {
|
82 |
-
|
83 |
-
var tmp = currentForm.action.split('//');
|
84 |
-
tmp = tmp[1].split('/');
|
85 |
-
var host = tmp[0].toLowerCase();
|
86 |
-
|
87 |
-
if(host !== location.hostname.toLowerCase()){
|
88 |
-
|
89 |
-
var ct_action = document.createElement("input");
|
90 |
-
ct_action.name = 'cleantalk_hidden_action';
|
91 |
-
ct_action.value = currentForm.action;
|
92 |
-
ct_action.type = 'hidden';
|
93 |
-
currentForm.appendChild(ct_action);
|
94 |
-
|
95 |
-
var ct_method = document.createElement("input");
|
96 |
-
ct_method.name = 'cleantalk_hidden_method';
|
97 |
-
ct_method.value = currentForm.method;
|
98 |
-
ct_method.type = 'hidden';
|
99 |
-
|
100 |
-
currentForm.method = 'POST'
|
101 |
-
|
102 |
-
currentForm.appendChild(ct_method);
|
103 |
-
|
104 |
-
currentForm.action = document.location;
|
105 |
-
}
|
106 |
-
}
|
107 |
-
}
|
108 |
-
}
|
109 |
-
|
110 |
-
}
|
111 |
-
}
|
112 |
-
function apbct_replace_inputs_values_from_other_form( form_source, form_target ){
|
113 |
-
|
114 |
-
var inputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),
|
115 |
-
inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );
|
116 |
-
|
117 |
-
inputs_source.each( function( index, elem_source ){
|
118 |
-
|
119 |
-
var source = jQuery( elem_source );
|
120 |
-
|
121 |
-
inputs_target.each( function( index2, elem_target ){
|
122 |
-
|
123 |
-
var target = jQuery( elem_target );
|
124 |
-
|
125 |
-
if( elem_source.outerHTML === elem_target.outerHTML ){
|
126 |
-
|
127 |
-
target.val( source.val() );
|
128 |
-
}
|
129 |
-
});
|
130 |
-
});
|
131 |
-
|
132 |
-
}
|
133 |
-
window.onload = function () {
|
134 |
-
|
135 |
-
if( ! +ctPublic.settings__forms__check_external ) {
|
136 |
-
return;
|
137 |
-
}
|
138 |
-
|
139 |
-
if ( typeof jQuery === 'undefined' ) {
|
140 |
-
return;
|
141 |
-
}
|
142 |
-
|
143 |
-
setTimeout(function () {
|
144 |
-
ct_protect_external()
|
145 |
-
}, 1500);
|
146 |
-
};
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Checking the form integration
|
150 |
-
*/
|
151 |
-
function isIntegratedForm(formObj) {
|
152 |
-
var formAction = formObj.action;
|
153 |
-
|
154 |
-
if(
|
155 |
-
formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form
|
156 |
-
formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form
|
157 |
-
( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form
|
158 |
-
formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration
|
159 |
-
formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration
|
160 |
-
formAction.indexOf('paypal.com') !== -1 ||
|
161 |
-
formAction.indexOf('infusionsoft.com') !== -1 ||
|
162 |
-
formAction.indexOf('webto.salesforce.com') !== -1 ||
|
163 |
-
formAction.indexOf('secure2.convio.net') !== -1 ||
|
164 |
-
formAction.indexOf('hookb.in') !== -1 ||
|
165 |
-
formAction.indexOf('external.url') !== -1 ||
|
166 |
-
formAction.indexOf('tp.media') !== -1 ||
|
167 |
-
formAction.indexOf('flodesk.com') !== -1 ||
|
168 |
-
formAction.indexOf('sendfox.com') !== -1 ||
|
169 |
-
formAction.indexOf('aweber.com') !== -1 ||
|
170 |
-
formAction.indexOf('secure.payu.com') !== -1
|
171 |
-
|
172 |
-
) {
|
173 |
-
return true;
|
174 |
-
}
|
175 |
-
|
176 |
-
return false;
|
177 |
-
}
|
178 |
-
|
179 |
-
/**
|
180 |
-
* Sending Ajax for checking form data
|
181 |
-
*/
|
182 |
-
function sendAjaxCheckingFormData(form, prev, formOriginal) {
|
183 |
-
// Get visible fields and set cookie
|
184 |
-
var visible_fields = {};
|
185 |
-
visible_fields[0] = apbct_collect_visible_fields(form);
|
186 |
-
apbct_visible_fields_set_cookie( visible_fields );
|
187 |
-
|
188 |
-
var data = {};
|
189 |
-
var elems = form.elements;
|
190 |
-
elems = Array.prototype.slice.call(elems);
|
191 |
-
|
192 |
-
elems.forEach( function( elem, y ) {
|
193 |
-
if( elem.name === '' ) {
|
194 |
-
data['input_' + y] = elem.value;
|
195 |
-
} else {
|
196 |
-
data[elem.name] = elem.value;
|
197 |
-
}
|
198 |
-
});
|
199 |
-
|
200 |
-
apbct_public_sendAJAX(
|
201 |
-
data,
|
202 |
-
{
|
203 |
-
async: false,
|
204 |
-
callback: function( result, data, params, obj ){
|
205 |
-
|
206 |
-
if( result.apbct === undefined || ! +result.apbct.blocked ) {
|
207 |
-
|
208 |
-
let form_new = jQuery(form).detach();
|
209 |
-
let prev = form.apbctPrev;
|
210 |
-
let formOriginal = form.apbctFormOriginal;
|
211 |
-
|
212 |
-
apbct_replace_inputs_values_from_other_form(form_new, formOriginal);
|
213 |
-
|
214 |
-
prev.after( formOriginal );
|
215 |
-
|
216 |
-
// Clear visible_fields input
|
217 |
-
jQuery(formOriginal).find('input[name="apbct_visible_fields"]').remove();
|
218 |
-
jQuery(formOriginal).find('input[value="cleantalk_force_ajax_check"]').remove();
|
219 |
-
|
220 |
-
// Common click event
|
221 |
-
var subm_button = jQuery(formOriginal).find('button[type=submit]');
|
222 |
-
if( subm_button.length !== 0 ) {
|
223 |
-
subm_button[0].click();
|
224 |
-
return;
|
225 |
-
}
|
226 |
-
|
227 |
-
subm_button = jQuery(formOriginal).find('input[type=submit]');
|
228 |
-
if( subm_button.length !== 0 ) {
|
229 |
-
subm_button[0].click();
|
230 |
-
return;
|
231 |
-
}
|
232 |
-
|
233 |
-
// ConvertKit direct integration
|
234 |
-
subm_button = jQuery(formOriginal).find('button[data-element="submit"]');
|
235 |
-
if( subm_button.length !== 0 ) {
|
236 |
-
subm_button[0].click();
|
237 |
-
return;
|
238 |
-
}
|
239 |
-
|
240 |
-
// Paypal integration
|
241 |
-
subm_button = jQuery(formOriginal).find('input[type="image"][name="submit"]');
|
242 |
-
if( subm_button.length !== 0 ) {
|
243 |
-
subm_button[0].click();
|
244 |
-
}
|
245 |
-
|
246 |
-
}
|
247 |
-
if (result.apbct !== undefined && +result.apbct.blocked) {
|
248 |
-
ctParseBlockMessage(result);
|
249 |
-
}
|
250 |
-
}
|
251 |
-
}
|
252 |
-
);
|
253 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/apbct-public--6--internal-forms.js
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
function ct_check_internal(currForm){
|
2 |
-
|
3 |
-
//Gathering data
|
4 |
-
var ct_data = {},
|
5 |
-
elems = currForm.elements;
|
6 |
-
|
7 |
-
for (var key in elems) {
|
8 |
-
if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')
|
9 |
-
continue;
|
10 |
-
ct_data[elems[key].name] = currForm.elements[key].value;
|
11 |
-
}
|
12 |
-
ct_data['action'] = 'ct_check_internal';
|
13 |
-
|
14 |
-
//AJAX Request
|
15 |
-
apbct_public_sendAJAX(
|
16 |
-
ct_data,
|
17 |
-
{
|
18 |
-
url: ctPublicFunctions._ajax_url,
|
19 |
-
callback: function (data) {
|
20 |
-
if(data.success === true){
|
21 |
-
currForm.submit();
|
22 |
-
}else{
|
23 |
-
alert(data.data);
|
24 |
-
return false;
|
25 |
-
}
|
26 |
-
}
|
27 |
-
}
|
28 |
-
);
|
29 |
-
}
|
30 |
-
|
31 |
-
document.addEventListener('DOMContentLoaded',function(){
|
32 |
-
let ct_currAction = '',
|
33 |
-
ct_currForm = '';
|
34 |
-
|
35 |
-
if( ! +ctPublic.settings__forms__check_internal ) {
|
36 |
-
return;
|
37 |
-
}
|
38 |
-
|
39 |
-
for( let i=0; i<document.forms.length; i++ ){
|
40 |
-
if ( typeof(document.forms[i].action) == 'string' ){
|
41 |
-
ct_currForm = document.forms[i];
|
42 |
-
ct_currAction = ct_currForm.action;
|
43 |
-
if (
|
44 |
-
ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory
|
45 |
-
ct_currAction.match(ctPublic.blog_home + '.*?\.php') !== null && // Main check
|
46 |
-
! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing
|
47 |
-
) {
|
48 |
-
ctPrevHandler = ct_currForm.click;
|
49 |
-
if ( typeof jQuery !== 'undefined' ) {
|
50 |
-
jQuery(ct_currForm).off('**');
|
51 |
-
jQuery(ct_currForm).off();
|
52 |
-
jQuery(ct_currForm).on('submit', function(event){
|
53 |
-
ct_check_internal(event.target);
|
54 |
-
return false;
|
55 |
-
});
|
56 |
-
}
|
57 |
-
}
|
58 |
-
}
|
59 |
-
}
|
60 |
-
});
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Check by action to exclude the form checking
|
64 |
-
* @param action string
|
65 |
-
* @return boolean
|
66 |
-
*/
|
67 |
-
function ct_check_internal__is_exclude_form(action) {
|
68 |
-
// An array contains forms action need to be excluded.
|
69 |
-
let ct_internal_script_exclusions = [
|
70 |
-
ctPublic.blog_home + 'wp-login.php', // WordPress login page
|
71 |
-
ctPublic.blog_home + 'wp-comments-post.php', // WordPress Comments Form
|
72 |
-
];
|
73 |
-
|
74 |
-
return ct_internal_script_exclusions.some((item) => {
|
75 |
-
return action.match(new RegExp('^' + item)) !== null;
|
76 |
-
});
|
77 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/apbct-public-bundle.js
DELETED
@@ -1,2448 +0,0 @@
|
|
1 |
-
class ApbctCore{
|
2 |
-
|
3 |
-
ajax_parameters = {};
|
4 |
-
rest_parameters = {};
|
5 |
-
|
6 |
-
#selector = null;
|
7 |
-
elements = [];
|
8 |
-
|
9 |
-
// Event properties
|
10 |
-
#eventCallback;
|
11 |
-
#eventSelector;
|
12 |
-
#event;
|
13 |
-
|
14 |
-
/**
|
15 |
-
* Default constructor
|
16 |
-
*/
|
17 |
-
constructor(selector){
|
18 |
-
this.select(selector);
|
19 |
-
}
|
20 |
-
|
21 |
-
/**
|
22 |
-
* Get elements by CSS selector
|
23 |
-
*
|
24 |
-
* @param selector
|
25 |
-
* @returns {*}
|
26 |
-
*/
|
27 |
-
select(selector) {
|
28 |
-
|
29 |
-
if(selector instanceof HTMLCollection){
|
30 |
-
this.#selector = null;
|
31 |
-
this.elements = [];
|
32 |
-
this.elements = Array.prototype.slice.call(selector);
|
33 |
-
}else if( typeof selector === 'object' ){
|
34 |
-
this.#selector = null;
|
35 |
-
this.elements = [];
|
36 |
-
this.elements[0] = selector;
|
37 |
-
}else if( typeof selector === 'string' ){
|
38 |
-
this.#selector = selector;
|
39 |
-
this.elements = Array.prototype.slice.call(document.querySelectorAll(selector));
|
40 |
-
// this.elements = document.querySelectorAll(selector)[0];
|
41 |
-
}else{
|
42 |
-
this.#deselect();
|
43 |
-
}
|
44 |
-
|
45 |
-
return this;
|
46 |
-
}
|
47 |
-
|
48 |
-
#addElement(elemToAdd){
|
49 |
-
if( typeof elemToAdd === 'object' ){
|
50 |
-
this.elements.push(elemToAdd);
|
51 |
-
}else if( typeof elemToAdd === 'string' ){
|
52 |
-
this.#selector = elemToAdd;
|
53 |
-
this.elements = Array.prototype.slice.call(document.querySelectorAll(elemToAdd));
|
54 |
-
}else{
|
55 |
-
this.#deselect();
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
#push(elem){
|
60 |
-
this.elements.push(elem);
|
61 |
-
}
|
62 |
-
|
63 |
-
#reduce(){
|
64 |
-
this.elements = this.elements.slice(0,-1);
|
65 |
-
}
|
66 |
-
|
67 |
-
#deselect(){
|
68 |
-
this.elements = [];
|
69 |
-
}
|
70 |
-
|
71 |
-
/**
|
72 |
-
* Set or get CSS for/of currently selected element
|
73 |
-
*
|
74 |
-
* @param style
|
75 |
-
* @param getRaw
|
76 |
-
*
|
77 |
-
* @returns {boolean|*}
|
78 |
-
*/
|
79 |
-
css(style, getRaw){
|
80 |
-
|
81 |
-
getRaw = getRaw | false;
|
82 |
-
|
83 |
-
// Set style
|
84 |
-
if(typeof style === "object"){
|
85 |
-
|
86 |
-
const stringToCamelCase = str =>
|
87 |
-
str.replace(/([-_][a-z])/g, group =>
|
88 |
-
group
|
89 |
-
.toUpperCase()
|
90 |
-
.replace('-', '')
|
91 |
-
.replace('_', '')
|
92 |
-
);
|
93 |
-
|
94 |
-
// Apply multiple styles
|
95 |
-
for(let style_name in style){
|
96 |
-
let DOM_style_name = stringToCamelCase(style_name);
|
97 |
-
|
98 |
-
// Apply to multiple elements (currently selected)
|
99 |
-
for(let i=0; i<this.elements.length; i++){
|
100 |
-
this.elements[i].style[DOM_style_name] = style[style_name];
|
101 |
-
}
|
102 |
-
}
|
103 |
-
|
104 |
-
return this;
|
105 |
-
}
|
106 |
-
|
107 |
-
// Get style of first currently selected element
|
108 |
-
if(typeof style === 'string'){
|
109 |
-
|
110 |
-
let computedStyle = getComputedStyle(this.elements[0])[style];
|
111 |
-
|
112 |
-
console.log(computedStyle);
|
113 |
-
|
114 |
-
// Process
|
115 |
-
if( typeof computedStyle !== 'undefined' && ! getRaw){
|
116 |
-
computedStyle = computedStyle.replace(/(\d)(em|pt|%|px){1,2}$/, '$1'); // Cut of units
|
117 |
-
computedStyle = Number(computedStyle) == computedStyle ? Number(computedStyle) : computedStyle; // Cast to INT
|
118 |
-
return computedStyle;
|
119 |
-
}
|
120 |
-
|
121 |
-
// Return unprocessed
|
122 |
-
return computedStyle;
|
123 |
-
}
|
124 |
-
}
|
125 |
-
|
126 |
-
hide(){
|
127 |
-
this.prop('prev-display', this.css('display'));
|
128 |
-
this.css({'display': 'none'});
|
129 |
-
}
|
130 |
-
|
131 |
-
show(){
|
132 |
-
this.css({'display': this.prop('prev-display')});
|
133 |
-
}
|
134 |
-
|
135 |
-
addClass(){
|
136 |
-
for(let i=0; i<this.elements.length; i++){
|
137 |
-
this.elements[i].classList.add(className);
|
138 |
-
}
|
139 |
-
}
|
140 |
-
|
141 |
-
removeClass(){
|
142 |
-
for(let i=0; i<this.elements.length; i++){
|
143 |
-
this.elements[i].classList.remove(className);
|
144 |
-
}
|
145 |
-
}
|
146 |
-
|
147 |
-
toggleClass(className){
|
148 |
-
for(let i=0; i<this.elements.length; i++){
|
149 |
-
this.elements[i].classList.toggle(className);
|
150 |
-
}
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* Wrapper for apbctAJAX class
|
155 |
-
*
|
156 |
-
* @param ajax_parameters
|
157 |
-
* @returns {ApbctAjax}
|
158 |
-
*/
|
159 |
-
ajax(ajax_parameters){
|
160 |
-
this.ajax_parameters = ajax_parameters;
|
161 |
-
return new ApbctAjax(ajax_parameters);
|
162 |
-
}
|
163 |
-
|
164 |
-
/**
|
165 |
-
* Wrapper for apbctREST class
|
166 |
-
*
|
167 |
-
* @param rest_parameters
|
168 |
-
* @returns {ApbctRest}
|
169 |
-
*/
|
170 |
-
rest(rest_parameters){
|
171 |
-
this.rest_parameters = rest_parameters;
|
172 |
-
return new ApbctRest(rest_parameters);
|
173 |
-
}
|
174 |
-
|
175 |
-
/************** EVENTS **************/
|
176 |
-
|
177 |
-
/**
|
178 |
-
*
|
179 |
-
* Why the mess with arguments?
|
180 |
-
*
|
181 |
-
* Because we need to support the following function signatures:
|
182 |
-
* on('click', function(){ alert('some'); });
|
183 |
-
* on('click', 'inner_selector', function(){ alert('some'); });
|
184 |
-
*
|
185 |
-
* @param args
|
186 |
-
*/
|
187 |
-
on(...args){
|
188 |
-
|
189 |
-
this.#event = args[0];
|
190 |
-
this.#eventCallback = args[2] || args[1];
|
191 |
-
this.#eventSelector = typeof args[1] === "string" ? args[1] : null;
|
192 |
-
|
193 |
-
for(let i=0; i<this.elements.length; i++){
|
194 |
-
this.elements[i].addEventListener(
|
195 |
-
this.#event,
|
196 |
-
this.#eventSelector !== null
|
197 |
-
? this.#onChecker.bind(this)
|
198 |
-
: this.#eventCallback
|
199 |
-
);
|
200 |
-
}
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Check if a selector of an event matches current target
|
205 |
-
*
|
206 |
-
* @param event
|
207 |
-
* @returns {*}
|
208 |
-
*/
|
209 |
-
#onChecker(event){
|
210 |
-
if(event.target === document.querySelector(this.#eventSelector)){
|
211 |
-
event.stopPropagation();
|
212 |
-
return this.#eventCallback(event);
|
213 |
-
}
|
214 |
-
}
|
215 |
-
|
216 |
-
ready(callback){
|
217 |
-
document.addEventListener('DOMContentLoaded', callback);
|
218 |
-
}
|
219 |
-
|
220 |
-
change(callback){
|
221 |
-
this.on('change', callback);
|
222 |
-
}
|
223 |
-
|
224 |
-
/************** ATTRIBUTES **************/
|
225 |
-
|
226 |
-
/**
|
227 |
-
* Get an attribute or property of an element
|
228 |
-
*
|
229 |
-
* @param attrName
|
230 |
-
* @returns {*|*[]}
|
231 |
-
*/
|
232 |
-
attr(attrName){
|
233 |
-
|
234 |
-
let outputValue = [];
|
235 |
-
|
236 |
-
for(let i=0; i<this.elements.length; i++){
|
237 |
-
|
238 |
-
// Use property instead of attribute if possible
|
239 |
-
if(typeof this.elements[i][attrName] !== undefined){
|
240 |
-
outputValue.push(this.elements[i][attrName]);
|
241 |
-
}else{
|
242 |
-
outputValue.push(this.elements[i].getAttribute(attrName));
|
243 |
-
}
|
244 |
-
}
|
245 |
-
|
246 |
-
// Return a single value instead of array if only one value is present
|
247 |
-
return outputValue.length === 1 ? outputValue[0] : outputValue;
|
248 |
-
}
|
249 |
-
|
250 |
-
prop(propName, value){
|
251 |
-
|
252 |
-
// Setting values
|
253 |
-
if(typeof value !== "undefined"){
|
254 |
-
for(let i=0; i<this.elements.length; i++){
|
255 |
-
this.elements[i][propName] = value;
|
256 |
-
}
|
257 |
-
|
258 |
-
return this;
|
259 |
-
|
260 |
-
// Getting values
|
261 |
-
}else{
|
262 |
-
|
263 |
-
let outputValue = [];
|
264 |
-
|
265 |
-
for(let i=0; i<this.elements.length; i++){
|
266 |
-
outputValue.push(this.elements[i][propName]);
|
267 |
-
}
|
268 |
-
|
269 |
-
// Return a single value instead of array if only one value is present
|
270 |
-
return outputValue.length === 1 ? outputValue[0] : outputValue;
|
271 |
-
}
|
272 |
-
}
|
273 |
-
|
274 |
-
/**
|
275 |
-
* Set or get inner HTML
|
276 |
-
*
|
277 |
-
* @param value
|
278 |
-
* @returns {*|*[]}
|
279 |
-
*/
|
280 |
-
html(value){
|
281 |
-
return typeof value !== 'undefined'
|
282 |
-
? this.prop('innerHTML', value)
|
283 |
-
: this.prop('innerHTML');
|
284 |
-
}
|
285 |
-
|
286 |
-
/**
|
287 |
-
* Set or get value of input tags
|
288 |
-
*
|
289 |
-
* @param value
|
290 |
-
* @returns {*|*[]|undefined}
|
291 |
-
*/
|
292 |
-
val(value){
|
293 |
-
return typeof value !== 'undefined'
|
294 |
-
? this.prop('value', value)
|
295 |
-
: this.prop('value');
|
296 |
-
}
|
297 |
-
|
298 |
-
data(name, value){
|
299 |
-
return typeof value !== 'undefined'
|
300 |
-
? this.prop('apbct-data', name, value)
|
301 |
-
: this.prop('apbct-data');
|
302 |
-
}
|
303 |
-
|
304 |
-
/************** END OF ATTRIBUTES **************/
|
305 |
-
|
306 |
-
/************** FILTERS **************/
|
307 |
-
|
308 |
-
/**
|
309 |
-
* Check if the current elements are corresponding to filter
|
310 |
-
*
|
311 |
-
* @param filter
|
312 |
-
* @returns {boolean}
|
313 |
-
*/
|
314 |
-
is(filter){
|
315 |
-
|
316 |
-
let outputValue = false;
|
317 |
-
|
318 |
-
for(let elem of this.elements){
|
319 |
-
outputValue ||= this.#isElem(elem, filter);
|
320 |
-
}
|
321 |
-
|
322 |
-
return outputValue;
|
323 |
-
}
|
324 |
-
|
325 |
-
#isElem(elemToCheck, filter){
|
326 |
-
|
327 |
-
let is = false;
|
328 |
-
let isRegisteredTagName = function(name){
|
329 |
-
let newlyCreatedElement = document.createElement(name).constructor;
|
330 |
-
return ! Boolean( ~[HTMLElement, HTMLUnknownElement].indexOf(newlyCreatedElement) );
|
331 |
-
};
|
332 |
-
|
333 |
-
// Check for filter function
|
334 |
-
if(typeof filter === 'function') {
|
335 |
-
is ||= filter.call(this, elemToCheck);
|
336 |
-
}
|
337 |
-
|
338 |
-
// Check for filter function
|
339 |
-
if(typeof filter === 'string') {
|
340 |
-
|
341 |
-
// Filter is tag name
|
342 |
-
if( filter.match(/^[a-z]/) && isRegisteredTagName(filter) ){
|
343 |
-
is ||= elemToCheck.tagName.toLowerCase() === filter.toLowerCase();
|
344 |
-
|
345 |
-
// Filter is property
|
346 |
-
}else if( filter.match(/^[a-z]/) ){
|
347 |
-
is ||= Boolean(elemToCheck[filter]);
|
348 |
-
|
349 |
-
// Filter is CSS selector
|
350 |
-
}else {
|
351 |
-
is ||= this.#selector !== null
|
352 |
-
? document.querySelector(this.#selector + filter) !== null // If possible
|
353 |
-
: this.#isWithoutSelector(elemToCheck, filter); // Search through all elems with such selector
|
354 |
-
}
|
355 |
-
}
|
356 |
-
|
357 |
-
return is;
|
358 |
-
}
|
359 |
-
|
360 |
-
#isWithoutSelector(elemToCheck, filter){
|
361 |
-
|
362 |
-
let elems = document.querySelectorAll(filter);
|
363 |
-
let outputValue = false;
|
364 |
-
|
365 |
-
for(let elem of elems){
|
366 |
-
outputValue ||= elemToCheck === elem;
|
367 |
-
}
|
368 |
-
|
369 |
-
return outputValue;
|
370 |
-
}
|
371 |
-
|
372 |
-
filter(filter){
|
373 |
-
|
374 |
-
this.#selector = null;
|
375 |
-
|
376 |
-
for( let i = this.elements.length - 1; i >= 0; i-- ){
|
377 |
-
if( ! this.#isElem(this.elements[i], filter) ){
|
378 |
-
this.elements.splice(Number(i), 1);
|
379 |
-
}
|
380 |
-
}
|
381 |
-
|
382 |
-
return this;
|
383 |
-
}
|
384 |
-
|
385 |
-
/************** NODES **************/
|
386 |
-
|
387 |
-
parent(filter){
|
388 |
-
|
389 |
-
this.select(this.elements[0].parentElement);
|
390 |
-
|
391 |
-
if( typeof filter !== 'undefined' && ! this.is(filter) ){
|
392 |
-
this.#deselect();
|
393 |
-
}
|
394 |
-
|
395 |
-
return this;
|
396 |
-
}
|
397 |
-
|
398 |
-
parents(filter){
|
399 |
-
|
400 |
-
this.select(this.elements[0]);
|
401 |
-
|
402 |
-
for ( ; this.elements[ this.elements.length - 1].parentElement !== null ; ) {
|
403 |
-
this.#push(this.elements[ this.elements.length - 1].parentElement);
|
404 |
-
}
|
405 |
-
|
406 |
-
this.elements.splice(0,1); // Deleting initial element from the set
|
407 |
-
|
408 |
-
if( typeof filter !== 'undefined' ){
|
409 |
-
this.filter(filter);
|
410 |
-
}
|
411 |
-
|
412 |
-
return this;
|
413 |
-
}
|
414 |
-
|
415 |
-
children(filter){
|
416 |
-
|
417 |
-
this.select(this.elements[0].children);
|
418 |
-
|
419 |
-
if( typeof filter !== 'undefined' ){
|
420 |
-
this.filter(filter);
|
421 |
-
}
|
422 |
-
|
423 |
-
return this;
|
424 |
-
}
|
425 |
-
|
426 |
-
siblings(filter){
|
427 |
-
|
428 |
-
let current = this.elements[0]; // Remember current to delete it later
|
429 |
-
|
430 |
-
this.parent();
|
431 |
-
this.children(filter);
|
432 |
-
this.elements.splice(this.elements.indexOf(current), 1); // Remove current element
|
433 |
-
|
434 |
-
return this;
|
435 |
-
}
|
436 |
-
|
437 |
-
/************** DOM MANIPULATIONS **************/
|
438 |
-
remove(){
|
439 |
-
for(let elem of this.elements){
|
440 |
-
elem.remove();
|
441 |
-
}
|
442 |
-
}
|
443 |
-
|
444 |
-
after(content){
|
445 |
-
for(let elem of this.elements){
|
446 |
-
elem.after(content);
|
447 |
-
}
|
448 |
-
}
|
449 |
-
|
450 |
-
append(content){
|
451 |
-
for(let elem of this.elements){
|
452 |
-
elem.append(content);
|
453 |
-
}
|
454 |
-
}
|
455 |
-
|
456 |
-
/** ANIMATION **/
|
457 |
-
fadeIn(time) {
|
458 |
-
for(let elem of this.elements){
|
459 |
-
elem.style.opacity = 0;
|
460 |
-
elem.style.display = 'block';
|
461 |
-
|
462 |
-
let last = +new Date();
|
463 |
-
const tick = function () {
|
464 |
-
elem.style.opacity = +elem.style.opacity + (new Date() - last) / time;
|
465 |
-
last = +new Date();
|
466 |
-
|
467 |
-
if (+elem.style.opacity < 1) {
|
468 |
-
(window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);
|
469 |
-
}
|
470 |
-
};
|
471 |
-
|
472 |
-
tick();
|
473 |
-
}
|
474 |
-
}
|
475 |
-
|
476 |
-
fadeOut(time) {
|
477 |
-
for(let elem of this.elements){
|
478 |
-
elem.style.opacity = 1;
|
479 |
-
|
480 |
-
let last = +new Date();
|
481 |
-
const tick = function () {
|
482 |
-
elem.style.opacity = +elem.style.opacity - (new Date() - last) / time;
|
483 |
-
last = +new Date();
|
484 |
-
|
485 |
-
if (+elem.style.opacity > 0) {
|
486 |
-
(window.requestAnimationFrame && requestAnimationFrame(tick)) || setTimeout(tick, 16);
|
487 |
-
} else {
|
488 |
-
elem.style.display = 'none';
|
489 |
-
}
|
490 |
-
};
|
491 |
-
|
492 |
-
tick();
|
493 |
-
}
|
494 |
-
}
|
495 |
-
|
496 |
-
}
|
497 |
-
|
498 |
-
/**
|
499 |
-
* Hack
|
500 |
-
*
|
501 |
-
* Make a proxy to keep both properties and methods from:
|
502 |
-
* - the native object and
|
503 |
-
* - the new one from ApbctCore for selected element.
|
504 |
-
*
|
505 |
-
* For example:
|
506 |
-
* apbct('#id).innerHTML = 'some';
|
507 |
-
* apbct('#id).css({'backgorund-color': 'black'});
|
508 |
-
*/
|
509 |
-
// apbct = new Proxy(
|
510 |
-
// apbct,
|
511 |
-
// {
|
512 |
-
// get(target, prop) {
|
513 |
-
// if (target.elements.length) {
|
514 |
-
// return target.elements[0][prop];
|
515 |
-
// } else {
|
516 |
-
// return null;
|
517 |
-
// }
|
518 |
-
// },
|
519 |
-
// set(target, prop, value){
|
520 |
-
// if (target.elements.length) {
|
521 |
-
// target.elements[0][prop] = value;
|
522 |
-
// return true;
|
523 |
-
// } else {
|
524 |
-
// return false;
|
525 |
-
// }
|
526 |
-
// },
|
527 |
-
// apply(target, thisArg, argArray) {
|
528 |
-
//
|
529 |
-
// }
|
530 |
-
// }
|
531 |
-
// );
|
532 |
-
|
533 |
-
/**
|
534 |
-
* Enter point to ApbctCore class
|
535 |
-
*
|
536 |
-
* @param params
|
537 |
-
* @returns {*}
|
538 |
-
*/
|
539 |
-
function apbct(params){
|
540 |
-
return new ApbctCore()
|
541 |
-
.select(params);
|
542 |
-
}
|
543 |
-
class ApbctXhr{
|
544 |
-
|
545 |
-
#xhr = new XMLHttpRequest();
|
546 |
-
|
547 |
-
// Base parameters
|
548 |
-
method = 'POST'; // HTTP-request type
|
549 |
-
url = ''; // URL to send the request
|
550 |
-
async = true;
|
551 |
-
user = null; // HTTP-authorization username
|
552 |
-
password = null; // HTTP-authorization password
|
553 |
-
data = {}; // Data to send
|
554 |
-
|
555 |
-
|
556 |
-
// Optional params
|
557 |
-
button = null; // Button that should be disabled when request is performing
|
558 |
-
spinner = null; // Spinner that should appear when request is in process
|
559 |
-
progressbar = null; // Progress bar for the current request
|
560 |
-
context = this; // Context
|
561 |
-
callback = null;
|
562 |
-
onErrorCallback = null;
|
563 |
-
|
564 |
-
responseType = 'json'; // Expected data type from server
|
565 |
-
headers = {};
|
566 |
-
timeout = 15000; // Request timeout in milliseconds
|
567 |
-
|
568 |
-
#methods_to_convert_data_to_URL = [
|
569 |
-
'GET',
|
570 |
-
'HEAD',
|
571 |
-
];
|
572 |
-
|
573 |
-
#body = null;
|
574 |
-
#http_code = 0;
|
575 |
-
#status_text = '';
|
576 |
-
|
577 |
-
constructor(parameters){
|
578 |
-
|
579 |
-
console.log('%cXHR%c started', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;');
|
580 |
-
|
581 |
-
// Set class properties
|
582 |
-
for( let key in parameters ){
|
583 |
-
if( typeof this[key] !== 'undefined' ){
|
584 |
-
this[key] = parameters[key];
|
585 |
-
}
|
586 |
-
}
|
587 |
-
|
588 |
-
// Modifying DOM-elements
|
589 |
-
this.#prepare();
|
590 |
-
|
591 |
-
// Modify URL with data for GET and HEAD requests
|
592 |
-
if ( Object.keys(this.data).length ) {
|
593 |
-
this.deleteDoubleJSONEncoding(this.data);
|
594 |
-
this.convertData();
|
595 |
-
}
|
596 |
-
|
597 |
-
if( ! this.url ){
|
598 |
-
console.log('%cXHR%c not URL provided', 'color: red; font-weight: bold;', 'color: grey; font-weight: normal;')
|
599 |
-
return false;
|
600 |
-
}
|
601 |
-
|
602 |
-
// Configure the request
|
603 |
-
this.#xhr.open(this.method, this.url, this.async, this.user, this.password);
|
604 |
-
this.setHeaders();
|
605 |
-
|
606 |
-
this.#xhr.responseType = this.responseType;
|
607 |
-
this.#xhr.timeout = this.timeout;
|
608 |
-
|
609 |
-
/* EVENTS */
|
610 |
-
// Monitoring status
|
611 |
-
this.#xhr.onreadystatechange = function(){
|
612 |
-
this.onReadyStateChange();
|
613 |
-
}.bind(this);
|
614 |
-
|
615 |
-
// Run callback
|
616 |
-
this.#xhr.onload = function(){
|
617 |
-
this.onLoad();
|
618 |
-
}.bind(this);
|
619 |
-
|
620 |
-
// On progress
|
621 |
-
this.#xhr.onprogress = function(event){
|
622 |
-
this.onProgress(event);
|
623 |
-
}.bind(this);
|
624 |
-
|
625 |
-
// On error
|
626 |
-
this.#xhr.onerror = function(){
|
627 |
-
this.onError();
|
628 |
-
}.bind(this);
|
629 |
-
|
630 |
-
this.#xhr.ontimeout = function(){
|
631 |
-
this.onTimeout();
|
632 |
-
}.bind(this);
|
633 |
-
|
634 |
-
// Send the request
|
635 |
-
this.#xhr.send(this.#body);
|
636 |
-
}
|
637 |
-
|
638 |
-
#prepare(){
|
639 |
-
|
640 |
-
// Disable button
|
641 |
-
if(this.button){
|
642 |
-
this.button.setAttribute('disabled', 'disabled');
|
643 |
-
this.button.style.cursor = 'not-allowed';
|
644 |
-
}
|
645 |
-
|
646 |
-
// Enable spinner
|
647 |
-
if(this.spinner) {
|
648 |
-
this.spinner.style.display = 'inline';
|
649 |
-
}
|
650 |
-
}
|
651 |
-
|
652 |
-
#complete(){
|
653 |
-
|
654 |
-
this.#http_code = this.#xhr.status;
|
655 |
-
this.#status_text = this.#xhr.statusText;
|
656 |
-
|
657 |
-
// Disable button
|
658 |
-
if(this.button){
|
659 |
-
this.button.removeAttribute('disabled');
|
660 |
-
this.button.style.cursor = 'auto';
|
661 |
-
}
|
662 |
-
|
663 |
-
// Enable spinner
|
664 |
-
if(this.spinner) {
|
665 |
-
this.spinner.style.display = 'none';
|
666 |
-
}
|
667 |
-
|
668 |
-
if( this.progressbar ) {
|
669 |
-
this.progressbar.fadeOut('slow');
|
670 |
-
}
|
671 |
-
}
|
672 |
-
|
673 |
-
onReadyStateChange(){
|
674 |
-
if (this.on_ready_state_change !== null && typeof this.on_ready_state_change === 'function'){
|
675 |
-
this.on_ready_state_change();
|
676 |
-
}
|
677 |
-
}
|
678 |
-
|
679 |
-
onProgress(event) {
|
680 |
-
if (this.on_progress !== null && typeof this.on_progress === 'function'){
|
681 |
-
this.on_progress();
|
682 |
-
}
|
683 |
-
}
|
684 |
-
|
685 |
-
onError(){
|
686 |
-
|
687 |
-
console.log('error');
|
688 |
-
|
689 |
-
this.#complete();
|
690 |
-
this.#error(
|
691 |
-
this.#http_code,
|
692 |
-
this.#status_text
|
693 |
-
);
|
694 |
-
|
695 |
-
if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){
|
696 |
-
this.onErrorCallback(this.#status_text);
|
697 |
-
}
|
698 |
-
}
|
699 |
-
|
700 |
-
onTimeout(){
|
701 |
-
this.#complete();
|
702 |
-
this.#error(
|
703 |
-
0,
|
704 |
-
'timeout'
|
705 |
-
);
|
706 |
-
|
707 |
-
if (this.onErrorCallback !== null && typeof this.onErrorCallback === 'function'){
|
708 |
-
this.onErrorCallback('Timeout');
|
709 |
-
}
|
710 |
-
}
|
711 |
-
|
712 |
-
onLoad(){
|
713 |
-
|
714 |
-
this.#complete();
|
715 |
-
|
716 |
-
if (this.responseType === 'json' ){
|
717 |
-
if(this.#xhr.response === null){
|
718 |
-
this.#error(this.#http_code, this.#status_text, 'No response');
|
719 |
-
return false;
|
720 |
-
}else if( typeof this.#xhr.response.error !== 'undefined') {
|
721 |
-
this.#error(this.#http_code, this.#status_text, this.#xhr.response.error);
|
722 |
-
return false;
|
723 |
-
}
|
724 |
-
}
|
725 |
-
|
726 |
-
if (this.callback !== null && typeof this.callback === 'function') {
|
727 |
-
this.callback.call(this.context, this.#xhr.response, this.data);
|
728 |
-
}
|
729 |
-
}
|
730 |
-
|
731 |
-
#error(http_code, status_text, additional_msg){
|
732 |
-
|
733 |
-
let error_string = '';
|
734 |
-
|
735 |
-
if( status_text === 'timeout' ){
|
736 |
-
error_string += 'Server response timeout'
|
737 |
-
|
738 |
-
}else if( http_code === 200 ){
|
739 |
-
|
740 |
-
if( status_text === 'parsererror' ){
|
741 |
-
error_string += 'Unexpected response from server. See console for details.';
|
742 |
-
}else {
|
743 |
-
error_string += 'Unexpected error. Status: ' + status_text + '.';
|
744 |
-
if( typeof additional_msg !== 'undefined' )
|
745 |
-
error_string += ' Additional error info: ' + additional_msg;
|
746 |
-
}
|
747 |
-
|
748 |
-
}else if(http_code === 500){
|
749 |
-
error_string += 'Internal server error.';
|
750 |
-
|
751 |
-
}else {
|
752 |
-
error_string += 'Unexpected response code:' + http_code;
|
753 |
-
}
|
754 |
-
|
755 |
-
this.errorOutput( error_string );
|
756 |
-
}
|
757 |
-
|
758 |
-
errorOutput(error_msg){
|
759 |
-
console.log( '%c ctXHR error: %c' + error_msg, 'color: red;', 'color: grey;' );
|
760 |
-
}
|
761 |
-
|
762 |
-
setHeaders(){
|
763 |
-
// Set headers if passed
|
764 |
-
for( let header_name in this.headers ){
|
765 |
-
if( typeof this.headers[header_name] !== 'undefined' ){
|
766 |
-
this.#xhr.setRequestHeader(header_name, this.headers[header_name]);
|
767 |
-
}
|
768 |
-
}
|
769 |
-
}
|
770 |
-
|
771 |
-
convertData()
|
772 |
-
{
|
773 |
-
// GET, HEAD request-type
|
774 |
-
if( ~this.#methods_to_convert_data_to_URL.indexOf( this.method ) ){
|
775 |
-
return this.convertDataToURL();
|
776 |
-
|
777 |
-
// POST request-type
|
778 |
-
}else{
|
779 |
-
return this.convertDataToBody()
|
780 |
-
}
|
781 |
-
}
|
782 |
-
|
783 |
-
convertDataToURL(){
|
784 |
-
let params_appendix = new URLSearchParams(this.data).toString();
|
785 |
-
let params_prefix = this.url.match(/^(https?:\/{2})?[a-z0-9.]+\?/) ? '&' : '?';
|
786 |
-
this.url += params_prefix + params_appendix;
|
787 |
-
|
788 |
-
return this.url;
|
789 |
-
}
|
790 |
-
|
791 |
-
/**
|
792 |
-
*
|
793 |
-
* @returns {null}
|
794 |
-
*/
|
795 |
-
convertDataToBody()
|
796 |
-
{
|
797 |
-
this.#body = new FormData();
|
798 |
-
|
799 |
-
for (let dataKey in this.data) {
|
800 |
-
this.#body.append(
|
801 |
-
dataKey,
|
802 |
-
typeof this.data[dataKey] === 'object'
|
803 |
-
? JSON.stringify(this.data[dataKey])
|
804 |
-
: this.data[dataKey]
|
805 |
-
);
|
806 |
-
}
|
807 |
-
|
808 |
-
return this.#body;
|
809 |
-
}
|
810 |
-
|
811 |
-
/**
|
812 |
-
* Recursive
|
813 |
-
*
|
814 |
-
* Recursively decode JSON-encoded properties
|
815 |
-
*
|
816 |
-
* @param object
|
817 |
-
* @returns {*}
|
818 |
-
*/
|
819 |
-
deleteDoubleJSONEncoding(object){
|
820 |
-
|
821 |
-
if( typeof object === 'object'){
|
822 |
-
|
823 |
-
for (let objectKey in object) {
|
824 |
-
|
825 |
-
// Recursion
|
826 |
-
if( typeof object[objectKey] === 'object'){
|
827 |
-
object[objectKey] = this.deleteDoubleJSONEncoding(object[objectKey]);
|
828 |
-
}
|
829 |
-
|
830 |
-
// Common case (out)
|
831 |
-
if(
|
832 |
-
typeof object[objectKey] === 'string' &&
|
833 |
-
object[objectKey].match(/^[\[{].*?[\]}]$/) !== null // is like JSON
|
834 |
-
){
|
835 |
-
let parsedValue = JSON.parse(object[objectKey]);
|
836 |
-
if( typeof parsedValue === 'object' ){
|
837 |
-
object[objectKey] = parsedValue;
|
838 |
-
}
|
839 |
-
}
|
840 |
-
}
|
841 |
-
}
|
842 |
-
|
843 |
-
return object;
|
844 |
-
}
|
845 |
-
}
|
846 |
-
class ApbctAjax extends ApbctXhr{
|
847 |
-
|
848 |
-
constructor(...args) {
|
849 |
-
super(args[0]);
|
850 |
-
}
|
851 |
-
}
|
852 |
-
class ApbctRest extends ApbctXhr{
|
853 |
-
|
854 |
-
static default_route = ctPublicFunctions._rest_url + 'cleantalk-antispam/v1/';
|
855 |
-
route = '';
|
856 |
-
|
857 |
-
constructor(...args) {
|
858 |
-
args = args[0];
|
859 |
-
args.url = ApbctRest.default_route + args.route;
|
860 |
-
args.headers = {
|
861 |
-
"X-WP-Nonce": ctPublicFunctions._rest_nonce
|
862 |
-
};
|
863 |
-
super(args);
|
864 |
-
}
|
865 |
-
}
|
866 |
-
|
867 |
-
function ctSetCookie( cookies, value, expires ){
|
868 |
-
|
869 |
-
if( typeof cookies === 'string' && typeof value === 'string' || typeof value === 'number'){
|
870 |
-
var skip_alt = cookies === 'ct_pointer_data';
|
871 |
-
cookies = [ [ cookies, value, expires ] ];
|
872 |
-
}
|
873 |
-
|
874 |
-
// Cookies disabled
|
875 |
-
if( ctPublicFunctions.data__cookies_type === 'none' ){
|
876 |
-
cookies.forEach( function (item, i, arr ) {
|
877 |
-
apbctLocalStorage.set(item[0], encodeURIComponent(item[1]))
|
878 |
-
});
|
879 |
-
ctNoCookieAttachHiddenFieldsToForms()
|
880 |
-
// Using traditional cookies
|
881 |
-
}else if( ctPublicFunctions.data__cookies_type === 'native' ){
|
882 |
-
cookies.forEach( function (item, i, arr ) {
|
883 |
-
var expires = typeof item[2] !== 'undefined' ? "expires=" + expires + '; ' : '';
|
884 |
-
var ctSecure = location.protocol === 'https:' ? '; secure' : '';
|
885 |
-
document.cookie = ctPublicFunctions.cookiePrefix + item[0] + "=" + encodeURIComponent(item[1]) + "; " + expires + "path=/; samesite=lax" + ctSecure;
|
886 |
-
});
|
887 |
-
|
888 |
-
// Using alternative cookies
|
889 |
-
}else if( ctPublicFunctions.data__cookies_type === 'alternative' && ! skip_alt ){
|
890 |
-
|
891 |
-
if (typeof (getJavascriptClientData) === "function"){
|
892 |
-
//reprocess already gained cookies data
|
893 |
-
cookies = getJavascriptClientData(cookies);
|
894 |
-
} else {
|
895 |
-
console.log('APBCT ERROR: getJavascriptClientData() is not loaded')
|
896 |
-
}
|
897 |
-
|
898 |
-
try {
|
899 |
-
JSON.parse(cookies)
|
900 |
-
} catch (e){
|
901 |
-
console.log('APBCT ERROR: JSON parse error:' + e)
|
902 |
-
return
|
903 |
-
}
|
904 |
-
|
905 |
-
// Using REST API handler
|
906 |
-
if( ctPublicFunctions.data__ajax_type === 'rest' ){
|
907 |
-
apbct_public_sendREST(
|
908 |
-
'alt_sessions',
|
909 |
-
{
|
910 |
-
method: 'POST',
|
911 |
-
data: { cookies: cookies }
|
912 |
-
}
|
913 |
-
);
|
914 |
-
|
915 |
-
// Using AJAX request and handler
|
916 |
-
} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {
|
917 |
-
apbct_public_sendAJAX(
|
918 |
-
{
|
919 |
-
action: 'apbct_alt_session__save__AJAX',
|
920 |
-
cookies: cookies,
|
921 |
-
},
|
922 |
-
{
|
923 |
-
notJson: 1,
|
924 |
-
}
|
925 |
-
);
|
926 |
-
}
|
927 |
-
}
|
928 |
-
}
|
929 |
-
|
930 |
-
/**
|
931 |
-
* Get cookie by name
|
932 |
-
* @param name
|
933 |
-
* @returns {string|undefined}
|
934 |
-
*/
|
935 |
-
function ctGetCookie(name) {
|
936 |
-
var matches = document.cookie.match(new RegExp(
|
937 |
-
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
938 |
-
));
|
939 |
-
return matches ? decodeURIComponent(matches[1]) : undefined;
|
940 |
-
}
|
941 |
-
|
942 |
-
function ctDeleteCookie(cookieName) {
|
943 |
-
// Cookies disabled
|
944 |
-
if( ctPublicFunctions.data__cookies_type === 'none' ){
|
945 |
-
return;
|
946 |
-
|
947 |
-
// Using traditional cookies
|
948 |
-
}else if( ctPublicFunctions.data__cookies_type === 'native' ){
|
949 |
-
|
950 |
-
var ctSecure = location.protocol === 'https:' ? '; secure' : '';
|
951 |
-
document.cookie = cookieName + "=\"\"; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax" + ctSecure;
|
952 |
-
|
953 |
-
// Using alternative cookies
|
954 |
-
}else if( ctPublicFunctions.data__cookies_type === 'alternative' ){
|
955 |
-
// @ToDo implement this logic
|
956 |
-
}
|
957 |
-
}
|
958 |
-
|
959 |
-
function apbct_public_sendAJAX(data, params, obj){
|
960 |
-
|
961 |
-
// Default params
|
962 |
-
let _params = [];
|
963 |
-
_params["callback"] = params.callback || null;
|
964 |
-
_params["onErrorCallback"] = params.onErrorCallback || null;
|
965 |
-
_params["callback_context"] = params.callback_context || null;
|
966 |
-
_params["callback_params"] = params.callback_params || null;
|
967 |
-
_params["async"] = params.async || true;
|
968 |
-
_params["notJson"] = params.notJson || null;
|
969 |
-
_params["timeout"] = params.timeout || 15000;
|
970 |
-
_params["obj"] = obj || null;
|
971 |
-
_params["button"] = params.button || null;
|
972 |
-
_params["progressbar"] = params.progressbar || null;
|
973 |
-
_params["silent"] = params.silent || null;
|
974 |
-
_params["no_nonce"] = params.no_nonce || null;
|
975 |
-
_params["data"] = data;
|
976 |
-
_params["url"] = ctPublicFunctions._ajax_url;
|
977 |
-
|
978 |
-
if(typeof (data) === 'string') {
|
979 |
-
if( ! _params["no_nonce"] ) {
|
980 |
-
_params["data"] = _params["data"] + '&_ajax_nonce=' + ctPublicFunctions._ajax_nonce;
|
981 |
-
}
|
982 |
-
_params["data"] = _params["data"] + '&no_cache=' + Math.random()
|
983 |
-
} else {
|
984 |
-
if( ! _params["no_nonce"] ) {
|
985 |
-
_params["data"]._ajax_nonce = ctPublicFunctions._ajax_nonce;
|
986 |
-
}
|
987 |
-
_params["data"].no_cache = Math.random();
|
988 |
-
}
|
989 |
-
|
990 |
-
new ApbctCore().ajax(_params);
|
991 |
-
}
|
992 |
-
|
993 |
-
function apbct_public_sendREST( route, params ) {
|
994 |
-
|
995 |
-
let _params = [];
|
996 |
-
_params["route"] = route;
|
997 |
-
_params["callback"] = params.callback || null;
|
998 |
-
_params["onErrorCallback"] = params.onErrorCallback || null;
|
999 |
-
_params["data"] = params.data || [];
|
1000 |
-
_params["method"] = params.method || 'POST';
|
1001 |
-
|
1002 |
-
new ApbctCore().rest(_params);
|
1003 |
-
}
|
1004 |
-
|
1005 |
-
apbctLocalStorage = {
|
1006 |
-
get : function(key, property) {
|
1007 |
-
if ( typeof property === 'undefined' ) {
|
1008 |
-
property = 'value';
|
1009 |
-
}
|
1010 |
-
const storageValue = localStorage.getItem(key);
|
1011 |
-
if ( storageValue !== null ) {
|
1012 |
-
try {
|
1013 |
-
const json = JSON.parse(storageValue);
|
1014 |
-
return json.hasOwnProperty(property) ? JSON.parse(json[property]) : json;
|
1015 |
-
} catch (e) {
|
1016 |
-
return storageValue;
|
1017 |
-
}
|
1018 |
-
}
|
1019 |
-
return false;
|
1020 |
-
},
|
1021 |
-
set : function(key, value, is_json = true) {
|
1022 |
-
if (is_json){
|
1023 |
-
let objToSave = {'value': JSON.stringify(value), 'timestamp': Math.floor(new Date().getTime() / 1000)};
|
1024 |
-
localStorage.setItem(key, JSON.stringify(objToSave));
|
1025 |
-
} else {
|
1026 |
-
localStorage.setItem(key, value);
|
1027 |
-
}
|
1028 |
-
},
|
1029 |
-
isAlive : function(key, maxLifetime) {
|
1030 |
-
if ( typeof maxLifetime === 'undefined' ) {
|
1031 |
-
maxLifetime = 86400;
|
1032 |
-
}
|
1033 |
-
const keyTimestamp = this.get(key, 'timestamp');
|
1034 |
-
return keyTimestamp + maxLifetime > Math.floor(new Date().getTime() / 1000);
|
1035 |
-
},
|
1036 |
-
isSet : function(key) {
|
1037 |
-
return localStorage.getItem(key) !== null;
|
1038 |
-
},
|
1039 |
-
delete : function (key) {
|
1040 |
-
localStorage.removeItem(key);
|
1041 |
-
},
|
1042 |
-
getCleanTalkData : function () {
|
1043 |
-
let data = {}
|
1044 |
-
for(let i=0; i<localStorage.length; i++) {
|
1045 |
-
let key = localStorage.key(i);
|
1046 |
-
if (key.indexOf('ct_') !==-1 || key.indexOf('apbct_') !==-1){
|
1047 |
-
data[key.toString()] = apbctLocalStorage.get(key)
|
1048 |
-
}
|
1049 |
-
}
|
1050 |
-
return data
|
1051 |
-
},
|
1052 |
-
|
1053 |
-
}
|
1054 |
-
var ct_date = new Date(),
|
1055 |
-
ctTimeMs = new Date().getTime(),
|
1056 |
-
ctMouseEventTimerFlag = true, //Reading interval flag
|
1057 |
-
ctMouseData = [],
|
1058 |
-
ctMouseDataCounter = 0,
|
1059 |
-
ctCheckedEmails = {};
|
1060 |
-
|
1061 |
-
function apbct_attach_event_handler(elem, event, callback){
|
1062 |
-
if(typeof window.addEventListener === "function") elem.addEventListener(event, callback);
|
1063 |
-
else elem.attachEvent(event, callback);
|
1064 |
-
}
|
1065 |
-
|
1066 |
-
function apbct_remove_event_handler(elem, event, callback){
|
1067 |
-
if(typeof window.removeEventListener === "function") elem.removeEventListener(event, callback);
|
1068 |
-
else elem.detachEvent(event, callback);
|
1069 |
-
}
|
1070 |
-
|
1071 |
-
//Writing first key press timestamp
|
1072 |
-
var ctFunctionFirstKey = function output(event){
|
1073 |
-
var KeyTimestamp = Math.floor(new Date().getTime()/1000);
|
1074 |
-
ctSetCookie("ct_fkp_timestamp", KeyTimestamp);
|
1075 |
-
ctKeyStopStopListening();
|
1076 |
-
};
|
1077 |
-
|
1078 |
-
//Reading interval
|
1079 |
-
var ctMouseReadInterval = setInterval(function(){
|
1080 |
-
ctMouseEventTimerFlag = true;
|
1081 |
-
}, 150);
|
1082 |
-
|
1083 |
-
//Writting interval
|
1084 |
-
var ctMouseWriteDataInterval = setInterval(function(){
|
1085 |
-
ctSetCookie("ct_pointer_data", JSON.stringify(ctMouseData));
|
1086 |
-
}, 1200);
|
1087 |
-
|
1088 |
-
//Logging mouse position each 150 ms
|
1089 |
-
var ctFunctionMouseMove = function output(event){
|
1090 |
-
ctSetMouseMoved();
|
1091 |
-
if(ctMouseEventTimerFlag === true){
|
1092 |
-
|
1093 |
-
ctMouseData.push([
|
1094 |
-
Math.round(event.clientY),
|
1095 |
-
Math.round(event.clientX),
|
1096 |
-
Math.round(new Date().getTime() - ctTimeMs)
|
1097 |
-
]);
|
1098 |
-
|
1099 |
-
ctMouseDataCounter++;
|
1100 |
-
ctMouseEventTimerFlag = false;
|
1101 |
-
if(ctMouseDataCounter >= 50){
|
1102 |
-
ctMouseStopData();
|
1103 |
-
}
|
1104 |
-
}
|
1105 |
-
};
|
1106 |
-
|
1107 |
-
//Stop mouse observing function
|
1108 |
-
function ctMouseStopData(){
|
1109 |
-
apbct_remove_event_handler(window, "mousemove", ctFunctionMouseMove);
|
1110 |
-
clearInterval(ctMouseReadInterval);
|
1111 |
-
clearInterval(ctMouseWriteDataInterval);
|
1112 |
-
}
|
1113 |
-
|
1114 |
-
//Stop key listening function
|
1115 |
-
function ctKeyStopStopListening(){
|
1116 |
-
apbct_remove_event_handler(window, "mousedown", ctFunctionFirstKey);
|
1117 |
-
apbct_remove_event_handler(window, "keydown", ctFunctionFirstKey);
|
1118 |
-
}
|
1119 |
-
|
1120 |
-
function checkEmail(e) {
|
1121 |
-
var current_email = e.target.value;
|
1122 |
-
if (current_email && !(current_email in ctCheckedEmails)) {
|
1123 |
-
// Using REST API handler
|
1124 |
-
if( ctPublicFunctions.data__ajax_type === 'rest' ){
|
1125 |
-
apbct_public_sendREST(
|
1126 |
-
'check_email_before_post',
|
1127 |
-
{
|
1128 |
-
method: 'POST',
|
1129 |
-
data: {'email' : current_email},
|
1130 |
-
callback: function (result) {
|
1131 |
-
if (result.result) {
|
1132 |
-
ctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};
|
1133 |
-
ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));
|
1134 |
-
}
|
1135 |
-
},
|
1136 |
-
}
|
1137 |
-
);
|
1138 |
-
// Using AJAX request and handler
|
1139 |
-
} else if( ctPublicFunctions.data__ajax_type === 'admin_ajax' ) {
|
1140 |
-
apbct_public_sendAJAX(
|
1141 |
-
{
|
1142 |
-
action: 'apbct_email_check_before_post',
|
1143 |
-
email : current_email,
|
1144 |
-
},
|
1145 |
-
{
|
1146 |
-
callback: function (result) {
|
1147 |
-
if (result.result) {
|
1148 |
-
ctCheckedEmails[current_email] = {'result' : result.result, 'timestamp': Date.now() / 1000 |0};
|
1149 |
-
ctSetCookie('ct_checked_emails', JSON.stringify(ctCheckedEmails));
|
1150 |
-
}
|
1151 |
-
},
|
1152 |
-
}
|
1153 |
-
);
|
1154 |
-
}
|
1155 |
-
}
|
1156 |
-
}
|
1157 |
-
|
1158 |
-
function ctSetPixelImg(pixelUrl) {
|
1159 |
-
ctSetCookie('apbct_pixel_url', pixelUrl);
|
1160 |
-
if( +ctPublic.pixel__enabled ){
|
1161 |
-
if( ! document.getElementById('apbct_pixel') ) {
|
1162 |
-
let insertedImg = document.createElement('img');
|
1163 |
-
insertedImg.setAttribute('alt', 'CleanTalk Pixel');
|
1164 |
-
insertedImg.setAttribute('id', 'apbct_pixel');
|
1165 |
-
insertedImg.setAttribute('style', 'display: none; left: 99999px;');
|
1166 |
-
insertedImg.setAttribute('src', pixelUrl);
|
1167 |
-
apbct('body').append(insertedImg);
|
1168 |
-
}
|
1169 |
-
}
|
1170 |
-
}
|
1171 |
-
|
1172 |
-
function ctGetPixelUrl() {
|
1173 |
-
// Check if pixel is already in localstorage and is not outdated
|
1174 |
-
let local_storage_pixel_url = apbctLocalStorage.get('apbct_pixel_url');
|
1175 |
-
if ( local_storage_pixel_url !== false ) {
|
1176 |
-
if ( apbctLocalStorage.isAlive('apbct_pixel_url', 3600 * 3) ) {
|
1177 |
-
apbctLocalStorage.delete('apbct_pixel_url')
|
1178 |
-
} else {
|
1179 |
-
//if so - load pixel from localstorage and draw it skipping AJAX
|
1180 |
-
ctSetPixelImg(local_storage_pixel_url);
|
1181 |
-
return;
|
1182 |
-
}
|
1183 |
-
}
|
1184 |
-
// Using REST API handler
|
1185 |
-
if( ctPublicFunctions.data__ajax_type === 'rest' ){
|
1186 |
-
apbct_public_sendREST(
|
1187 |
-
'apbct_get_pixel_url',
|
1188 |
-
{
|
1189 |
-
method: 'POST',
|
1190 |
-
callback: function (result) {
|
1191 |
-
if (result) {
|
1192 |
-
//set pixel url to localstorage
|
1193 |
-
if ( ! apbctLocalStorage.get('apbct_pixel_url') ){
|
1194 |
-
//set pixel to the storage
|
1195 |
-
apbctLocalStorage.set('apbct_pixel_url', result)
|
1196 |
-
//update pixel data in the hidden fields
|
1197 |
-
ctNoCookieAttachHiddenFieldsToForms()
|
1198 |
-
}
|
1199 |
-
//then run pixel drawing
|
1200 |
-
ctSetPixelImg(result);
|
1201 |
-
}
|
1202 |
-
},
|
1203 |
-
}
|
1204 |
-
);
|
1205 |
-
// Using AJAX request and handler
|
1206 |
-
}else{
|
1207 |
-
apbct_public_sendAJAX(
|
1208 |
-
{
|
1209 |
-
action: 'apbct_get_pixel_url',
|
1210 |
-
},
|
1211 |
-
{
|
1212 |
-
notJson: true,
|
1213 |
-
callback: function (result) {
|
1214 |
-
if (result) {
|
1215 |
-
//set pixel url to localstorage
|
1216 |
-
if ( ! apbctLocalStorage.get('apbct_pixel_url') ){
|
1217 |
-
//set pixel to the storage
|
1218 |
-
apbctLocalStorage.set('apbct_pixel_url', result)
|
1219 |
-
//update pixel data in the hidden fields
|
1220 |
-
ctNoCookieAttachHiddenFieldsToForms()
|
1221 |
-
}
|
1222 |
-
//then run pixel drawing
|
1223 |
-
ctSetPixelImg(result);
|
1224 |
-
}
|
1225 |
-
},
|
1226 |
-
}
|
1227 |
-
);
|
1228 |
-
}
|
1229 |
-
}
|
1230 |
-
|
1231 |
-
function ctSetHasScrolled() {
|
1232 |
-
if( ! apbctLocalStorage.isSet('ct_has_scrolled') || ! apbctLocalStorage.get('ct_has_scrolled') ) {
|
1233 |
-
ctSetCookie("ct_has_scrolled", 'true');
|
1234 |
-
apbctLocalStorage.set('ct_has_scrolled', true);
|
1235 |
-
}
|
1236 |
-
}
|
1237 |
-
|
1238 |
-
function ctSetMouseMoved() {
|
1239 |
-
if( ! apbctLocalStorage.isSet('ct_mouse_moved') || ! apbctLocalStorage.get('ct_mouse_moved') ) {
|
1240 |
-
ctSetCookie("ct_mouse_moved", 'true');
|
1241 |
-
apbctLocalStorage.set('ct_mouse_moved', true);
|
1242 |
-
}
|
1243 |
-
}
|
1244 |
-
|
1245 |
-
function ctPreloadLocalStorage(){
|
1246 |
-
if (ctPublic.data__to_local_storage){
|
1247 |
-
let data = Object.entries(ctPublic.data__to_local_storage)
|
1248 |
-
data.forEach(([key, value]) => {
|
1249 |
-
apbctLocalStorage.set(key,value)
|
1250 |
-
});
|
1251 |
-
}
|
1252 |
-
}
|
1253 |
-
|
1254 |
-
apbct_attach_event_handler(window, "mousemove", ctFunctionMouseMove);
|
1255 |
-
apbct_attach_event_handler(window, "mousedown", ctFunctionFirstKey);
|
1256 |
-
apbct_attach_event_handler(window, "keydown", ctFunctionFirstKey);
|
1257 |
-
apbct_attach_event_handler(window, "scroll", ctSetHasScrolled);
|
1258 |
-
|
1259 |
-
// Ready function
|
1260 |
-
function apbct_ready(){
|
1261 |
-
|
1262 |
-
ctPreloadLocalStorage()
|
1263 |
-
|
1264 |
-
let cookiesType = apbctLocalStorage.get('ct_cookies_type');
|
1265 |
-
if ( ! cookiesType || cookiesType !== ctPublic.data__cookies_type ) {
|
1266 |
-
apbctLocalStorage.set('ct_cookies_type', ctPublic.data__cookies_type);
|
1267 |
-
apbctLocalStorage.delete('ct_mouse_moved');
|
1268 |
-
apbctLocalStorage.delete('ct_has_scrolled');
|
1269 |
-
}
|
1270 |
-
|
1271 |
-
// Collect scrolling info
|
1272 |
-
var initCookies = [
|
1273 |
-
["ct_ps_timestamp", Math.floor(new Date().getTime() / 1000)],
|
1274 |
-
["ct_fkp_timestamp", "0"],
|
1275 |
-
["ct_pointer_data", "0"],
|
1276 |
-
["ct_timezone", ct_date.getTimezoneOffset()/60*(-1) ],
|
1277 |
-
["ct_screen_info", apbctGetScreenInfo()],
|
1278 |
-
["apbct_headless", navigator.webdriver],
|
1279 |
-
];
|
1280 |
-
|
1281 |
-
apbctLocalStorage.set('ct_ps_timestamp', Math.floor(new Date().getTime() / 1000));
|
1282 |
-
apbctLocalStorage.set('ct_fkp_timestamp', "0");
|
1283 |
-
apbctLocalStorage.set('ct_pointer_data', "0");
|
1284 |
-
apbctLocalStorage.set('ct_timezone', ct_date.getTimezoneOffset()/60*(-1) );
|
1285 |
-
apbctLocalStorage.set('ct_screen_info', apbctGetScreenInfo());
|
1286 |
-
apbctLocalStorage.set('apbct_headless', navigator.webdriver);
|
1287 |
-
|
1288 |
-
if( ctPublic.data__cookies_type !== 'native' ) {
|
1289 |
-
initCookies.push(['apbct_visible_fields', '0']);
|
1290 |
-
} else {
|
1291 |
-
// Delete all visible fields cookies on load the page
|
1292 |
-
var cookiesArray = document.cookie.split(";");
|
1293 |
-
if( cookiesArray.length !== 0 ) {
|
1294 |
-
for ( var i = 0; i < cookiesArray.length; i++ ) {
|
1295 |
-
var currentCookie = cookiesArray[i].trim();
|
1296 |
-
var cookieName = currentCookie.split("=")[0];
|
1297 |
-
if( cookieName.indexOf("apbct_visible_fields_") === 0 ) {
|
1298 |
-
ctDeleteCookie(cookieName);
|
1299 |
-
}
|
1300 |
-
}
|
1301 |
-
}
|
1302 |
-
}
|
1303 |
-
|
1304 |
-
if( +ctPublic.pixel__setting ){
|
1305 |
-
if( +ctPublic.pixel__enabled ){
|
1306 |
-
ctGetPixelUrl()
|
1307 |
-
} else {
|
1308 |
-
initCookies.push(['apbct_pixel_url', ctPublic.pixel__url]);
|
1309 |
-
}
|
1310 |
-
}
|
1311 |
-
|
1312 |
-
if ( +ctPublic.data__email_check_before_post) {
|
1313 |
-
initCookies.push(['ct_checked_emails', '0']);
|
1314 |
-
apbct("input[type = 'email'], #email").on('blur', checkEmail);
|
1315 |
-
}
|
1316 |
-
|
1317 |
-
if (apbctLocalStorage.isSet('ct_checkjs')) {
|
1318 |
-
initCookies.push(['ct_checkjs', apbctLocalStorage.get('ct_checkjs')]);
|
1319 |
-
} else {
|
1320 |
-
initCookies.push(['ct_checkjs', 0]);
|
1321 |
-
}
|
1322 |
-
|
1323 |
-
ctSetCookie(initCookies);
|
1324 |
-
|
1325 |
-
setTimeout(function(){
|
1326 |
-
|
1327 |
-
ctNoCookieAttachHiddenFieldsToForms()
|
1328 |
-
|
1329 |
-
for(var i = 0; i < document.forms.length; i++){
|
1330 |
-
var form = document.forms[i];
|
1331 |
-
|
1332 |
-
//Exclusion for forms
|
1333 |
-
if (
|
1334 |
-
+ctPublic.data__visible_fields_required === 0 ||
|
1335 |
-
form.method.toString().toLowerCase() === 'get' ||
|
1336 |
-
form.classList.contains('slp_search_form') || //StoreLocatorPlus form
|
1337 |
-
form.parentElement.classList.contains('mec-booking') ||
|
1338 |
-
form.action.toString().indexOf('activehosted.com') !== -1 || // Active Campaign
|
1339 |
-
(form.id && form.id === 'caspioform') || //Caspio Form
|
1340 |
-
(form.classList && form.classList.contains('tinkoffPayRow')) || // TinkoffPayForm
|
1341 |
-
(form.classList && form.classList.contains('give-form')) || // GiveWP
|
1342 |
-
(form.id && form.id === 'ult-forgot-password-form') || //ult forgot password
|
1343 |
-
(form.id && form.id.toString().indexOf('calculatedfields') !== -1) || // CalculatedFieldsForm
|
1344 |
-
(form.id && form.id.toString().indexOf('sac-form') !== -1) || // Simple Ajax Chat
|
1345 |
-
(form.id && form.id.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form
|
1346 |
-
(form.name && form.name.toString().indexOf('cp_tslotsbooking_pform') !== -1) || // WP Time Slots Booking Form
|
1347 |
-
form.action.toString() === 'https://epayment.epymtservice.com/epay.jhtml' || // Custom form
|
1348 |
-
(form.name && form.name.toString().indexOf('tribe-bar-form') !== -1) // The Events Calendar
|
1349 |
-
) {
|
1350 |
-
continue;
|
1351 |
-
}
|
1352 |
-
|
1353 |
-
var hiddenInput = document.createElement( 'input' );
|
1354 |
-
hiddenInput.setAttribute( 'type', 'hidden' );
|
1355 |
-
hiddenInput.setAttribute( 'id', 'apbct_visible_fields_' + i );
|
1356 |
-
hiddenInput.setAttribute( 'name', 'apbct_visible_fields');
|
1357 |
-
var visibleFieldsToInput = {};
|
1358 |
-
visibleFieldsToInput[0] = apbct_collect_visible_fields(form);
|
1359 |
-
hiddenInput.value = JSON.stringify(visibleFieldsToInput);
|
1360 |
-
form.append( hiddenInput );
|
1361 |
-
|
1362 |
-
form.onsubmit_prev = form.onsubmit;
|
1363 |
-
|
1364 |
-
form.ctFormIndex = i;
|
1365 |
-
form.onsubmit = function (event) {
|
1366 |
-
|
1367 |
-
if ( ctPublic.data__cookies_type !== 'native' && typeof event.target.ctFormIndex !== 'undefined' ) {
|
1368 |
-
|
1369 |
-
var visible_fields = {};
|
1370 |
-
visible_fields[0] = apbct_collect_visible_fields(this);
|
1371 |
-
console.log("visible_fields[0]" + visible_fields[0])
|
1372 |
-
apbct_visible_fields_set_cookie( visible_fields, event.target.ctFormIndex );
|
1373 |
-
}
|
1374 |
-
|
1375 |
-
// Call previous submit action
|
1376 |
-
if (event.target.onsubmit_prev instanceof Function) {
|
1377 |
-
setTimeout(function () {
|
1378 |
-
event.target.onsubmit_prev.call(event.target, event);
|
1379 |
-
}, 500);
|
1380 |
-
}
|
1381 |
-
};
|
1382 |
-
}
|
1383 |
-
|
1384 |
-
}, 1000);
|
1385 |
-
|
1386 |
-
// Listen clicks on encoded emails
|
1387 |
-
let decodedEmailNodes = document.querySelectorAll("[data-original-string]");
|
1388 |
-
if (decodedEmailNodes.length) {
|
1389 |
-
for (let i = 0; i < decodedEmailNodes.length; ++i) {
|
1390 |
-
if (
|
1391 |
-
decodedEmailNodes[i].parentElement.href ||
|
1392 |
-
decodedEmailNodes[i].parentElement.parentElement.href
|
1393 |
-
) {
|
1394 |
-
// Skip listening click on hyperlinks
|
1395 |
-
continue;
|
1396 |
-
}
|
1397 |
-
decodedEmailNodes[i].addEventListener('click', ctFillDecodedEmailHandler);
|
1398 |
-
}
|
1399 |
-
}
|
1400 |
-
}
|
1401 |
-
apbct_attach_event_handler(window, "DOMContentLoaded", apbct_ready);
|
1402 |
-
|
1403 |
-
function ctFillDecodedEmailHandler(event) {
|
1404 |
-
this.removeEventListener('click', ctFillDecodedEmailHandler);
|
1405 |
-
apbctAjaxEmailDecode(event, this);
|
1406 |
-
}
|
1407 |
-
|
1408 |
-
function apbctAjaxEmailDecode(event, baseElement){
|
1409 |
-
const element = event.target;
|
1410 |
-
const javascriptClientData = getJavascriptClientData();
|
1411 |
-
let data = {
|
1412 |
-
event_javascript_data: javascriptClientData,
|
1413 |
-
post_url: document.location.href,
|
1414 |
-
referrer: document.referrer,
|
1415 |
-
};
|
1416 |
-
|
1417 |
-
if (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {
|
1418 |
-
event.preventDefault();
|
1419 |
-
} else {
|
1420 |
-
element.setAttribute('title', ctPublicFunctions.text__wait_for_decoding);
|
1421 |
-
element.style.cursor = 'progress';
|
1422 |
-
|
1423 |
-
// Adding a tooltip
|
1424 |
-
let apbctTooltip = document.createElement('div');
|
1425 |
-
apbctTooltip.setAttribute('class', 'apbct-tooltip');
|
1426 |
-
let apbctTooltipText = document.createElement('div');
|
1427 |
-
apbctTooltipText.setAttribute('class', 'apbct-tooltip--text');
|
1428 |
-
let apbctTooltipArrow = document.createElement('div');
|
1429 |
-
apbctTooltipArrow.setAttribute('class', 'apbct-tooltip--arrow');
|
1430 |
-
apbct(element).append(apbctTooltip);
|
1431 |
-
apbct(apbctTooltip).append(apbctTooltipText);
|
1432 |
-
apbct(apbctTooltip).append(apbctTooltipArrow);
|
1433 |
-
ctShowDecodeComment(element, ctPublicFunctions.text__wait_for_decoding);
|
1434 |
-
}
|
1435 |
-
|
1436 |
-
let encodedEmail = event.target.dataset.originalString;
|
1437 |
-
|
1438 |
-
if (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {
|
1439 |
-
encodedEmail = baseElement.dataset.originalString;
|
1440 |
-
}
|
1441 |
-
|
1442 |
-
data.encodedEmail = encodedEmail;
|
1443 |
-
|
1444 |
-
// Using REST API handler
|
1445 |
-
if( ctPublicFunctions.data__ajax_type === 'rest' ){
|
1446 |
-
apbct_public_sendREST(
|
1447 |
-
'apbct_decode_email',
|
1448 |
-
{
|
1449 |
-
data: data,
|
1450 |
-
method: 'POST',
|
1451 |
-
callback: function (result) {
|
1452 |
-
if (result.success) {
|
1453 |
-
if (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {
|
1454 |
-
let encodedEmail = baseElement.href.replace('mailto:', '');
|
1455 |
-
let baseElementContent = baseElement.innerHTML;
|
1456 |
-
baseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);
|
1457 |
-
baseElement.href = 'mailto:' + result.data.decoded_email;
|
1458 |
-
baseElement.click();
|
1459 |
-
} else {
|
1460 |
-
setTimeout(function(){
|
1461 |
-
ctProcessDecodedDataResult(result.data, event.target);
|
1462 |
-
}, 3000);
|
1463 |
-
}
|
1464 |
-
}
|
1465 |
-
setTimeout(function () {
|
1466 |
-
apbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);
|
1467 |
-
}, 4000);
|
1468 |
-
},
|
1469 |
-
onErrorCallback: function (res) {
|
1470 |
-
element.addEventListener('click', ctFillDecodedEmailHandler);
|
1471 |
-
element.removeAttribute('style');
|
1472 |
-
ctShowDecodeComment(element, 'Error occurred: ' + res);
|
1473 |
-
},
|
1474 |
-
}
|
1475 |
-
);
|
1476 |
-
|
1477 |
-
// Using AJAX request and handler
|
1478 |
-
}else{
|
1479 |
-
data.action = 'apbct_decode_email';
|
1480 |
-
apbct_public_sendAJAX(
|
1481 |
-
data,
|
1482 |
-
{
|
1483 |
-
notJson: true,
|
1484 |
-
callback: function (result) {
|
1485 |
-
if (result.success) {
|
1486 |
-
if (typeof baseElement.href !== 'undefined' && baseElement.href.indexOf('mailto:') === 0) {
|
1487 |
-
let encodedEmail = baseElement.href.replace('mailto:', '');
|
1488 |
-
let baseElementContent = baseElement.innerHTML;
|
1489 |
-
baseElement.innerHTML = baseElementContent.replace(encodedEmail, result.data.decoded_email);
|
1490 |
-
baseElement.href = 'mailto:' + result.data.decoded_email;
|
1491 |
-
baseElement.click();
|
1492 |
-
} else {
|
1493 |
-
setTimeout(function(){
|
1494 |
-
ctProcessDecodedDataResult(result.data, event.target);
|
1495 |
-
}, 3000);
|
1496 |
-
}
|
1497 |
-
}
|
1498 |
-
setTimeout(function () {
|
1499 |
-
apbct(element.getElementsByClassName('apbct-tooltip')).fadeOut(700);
|
1500 |
-
}, 4000);
|
1501 |
-
},
|
1502 |
-
onErrorCallback: function (res) {
|
1503 |
-
element.addEventListener('click', ctFillDecodedEmailHandler);
|
1504 |
-
element.removeAttribute('style');
|
1505 |
-
ctShowDecodeComment(element, 'Error occurred: ' + res);
|
1506 |
-
},
|
1507 |
-
}
|
1508 |
-
);
|
1509 |
-
}
|
1510 |
-
}
|
1511 |
-
|
1512 |
-
function getJavascriptClientData(common_cookies = []) {
|
1513 |
-
let resultDataJson = {};
|
1514 |
-
|
1515 |
-
resultDataJson.apbct_headless = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_headless');
|
1516 |
-
resultDataJson.apbct_pixel_url = ctGetCookie(ctPublicFunctions.cookiePrefix + 'apbct_pixel_url');
|
1517 |
-
resultDataJson.ct_checked_emails = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checked_emails');
|
1518 |
-
resultDataJson.ct_checkjs = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_checkjs');
|
1519 |
-
resultDataJson.ct_fkp_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_fkp_timestamp');
|
1520 |
-
resultDataJson.ct_pointer_data = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_pointer_data');
|
1521 |
-
resultDataJson.ct_ps_timestamp = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_ps_timestamp');
|
1522 |
-
resultDataJson.ct_screen_info = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_screen_info');
|
1523 |
-
resultDataJson.ct_timezone = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_timezone');
|
1524 |
-
|
1525 |
-
// collecting data from localstorage
|
1526 |
-
const ctMouseMovedLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');
|
1527 |
-
const ctHasScrolledLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');
|
1528 |
-
const ctCookiesTypeLocalStorage = apbctLocalStorage.get(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');
|
1529 |
-
|
1530 |
-
// collecting data from cookies
|
1531 |
-
const ctMouseMovedCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_mouse_moved');
|
1532 |
-
const ctHasScrolledCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_has_scrolled');
|
1533 |
-
const ctCookiesTypeCookie = ctGetCookie(ctPublicFunctions.cookiePrefix + 'ct_cookies_type');
|
1534 |
-
|
1535 |
-
resultDataJson.ct_mouse_moved = ctMouseMovedLocalStorage !== undefined ? ctMouseMovedLocalStorage : ctMouseMovedCookie;
|
1536 |
-
resultDataJson.ct_has_scrolled = ctHasScrolledLocalStorage !== undefined ? ctHasScrolledLocalStorage : ctHasScrolledCookie;
|
1537 |
-
resultDataJson.ct_cookies_type = ctCookiesTypeLocalStorage !== undefined ? ctCookiesTypeLocalStorage : ctCookiesTypeCookie;
|
1538 |
-
|
1539 |
-
if (
|
1540 |
-
typeof (common_cookies) === "object"
|
1541 |
-
&& common_cookies !== []
|
1542 |
-
){
|
1543 |
-
for (let i = 0; i < common_cookies.length; ++i){
|
1544 |
-
if ( typeof (common_cookies[i][1]) === "object" ){
|
1545 |
-
//this is for handle SFW cookies
|
1546 |
-
resultDataJson[common_cookies[i][1][0]] = common_cookies[i][1][1]
|
1547 |
-
} else {
|
1548 |
-
resultDataJson[common_cookies[i][0]] = common_cookies[i][1]
|
1549 |
-
}
|
1550 |
-
}
|
1551 |
-
} else {
|
1552 |
-
console.log('APBCT JS ERROR: Collecting data type mismatch')
|
1553 |
-
}
|
1554 |
-
|
1555 |
-
// Parse JSON properties to prevent double JSON encoding
|
1556 |
-
resultDataJson = removeDoubleJsonEncoding(resultDataJson);
|
1557 |
-
|
1558 |
-
return JSON.stringify(resultDataJson);
|
1559 |
-
}
|
1560 |
-
|
1561 |
-
/**
|
1562 |
-
* Recursive
|
1563 |
-
*
|
1564 |
-
* Recursively decode JSON-encoded properties
|
1565 |
-
*
|
1566 |
-
* @param object
|
1567 |
-
* @returns {*}
|
1568 |
-
*/
|
1569 |
-
function removeDoubleJsonEncoding(object){
|
1570 |
-
|
1571 |
-
if( typeof object === 'object'){
|
1572 |
-
|
1573 |
-
for (let objectKey in object) {
|
1574 |
-
|
1575 |
-
// Recursion
|
1576 |
-
if( typeof object[objectKey] === 'object'){
|
1577 |
-
object[objectKey] = removeDoubleJsonEncoding(object[objectKey]);
|
1578 |
-
}
|
1579 |
-
|
1580 |
-
// Common case (out)
|
1581 |
-
if(
|
1582 |
-
typeof object[objectKey] === 'string' &&
|
1583 |
-
object[objectKey].match(/^[\[{].*?[\]}]$/) !== null // is like JSON
|
1584 |
-
){
|
1585 |
-
let parsedValue = JSON.parse(object[objectKey]);
|
1586 |
-
if( typeof parsedValue === 'object' ){
|
1587 |
-
object[objectKey] = parsedValue;
|
1588 |
-
}
|
1589 |
-
}
|
1590 |
-
}
|
1591 |
-
}
|
1592 |
-
|
1593 |
-
return object;
|
1594 |
-
}
|
1595 |
-
|
1596 |
-
function ctProcessDecodedDataResult(response, targetElement) {
|
1597 |
-
|
1598 |
-
targetElement.setAttribute('title', '');
|
1599 |
-
targetElement.removeAttribute('style');
|
1600 |
-
|
1601 |
-
if( !! response.is_allowed) {
|
1602 |
-
ctFillDecodedEmail(targetElement, response.decoded_email);
|
1603 |
-
}
|
1604 |
-
|
1605 |
-
if( !! response.show_comment ){
|
1606 |
-
ctShowDecodeComment(targetElement, response.comment);
|
1607 |
-
}
|
1608 |
-
}
|
1609 |
-
|
1610 |
-
function ctFillDecodedEmail(target, email){
|
1611 |
-
apbct(target).html(
|
1612 |
-
apbct(target)
|
1613 |
-
.html()
|
1614 |
-
.replace(/.+?(<div class=["']apbct-tooltip["'].+?<\/div>)/, email + "$1")
|
1615 |
-
);
|
1616 |
-
}
|
1617 |
-
|
1618 |
-
function ctShowDecodeComment(target, comment){
|
1619 |
-
|
1620 |
-
if( ! comment ){
|
1621 |
-
return;
|
1622 |
-
}
|
1623 |
-
|
1624 |
-
apbct(target.getElementsByClassName('apbct-tooltip')).fadeIn(300);
|
1625 |
-
apbct(target.getElementsByClassName('apbct-tooltip--text')).html(comment);
|
1626 |
-
setTimeout(function(){
|
1627 |
-
apbct(target.getElementsByClassName('apbct-tooltip')).fadeOut(700);
|
1628 |
-
}, 5000);
|
1629 |
-
}
|
1630 |
-
|
1631 |
-
function apbct_collect_visible_fields( form ) {
|
1632 |
-
|
1633 |
-
// Get only fields
|
1634 |
-
var inputs = [],
|
1635 |
-
inputs_visible = '',
|
1636 |
-
inputs_visible_count = 0,
|
1637 |
-
inputs_invisible = '',
|
1638 |
-
inputs_invisible_count = 0,
|
1639 |
-
inputs_with_duplicate_names = [];
|
1640 |
-
|
1641 |
-
for(var key in form.elements){
|
1642 |
-
if(!isNaN(+key))
|
1643 |
-
inputs[key] = form.elements[key];
|
1644 |
-
}
|
1645 |
-
|
1646 |
-
// Filter fields
|
1647 |
-
inputs = inputs.filter(function(elem){
|
1648 |
-
|
1649 |
-
// Filter already added fields
|
1650 |
-
if( inputs_with_duplicate_names.indexOf( elem.getAttribute('name') ) !== -1 ){
|
1651 |
-
return false;
|
1652 |
-
}
|
1653 |
-
// Filter inputs with same names for type == radio
|
1654 |
-
if( -1 !== ['radio', 'checkbox'].indexOf( elem.getAttribute("type") )){
|
1655 |
-
inputs_with_duplicate_names.push( elem.getAttribute('name') );
|
1656 |
-
return false;
|
1657 |
-
}
|
1658 |
-
return true;
|
1659 |
-
});
|
1660 |
-
|
1661 |
-
// Visible fields
|
1662 |
-
inputs.forEach(function(elem, i, elements){
|
1663 |
-
// Unnecessary fields
|
1664 |
-
if(
|
1665 |
-
elem.getAttribute("type") === "submit" || // type == submit
|
1666 |
-
elem.getAttribute('name') === null ||
|
1667 |
-
elem.getAttribute('name') === 'ct_checkjs'
|
1668 |
-
) {
|
1669 |
-
return;
|
1670 |
-
}
|
1671 |
-
// Invisible fields
|
1672 |
-
if(
|
1673 |
-
getComputedStyle(elem).display === "none" || // hidden
|
1674 |
-
getComputedStyle(elem).visibility === "hidden" || // hidden
|
1675 |
-
getComputedStyle(elem).opacity === "0" || // hidden
|
1676 |
-
elem.getAttribute("type") === "hidden" // type == hidden
|
1677 |
-
) {
|
1678 |
-
if( elem.classList.contains("wp-editor-area") ) {
|
1679 |
-
inputs_visible += " " + elem.getAttribute("name");
|
1680 |
-
inputs_visible_count++;
|
1681 |
-
} else {
|
1682 |
-
inputs_invisible += " " + elem.getAttribute("name");
|
1683 |
-
inputs_invisible_count++;
|
1684 |
-
}
|
1685 |
-
}
|
1686 |
-
// Visible fields
|
1687 |
-
else {
|
1688 |
-
inputs_visible += " " + elem.getAttribute("name");
|
1689 |
-
inputs_visible_count++;
|
1690 |
-
}
|
1691 |
-
|
1692 |
-
});
|
1693 |
-
|
1694 |
-
inputs_invisible = inputs_invisible.trim();
|
1695 |
-
inputs_visible = inputs_visible.trim();
|
1696 |
-
|
1697 |
-
return {
|
1698 |
-
visible_fields : inputs_visible,
|
1699 |
-
visible_fields_count : inputs_visible_count,
|
1700 |
-
invisible_fields : inputs_invisible,
|
1701 |
-
invisible_fields_count : inputs_invisible_count,
|
1702 |
-
}
|
1703 |
-
|
1704 |
-
}
|
1705 |
-
|
1706 |
-
function apbct_visible_fields_set_cookie( visible_fields_collection, form_id ) {
|
1707 |
-
|
1708 |
-
var collection = typeof visible_fields_collection === 'object' && visible_fields_collection !== null ? visible_fields_collection : {};
|
1709 |
-
|
1710 |
-
if( ctPublic.data__cookies_type === 'native' ) {
|
1711 |
-
for ( var i in collection ) {
|
1712 |
-
if ( i > 10 ) {
|
1713 |
-
// Do not generate more than 10 cookies
|
1714 |
-
return;
|
1715 |
-
}
|
1716 |
-
var collectionIndex = form_id !== undefined ? form_id : i;
|
1717 |
-
ctSetCookie("apbct_visible_fields_" + collectionIndex, JSON.stringify( collection[i] ) );
|
1718 |
-
}
|
1719 |
-
} else {
|
1720 |
-
if (ctPublic.data__cookies_type === 'none'){
|
1721 |
-
ctSetCookie("apbct_visible_fields", JSON.stringify( collection[0] ) );
|
1722 |
-
} else {
|
1723 |
-
ctSetCookie("apbct_visible_fields", JSON.stringify( collection ) );
|
1724 |
-
}
|
1725 |
-
|
1726 |
-
}
|
1727 |
-
}
|
1728 |
-
|
1729 |
-
function apbct_js_keys__set_input_value(result, data, params, obj){
|
1730 |
-
if( document.querySelectorAll('[name^=ct_checkjs]').length > 0 ) {
|
1731 |
-
var elements = document.querySelectorAll('[name^=ct_checkjs]');
|
1732 |
-
for ( var i = 0; i < elements.length; i++ ) {
|
1733 |
-
elements[i].value = result.js_key;
|
1734 |
-
}
|
1735 |
-
}
|
1736 |
-
}
|
1737 |
-
|
1738 |
-
function apbctGetScreenInfo() {
|
1739 |
-
return JSON.stringify({
|
1740 |
-
fullWidth : document.documentElement.scrollWidth,
|
1741 |
-
fullHeight : Math.max(
|
1742 |
-
document.body.scrollHeight, document.documentElement.scrollHeight,
|
1743 |
-
document.body.offsetHeight, document.documentElement.offsetHeight,
|
1744 |
-
document.body.clientHeight, document.documentElement.clientHeight
|
1745 |
-
),
|
1746 |
-
visibleWidth : document.documentElement.clientWidth,
|
1747 |
-
visibleHeight : document.documentElement.clientHeight,
|
1748 |
-
});
|
1749 |
-
}
|
1750 |
-
|
1751 |
-
if(typeof jQuery !== 'undefined') {
|
1752 |
-
|
1753 |
-
// Capturing responses and output block message for unknown AJAX forms
|
1754 |
-
jQuery(document).ajaxComplete(function (event, xhr, settings) {
|
1755 |
-
if (xhr.responseText && xhr.responseText.indexOf('"apbct') !== -1) {
|
1756 |
-
try {
|
1757 |
-
var response = JSON.parse(responseText);
|
1758 |
-
} catch (e) {
|
1759 |
-
console.log(e.toString());
|
1760 |
-
return;
|
1761 |
-
}
|
1762 |
-
ctParseBlockMessage(response);
|
1763 |
-
}
|
1764 |
-
});
|
1765 |
-
}
|
1766 |
-
|
1767 |
-
function ctParseBlockMessage(response) {
|
1768 |
-
|
1769 |
-
if (typeof response.apbct !== 'undefined') {
|
1770 |
-
response = response.apbct;
|
1771 |
-
if (response.blocked) {
|
1772 |
-
document.dispatchEvent(
|
1773 |
-
new CustomEvent( "apbctAjaxBockAlert", {
|
1774 |
-
bubbles: true,
|
1775 |
-
detail: { message: response.comment }
|
1776 |
-
} )
|
1777 |
-
);
|
1778 |
-
|
1779 |
-
// Show the result by modal
|
1780 |
-
cleantalkModal.loaded = response.comment;
|
1781 |
-
cleantalkModal.open();
|
1782 |
-
|
1783 |
-
if(+response.stop_script == 1)
|
1784 |
-
window.stop();
|
1785 |
-
}
|
1786 |
-
}
|
1787 |
-
}
|
1788 |
-
|
1789 |
-
function ctSetPixelUrlLocalstorage(ajax_pixel_url) {
|
1790 |
-
//set pixel to the storage
|
1791 |
-
ctSetCookie('apbct_pixel_url', ajax_pixel_url)
|
1792 |
-
}
|
1793 |
-
|
1794 |
-
function ctNoCookieConstructHiddenField(){
|
1795 |
-
let field = ''
|
1796 |
-
let no_cookie_data = apbctLocalStorage.getCleanTalkData()
|
1797 |
-
no_cookie_data = JSON.stringify(no_cookie_data)
|
1798 |
-
no_cookie_data = btoa(no_cookie_data)
|
1799 |
-
field = document.createElement('input')
|
1800 |
-
field.setAttribute('id','ct_no_cookie_hidden_field')
|
1801 |
-
field.setAttribute('name','ct_no_cookie_hidden_field')
|
1802 |
-
field.setAttribute('value', no_cookie_data)
|
1803 |
-
field.setAttribute('type', 'hidden')
|
1804 |
-
return field
|
1805 |
-
}
|
1806 |
-
|
1807 |
-
function ctNoCookieGetForms(){
|
1808 |
-
let forms = document.forms
|
1809 |
-
if (forms) {
|
1810 |
-
return forms
|
1811 |
-
}
|
1812 |
-
return false
|
1813 |
-
}
|
1814 |
-
|
1815 |
-
function ctNoCookieAttachHiddenFieldsToForms(){
|
1816 |
-
|
1817 |
-
if (ctPublic.data__cookies_type !== 'none'){
|
1818 |
-
return
|
1819 |
-
}
|
1820 |
-
|
1821 |
-
let forms = ctNoCookieGetForms()
|
1822 |
-
|
1823 |
-
if (forms){
|
1824 |
-
for ( let i = 0; i < forms.length; i++ ){
|
1825 |
-
//ignore forms with get method @todo We need to think about this
|
1826 |
-
if (document.forms[i].getAttribute('method') === null ||
|
1827 |
-
document.forms[i].getAttribute('method').toLowerCase() === 'post'){
|
1828 |
-
|
1829 |
-
let elements = document.getElementsByName('ct_no_cookie_hidden_field')
|
1830 |
-
//clear previous hidden set
|
1831 |
-
if (elements){
|
1832 |
-
for (let j = 0; j < elements.length; j++) {
|
1833 |
-
elements[j].parentNode.removeChild(elements[j])
|
1834 |
-
}
|
1835 |
-
}
|
1836 |
-
// add new set
|
1837 |
-
document.forms[i].append(ctNoCookieConstructHiddenField())
|
1838 |
-
}
|
1839 |
-
}
|
1840 |
-
}
|
1841 |
-
|
1842 |
-
}
|
1843 |
-
/* Cleantalk Modal object */
|
1844 |
-
cleantalkModal = {
|
1845 |
-
|
1846 |
-
// Flags
|
1847 |
-
loaded: false,
|
1848 |
-
loading: false,
|
1849 |
-
opened: false,
|
1850 |
-
opening: false,
|
1851 |
-
|
1852 |
-
// Methods
|
1853 |
-
load: function( action ) {
|
1854 |
-
if( ! this.loaded ) {
|
1855 |
-
this.loading = true;
|
1856 |
-
callback = function( result, data, params, obj ) {
|
1857 |
-
cleantalkModal.loading = false;
|
1858 |
-
cleantalkModal.loaded = result;
|
1859 |
-
document.dispatchEvent(
|
1860 |
-
new CustomEvent( "cleantalkModalContentLoaded", {
|
1861 |
-
bubbles: true,
|
1862 |
-
} )
|
1863 |
-
);
|
1864 |
-
};
|
1865 |
-
if( typeof apbct_admin_sendAJAX === "function" ) {
|
1866 |
-
apbct_admin_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );
|
1867 |
-
} else {
|
1868 |
-
apbct_public_sendAJAX( { 'action' : action }, { 'callback': callback, 'notJson': true } );
|
1869 |
-
}
|
1870 |
-
|
1871 |
-
}
|
1872 |
-
},
|
1873 |
-
|
1874 |
-
open: function () {
|
1875 |
-
/* Cleantalk Modal CSS start */
|
1876 |
-
var renderCss = function () {
|
1877 |
-
var cssStr = '';
|
1878 |
-
for ( key in this.styles ) {
|
1879 |
-
cssStr += key + ':' + this.styles[key] + ';';
|
1880 |
-
}
|
1881 |
-
return cssStr;
|
1882 |
-
};
|
1883 |
-
var overlayCss = {
|
1884 |
-
styles: {
|
1885 |
-
"z-index": "9999",
|
1886 |
-
"position": "fixed",
|
1887 |
-
"top": "0",
|
1888 |
-
"left": "0",
|
1889 |
-
"width": "100%",
|
1890 |
-
"height": "100%",
|
1891 |
-
"background": "rgba(0,0,0,0.5)",
|
1892 |
-
"display": "flex",
|
1893 |
-
"justify-content" : "center",
|
1894 |
-
"align-items" : "center",
|
1895 |
-
},
|
1896 |
-
toString: renderCss
|
1897 |
-
};
|
1898 |
-
var innerCss = {
|
1899 |
-
styles: {
|
1900 |
-
"position" : "relative",
|
1901 |
-
"padding" : "30px",
|
1902 |
-
"background" : "#FFF",
|
1903 |
-
"border" : "1px solid rgba(0,0,0,0.75)",
|
1904 |
-
"border-radius" : "4px",
|
1905 |
-
"box-shadow" : "7px 7px 5px 0px rgba(50,50,50,0.75)",
|
1906 |
-
},
|
1907 |
-
toString: renderCss
|
1908 |
-
};
|
1909 |
-
var closeCss = {
|
1910 |
-
styles: {
|
1911 |
-
"position" : "absolute",
|
1912 |
-
"background" : "#FFF",
|
1913 |
-
"width" : "20px",
|
1914 |
-
"height" : "20px",
|
1915 |
-
"border" : "2px solid rgba(0,0,0,0.75)",
|
1916 |
-
"border-radius" : "15px",
|
1917 |
-
"cursor" : "pointer",
|
1918 |
-
"top" : "-8px",
|
1919 |
-
"right" : "-8px",
|
1920 |
-
"box-sizing" : "content-box",
|
1921 |
-
},
|
1922 |
-
toString: renderCss
|
1923 |
-
};
|
1924 |
-
var closeCssBefore = {
|
1925 |
-
styles: {
|
1926 |
-
"content" : "\"\"",
|
1927 |
-
"display" : "block",
|
1928 |
-
"position" : "absolute",
|
1929 |
-
"background" : "#000",
|
1930 |
-
"border-radius" : "1px",
|
1931 |
-
"width" : "2px",
|
1932 |
-
"height" : "16px",
|
1933 |
-
"top" : "2px",
|
1934 |
-
"left" : "9px",
|
1935 |
-
"transform" : "rotate(45deg)",
|
1936 |
-
},
|
1937 |
-
toString: renderCss
|
1938 |
-
};
|
1939 |
-
var closeCssAfter = {
|
1940 |
-
styles: {
|
1941 |
-
"content" : "\"\"",
|
1942 |
-
"display" : "block",
|
1943 |
-
"position" : "absolute",
|
1944 |
-
"background" : "#000",
|
1945 |
-
"border-radius" : "1px",
|
1946 |
-
"width" : "2px",
|
1947 |
-
"height" : "16px",
|
1948 |
-
"top" : "2px",
|
1949 |
-
"left" : "9px",
|
1950 |
-
"transform" : "rotate(-45deg)",
|
1951 |
-
},
|
1952 |
-
toString: renderCss
|
1953 |
-
};
|
1954 |
-
var bodyCss = {
|
1955 |
-
styles: {
|
1956 |
-
"overflow" : "hidden",
|
1957 |
-
},
|
1958 |
-
toString: renderCss
|
1959 |
-
};
|
1960 |
-
var cleantalkModalStyle = document.createElement( 'style' );
|
1961 |
-
cleantalkModalStyle.setAttribute( 'id', 'cleantalk-modal-styles' );
|
1962 |
-
cleantalkModalStyle.innerHTML = 'body.cleantalk-modal-opened{' + bodyCss + '}';
|
1963 |
-
cleantalkModalStyle.innerHTML += '#cleantalk-modal-overlay{' + overlayCss + '}';
|
1964 |
-
cleantalkModalStyle.innerHTML += '#cleantalk-modal-close{' + closeCss + '}';
|
1965 |
-
cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:before{' + closeCssBefore + '}';
|
1966 |
-
cleantalkModalStyle.innerHTML += '#cleantalk-modal-close:after{' + closeCssAfter + '}';
|
1967 |
-
document.body.append( cleantalkModalStyle );
|
1968 |
-
/* Cleantalk Modal CSS end */
|
1969 |
-
|
1970 |
-
var overlay = document.createElement( 'div' );
|
1971 |
-
overlay.setAttribute( 'id', 'cleantalk-modal-overlay' );
|
1972 |
-
document.body.append( overlay );
|
1973 |
-
|
1974 |
-
document.body.classList.add( 'cleantalk-modal-opened' );
|
1975 |
-
|
1976 |
-
var inner = document.createElement( 'div' );
|
1977 |
-
inner.setAttribute( 'id', 'cleantalk-modal-inner' );
|
1978 |
-
inner.setAttribute( 'style', innerCss );
|
1979 |
-
overlay.append( inner );
|
1980 |
-
|
1981 |
-
var close = document.createElement( 'div' );
|
1982 |
-
close.setAttribute( 'id', 'cleantalk-modal-close' );
|
1983 |
-
inner.append( close );
|
1984 |
-
|
1985 |
-
var content = document.createElement( 'div' );
|
1986 |
-
if ( this.loaded ) {
|
1987 |
-
content.innerHTML = this.loaded;
|
1988 |
-
} else {
|
1989 |
-
content.innerHTML = 'Loading...';
|
1990 |
-
// @ToDo Here is hardcoded parameter. Have to get this from a 'data-' attribute.
|
1991 |
-
this.load( 'get_options_template' );
|
1992 |
-
}
|
1993 |
-
content.setAttribute( 'id', 'cleantalk-modal-content' );
|
1994 |
-
inner.append( content );
|
1995 |
-
|
1996 |
-
this.opened = true;
|
1997 |
-
},
|
1998 |
-
|
1999 |
-
close: function () {
|
2000 |
-
document.body.classList.remove( 'cleantalk-modal-opened' );
|
2001 |
-
document.getElementById( 'cleantalk-modal-overlay' ).remove();
|
2002 |
-
document.getElementById( 'cleantalk-modal-styles' ).remove();
|
2003 |
-
document.dispatchEvent(
|
2004 |
-
new CustomEvent( "cleantalkModalClosed", {
|
2005 |
-
bubbles: true,
|
2006 |
-
} )
|
2007 |
-
);
|
2008 |
-
}
|
2009 |
-
|
2010 |
-
};
|
2011 |
-
|
2012 |
-
/* Cleantalk Modal helpers */
|
2013 |
-
document.addEventListener('click',function( e ){
|
2014 |
-
if( e.target && e.target.id === 'cleantalk-modal-overlay' || e.target.id === 'cleantalk-modal-close' ){
|
2015 |
-
cleantalkModal.close();
|
2016 |
-
}
|
2017 |
-
});
|
2018 |
-
document.addEventListener("cleantalkModalContentLoaded", function( e ) {
|
2019 |
-
if( cleantalkModal.opened && cleantalkModal.loaded ) {
|
2020 |
-
document.getElementById( 'cleantalk-modal-content' ).innerHTML = cleantalkModal.loaded;
|
2021 |
-
}
|
2022 |
-
});
|
2023 |
-
let buttons_to_handle = []
|
2024 |
-
let gdpr_notice_for_button = 'Please, apply the GDPR agreement.'
|
2025 |
-
|
2026 |
-
document.addEventListener('DOMContentLoaded', function(){
|
2027 |
-
buttons_to_handle = []
|
2028 |
-
if(
|
2029 |
-
typeof ctPublicGDPR === 'undefined' ||
|
2030 |
-
! ctPublicGDPR.gdpr_forms.length
|
2031 |
-
) {
|
2032 |
-
return;
|
2033 |
-
}
|
2034 |
-
|
2035 |
-
if ( typeof jQuery === 'undefined' ) {
|
2036 |
-
return;
|
2037 |
-
}
|
2038 |
-
try {
|
2039 |
-
ctPublicGDPR.gdpr_forms.forEach(function(item, i){
|
2040 |
-
|
2041 |
-
let elem = jQuery('#'+item+', .'+item);
|
2042 |
-
|
2043 |
-
// Filter forms
|
2044 |
-
if (!elem.is('form')){
|
2045 |
-
// Caldera
|
2046 |
-
if (elem.find('form')[0])
|
2047 |
-
elem = elem.children('form').first();
|
2048 |
-
// Contact Form 7
|
2049 |
-
else if(
|
2050 |
-
jQuery('.wpcf7[role=form]')[0] && jQuery('.wpcf7[role=form]')
|
2051 |
-
.attr('id')
|
2052 |
-
.indexOf('wpcf7-f'+item) !== -1
|
2053 |
-
) {
|
2054 |
-
elem = jQuery('.wpcf7[role=form]').children('form');
|
2055 |
-
}
|
2056 |
-
|
2057 |
-
// Formidable
|
2058 |
-
else if(jQuery('.frm_forms')[0] && jQuery('.frm_forms').first().attr('id').indexOf('frm_form_'+item) !== -1)
|
2059 |
-
elem = jQuery('.frm_forms').first().children('form');
|
2060 |
-
// WPForms
|
2061 |
-
else if(jQuery('.wpforms-form')[0] && jQuery('.wpforms-form').first().attr('id').indexOf('wpforms-form-'+item) !== -1)
|
2062 |
-
elem = jQuery('.wpforms-form');
|
2063 |
-
}
|
2064 |
-
|
2065 |
-
//disable forms buttons
|
2066 |
-
let button = false
|
2067 |
-
let buttons_collection= elem.find('input[type|="submit"]')
|
2068 |
-
|
2069 |
-
if (!buttons_collection.length) {
|
2070 |
-
return
|
2071 |
-
} else {
|
2072 |
-
button = buttons_collection[0]
|
2073 |
-
}
|
2074 |
-
|
2075 |
-
if (button !== false){
|
2076 |
-
console.log(buttons_collection)
|
2077 |
-
button.disabled = true
|
2078 |
-
let old_notice = jQuery(button).prop('title') ? jQuery(button).prop('title') : ''
|
2079 |
-
buttons_to_handle.push({index:i,button:button,old_notice:old_notice})
|
2080 |
-
jQuery(button).prop('title', gdpr_notice_for_button)
|
2081 |
-
}
|
2082 |
-
|
2083 |
-
// Adding notice and checkbox
|
2084 |
-
if(elem.is('form') || elem.attr('role') === 'form'){
|
2085 |
-
elem.append('<input id="apbct_gdpr_'+i+'" type="checkbox" required="required" style=" margin-right: 10px;" onchange="apbct_gdpr_handle_buttons()">')
|
2086 |
-
.append('<label style="display: inline;" for="apbct_gdpr_'+i+'">'+ctPublicGDPR.gdpr_text+'</label>');
|
2087 |
-
}
|
2088 |
-
});
|
2089 |
-
} catch (e) {
|
2090 |
-
console.info('APBCT GDPR JS ERROR: Can not add GDPR notice' + e)
|
2091 |
-
}
|
2092 |
-
});
|
2093 |
-
|
2094 |
-
function apbct_gdpr_handle_buttons(){
|
2095 |
-
|
2096 |
-
try {
|
2097 |
-
|
2098 |
-
if (buttons_to_handle === []){
|
2099 |
-
return
|
2100 |
-
}
|
2101 |
-
|
2102 |
-
buttons_to_handle.forEach((button) => {
|
2103 |
-
let selector = '[id="apbct_gdpr_' + button.index + '"]'
|
2104 |
-
let apbct_gdpr_item = jQuery(selector)
|
2105 |
-
//chek if apbct_gdpr checkbox is set
|
2106 |
-
if (jQuery(apbct_gdpr_item).prop("checked")){
|
2107 |
-
button.button.disabled = false
|
2108 |
-
jQuery(button.button).prop('title', button.old_notice)
|
2109 |
-
} else {
|
2110 |
-
button.button.disabled = true
|
2111 |
-
jQuery(button.button).prop('title', gdpr_notice_for_button)
|
2112 |
-
}
|
2113 |
-
})
|
2114 |
-
} catch (e) {
|
2115 |
-
console.info('APBCT GDPR JS ERROR: Can not handle form buttons ' + e)
|
2116 |
-
}
|
2117 |
-
}
|
2118 |
-
/**
|
2119 |
-
* Handle external forms
|
2120 |
-
*/
|
2121 |
-
function ct_protect_external() {
|
2122 |
-
for(var i = 0; i < document.forms.length; i++) {
|
2123 |
-
|
2124 |
-
if (document.forms[i].cleantalk_hidden_action === undefined && document.forms[i].cleantalk_hidden_method === undefined) {
|
2125 |
-
|
2126 |
-
// current form
|
2127 |
-
var currentForm = document.forms[i];
|
2128 |
-
|
2129 |
-
if (currentForm.parentElement && currentForm.parentElement.classList.length > 0 && currentForm.parentElement.classList[0].indexOf('mewtwo') !== -1){
|
2130 |
-
return
|
2131 |
-
}
|
2132 |
-
|
2133 |
-
if(typeof(currentForm.action) == 'string') {
|
2134 |
-
|
2135 |
-
// Ajax checking for the integrated forms
|
2136 |
-
if(isIntegratedForm(currentForm)) {
|
2137 |
-
|
2138 |
-
var cleantalk_placeholder = document.createElement("i");
|
2139 |
-
cleantalk_placeholder.className = 'cleantalk_placeholder';
|
2140 |
-
cleantalk_placeholder.style = 'display: none';
|
2141 |
-
currentForm.parentElement.insertBefore(cleantalk_placeholder, currentForm);
|
2142 |
-
|
2143 |
-
// Deleting form to prevent submit event
|
2144 |
-
var prev = currentForm.previousSibling,
|
2145 |
-
form_html = currentForm.outerHTML,
|
2146 |
-
form_original = currentForm;
|
2147 |
-
|
2148 |
-
// Remove the original form
|
2149 |
-
currentForm.parentElement.removeChild(currentForm);
|
2150 |
-
|
2151 |
-
// Insert a clone
|
2152 |
-
const placeholder = document.createElement("div");
|
2153 |
-
placeholder.innerHTML = form_html;
|
2154 |
-
prev.after(placeholder.firstElementChild);
|
2155 |
-
|
2156 |
-
var force_action = document.createElement("input");
|
2157 |
-
force_action.name = 'action';
|
2158 |
-
force_action.value = 'cleantalk_force_ajax_check';
|
2159 |
-
force_action.type = 'hidden';
|
2160 |
-
|
2161 |
-
let reUseCurrentForm = document.forms[i];
|
2162 |
-
|
2163 |
-
reUseCurrentForm.appendChild(force_action);
|
2164 |
-
reUseCurrentForm.apbctPrev = prev;
|
2165 |
-
reUseCurrentForm.apbctFormOriginal = form_original;
|
2166 |
-
|
2167 |
-
// mailerlite integration - disable click on submit button
|
2168 |
-
let mailerlite_detected_class = false
|
2169 |
-
if (reUseCurrentForm.classList !== undefined) {
|
2170 |
-
//list there all the mailerlite classes
|
2171 |
-
let mailerlite_classes = ['newsletterform', 'ml-block-form']
|
2172 |
-
mailerlite_classes.forEach(function(mailerlite_class) {
|
2173 |
-
if (reUseCurrentForm.classList.contains(mailerlite_class)){
|
2174 |
-
mailerlite_detected_class = mailerlite_class
|
2175 |
-
}
|
2176 |
-
});
|
2177 |
-
}
|
2178 |
-
if ( mailerlite_detected_class ) {
|
2179 |
-
let mailerliteSubmitButton = jQuery('form.' + mailerlite_detected_class).find('button[type="submit"]');
|
2180 |
-
if ( mailerliteSubmitButton !== undefined ) {
|
2181 |
-
mailerliteSubmitButton.click(function (event) {
|
2182 |
-
event.preventDefault();
|
2183 |
-
sendAjaxCheckingFormData(event.currentTarget);
|
2184 |
-
});
|
2185 |
-
}
|
2186 |
-
} else {
|
2187 |
-
document.forms[i].onsubmit = function ( event ){
|
2188 |
-
event.preventDefault();
|
2189 |
-
|
2190 |
-
const prev = jQuery(event.currentTarget).prev();
|
2191 |
-
const form_original = jQuery(event.currentTarget).clone();
|
2192 |
-
|
2193 |
-
sendAjaxCheckingFormData(event.currentTarget);
|
2194 |
-
};
|
2195 |
-
}
|
2196 |
-
|
2197 |
-
// Common flow - modify form's action
|
2198 |
-
}else if(currentForm.action.indexOf('http://') !== -1 || currentForm.action.indexOf('https://') !== -1) {
|
2199 |
-
|
2200 |
-
var tmp = currentForm.action.split('//');
|
2201 |
-
tmp = tmp[1].split('/');
|
2202 |
-
var host = tmp[0].toLowerCase();
|
2203 |
-
|
2204 |
-
if(host !== location.hostname.toLowerCase()){
|
2205 |
-
|
2206 |
-
var ct_action = document.createElement("input");
|
2207 |
-
ct_action.name = 'cleantalk_hidden_action';
|
2208 |
-
ct_action.value = currentForm.action;
|
2209 |
-
ct_action.type = 'hidden';
|
2210 |
-
currentForm.appendChild(ct_action);
|
2211 |
-
|
2212 |
-
var ct_method = document.createElement("input");
|
2213 |
-
ct_method.name = 'cleantalk_hidden_method';
|
2214 |
-
ct_method.value = currentForm.method;
|
2215 |
-
ct_method.type = 'hidden';
|
2216 |
-
|
2217 |
-
currentForm.method = 'POST'
|
2218 |
-
|
2219 |
-
currentForm.appendChild(ct_method);
|
2220 |
-
|
2221 |
-
currentForm.action = document.location;
|
2222 |
-
}
|
2223 |
-
}
|
2224 |
-
}
|
2225 |
-
}
|
2226 |
-
|
2227 |
-
}
|
2228 |
-
}
|
2229 |
-
function apbct_replace_inputs_values_from_other_form( form_source, form_target ){
|
2230 |
-
|
2231 |
-
var inputs_source = jQuery( form_source ).find( 'button, input, textarea, select' ),
|
2232 |
-
inputs_target = jQuery( form_target ).find( 'button, input, textarea, select' );
|
2233 |
-
|
2234 |
-
inputs_source.each( function( index, elem_source ){
|
2235 |
-
|
2236 |
-
var source = jQuery( elem_source );
|
2237 |
-
|
2238 |
-
inputs_target.each( function( index2, elem_target ){
|
2239 |
-
|
2240 |
-
var target = jQuery( elem_target );
|
2241 |
-
|
2242 |
-
if( elem_source.outerHTML === elem_target.outerHTML ){
|
2243 |
-
|
2244 |
-
target.val( source.val() );
|
2245 |
-
}
|
2246 |
-
});
|
2247 |
-
});
|
2248 |
-
|
2249 |
-
}
|
2250 |
-
window.onload = function () {
|
2251 |
-
|
2252 |
-
if( ! +ctPublic.settings__forms__check_external ) {
|
2253 |
-
return;
|
2254 |
-
}
|
2255 |
-
|
2256 |
-
if ( typeof jQuery === 'undefined' ) {
|
2257 |
-
return;
|
2258 |
-
}
|
2259 |
-
|
2260 |
-
setTimeout(function () {
|
2261 |
-
ct_protect_external()
|
2262 |
-
}, 1500);
|
2263 |
-
};
|
2264 |
-
|
2265 |
-
/**
|
2266 |
-
* Checking the form integration
|
2267 |
-
*/
|
2268 |
-
function isIntegratedForm(formObj) {
|
2269 |
-
var formAction = formObj.action;
|
2270 |
-
|
2271 |
-
if(
|
2272 |
-
formAction.indexOf('activehosted.com') !== -1 || // ActiveCampaign form
|
2273 |
-
formAction.indexOf('app.convertkit.com') !== -1 || // ConvertKit form
|
2274 |
-
( formObj.firstChild.classList !== undefined && formObj.firstChild.classList.contains('cb-form-group') ) || // Convertbox form
|
2275 |
-
formAction.indexOf('mailerlite.com') !== -1 || // Mailerlite integration
|
2276 |
-
formAction.indexOf('colcolmail.co.uk') !== -1 || // colcolmail.co.uk integration
|
2277 |
-
formAction.indexOf('paypal.com') !== -1 ||
|
2278 |
-
formAction.indexOf('infusionsoft.com') !== -1 ||
|
2279 |
-
formAction.indexOf('webto.salesforce.com') !== -1 ||
|
2280 |
-
formAction.indexOf('secure2.convio.net') !== -1 ||
|
2281 |
-
formAction.indexOf('hookb.in') !== -1 ||
|
2282 |
-
formAction.indexOf('external.url') !== -1 ||
|
2283 |
-
formAction.indexOf('tp.media') !== -1 ||
|
2284 |
-
formAction.indexOf('flodesk.com') !== -1 ||
|
2285 |
-
formAction.indexOf('sendfox.com') !== -1 ||
|
2286 |
-
formAction.indexOf('aweber.com') !== -1 ||
|
2287 |
-
formAction.indexOf('secure.payu.com') !== -1
|
2288 |
-
|
2289 |
-
) {
|
2290 |
-
return true;
|
2291 |
-
}
|
2292 |
-
|
2293 |
-
return false;
|
2294 |
-
}
|
2295 |
-
|
2296 |
-
/**
|
2297 |
-
* Sending Ajax for checking form data
|
2298 |
-
*/
|
2299 |
-
function sendAjaxCheckingFormData(form, prev, formOriginal) {
|
2300 |
-
// Get visible fields and set cookie
|
2301 |
-
var visible_fields = {};
|
2302 |
-
visible_fields[0] = apbct_collect_visible_fields(form);
|
2303 |
-
apbct_visible_fields_set_cookie( visible_fields );
|
2304 |
-
|
2305 |
-
var data = {};
|
2306 |
-
var elems = form.elements;
|
2307 |
-
elems = Array.prototype.slice.call(elems);
|
2308 |
-
|
2309 |
-
elems.forEach( function( elem, y ) {
|
2310 |
-
if( elem.name === '' ) {
|
2311 |
-
data['input_' + y] = elem.value;
|
2312 |
-
} else {
|
2313 |
-
data[elem.name] = elem.value;
|
2314 |
-
}
|
2315 |
-
});
|
2316 |
-
|
2317 |
-
apbct_public_sendAJAX(
|
2318 |
-
data,
|
2319 |
-
{
|
2320 |
-
async: false,
|
2321 |
-
callback: function( result, data, params, obj ){
|
2322 |
-
|
2323 |
-
if( result.apbct === undefined || ! +result.apbct.blocked ) {
|
2324 |
-
|
2325 |
-
let form_new = jQuery(form).detach();
|
2326 |
-
let prev = form.apbctPrev;
|
2327 |
-
let formOriginal = form.apbctFormOriginal;
|
2328 |
-
|
2329 |
-
apbct_replace_inputs_values_from_other_form(form_new, formOriginal);
|
2330 |
-
|
2331 |
-
prev.after( formOriginal );
|
2332 |
-
|
2333 |
-
// Clear visible_fields input
|
2334 |
-
jQuery(formOriginal).find('input[name="apbct_visible_fields"]').remove();
|
2335 |
-
jQuery(formOriginal).find('input[value="cleantalk_force_ajax_check"]').remove();
|
2336 |
-
|
2337 |
-
// Common click event
|
2338 |
-
var subm_button = jQuery(formOriginal).find('button[type=submit]');
|
2339 |
-
if( subm_button.length !== 0 ) {
|
2340 |
-
subm_button[0].click();
|
2341 |
-
return;
|
2342 |
-
}
|
2343 |
-
|
2344 |
-
subm_button = jQuery(formOriginal).find('input[type=submit]');
|
2345 |
-
if( subm_button.length !== 0 ) {
|
2346 |
-
subm_button[0].click();
|
2347 |
-
return;
|
2348 |
-
}
|
2349 |
-
|
2350 |
-
// ConvertKit direct integration
|
2351 |
-
subm_button = jQuery(formOriginal).find('button[data-element="submit"]');
|
2352 |
-
if( subm_button.length !== 0 ) {
|
2353 |
-
subm_button[0].click();
|
2354 |
-
return;
|
2355 |
-
}
|
2356 |
-
|
2357 |
-
// Paypal integration
|
2358 |
-
subm_button = jQuery(formOriginal).find('input[type="image"][name="submit"]');
|
2359 |
-
if( subm_button.length !== 0 ) {
|
2360 |
-
subm_button[0].click();
|
2361 |
-
}
|
2362 |
-
|
2363 |
-
}
|
2364 |
-
if (result.apbct !== undefined && +result.apbct.blocked) {
|
2365 |
-
ctParseBlockMessage(result);
|
2366 |
-
}
|
2367 |
-
}
|
2368 |
-
}
|
2369 |
-
);
|
2370 |
-
}
|
2371 |
-
|
2372 |
-
function ct_check_internal(currForm){
|
2373 |
-
|
2374 |
-
//Gathering data
|
2375 |
-
var ct_data = {},
|
2376 |
-
elems = currForm.elements;
|
2377 |
-
|
2378 |
-
for (var key in elems) {
|
2379 |
-
if(elems[key].type == 'submit' || elems[key].value == undefined || elems[key].value == '')
|
2380 |
-
continue;
|
2381 |
-
ct_data[elems[key].name] = currForm.elements[key].value;
|
2382 |
-
}
|
2383 |
-
ct_data['action'] = 'ct_check_internal';
|
2384 |
-
|
2385 |
-
//AJAX Request
|
2386 |
-
apbct_public_sendAJAX(
|
2387 |
-
ct_data,
|
2388 |
-
{
|
2389 |
-
url: ctPublicFunctions._ajax_url,
|
2390 |
-
callback: function (data) {
|
2391 |
-
if(data.success === true){
|
2392 |
-
currForm.submit();
|
2393 |
-
}else{
|
2394 |
-
alert(data.data);
|
2395 |
-
return false;
|
2396 |
-
}
|
2397 |
-
}
|
2398 |
-
}
|
2399 |
-
);
|
2400 |
-
}
|
2401 |
-
|
2402 |
-
document.addEventListener('DOMContentLoaded',function(){
|
2403 |
-
let ct_currAction = '',
|
2404 |
-
ct_currForm = '';
|
2405 |
-
|
2406 |
-
if( ! +ctPublic.settings__forms__check_internal ) {
|
2407 |
-
return;
|
2408 |
-
}
|
2409 |
-
|
2410 |
-
for( let i=0; i<document.forms.length; i++ ){
|
2411 |
-
if ( typeof(document.forms[i].action) == 'string' ){
|
2412 |
-
ct_currForm = document.forms[i];
|
2413 |
-
ct_currAction = ct_currForm.action;
|
2414 |
-
if (
|
2415 |
-
ct_currAction.indexOf('https?://') !== null && // The protocol is obligatory
|
2416 |
-
ct_currAction.match(ctPublic.blog_home + '.*?\.php') !== null && // Main check
|
2417 |
-
! ct_check_internal__is_exclude_form(ct_currAction) // Exclude WordPress native scripts from processing
|
2418 |
-
) {
|
2419 |
-
ctPrevHandler = ct_currForm.click;
|
2420 |
-
if ( typeof jQuery !== 'undefined' ) {
|
2421 |
-
jQuery(ct_currForm).off('**');
|
2422 |
-
jQuery(ct_currForm).off();
|
2423 |
-
jQuery(ct_currForm).on('submit', function(event){
|
2424 |
-
ct_check_internal(event.target);
|
2425 |
-
return false;
|
2426 |
-
});
|
2427 |
-
}
|
2428 |
-
}
|
2429 |
-
}
|
2430 |
-
}
|
2431 |
-
});
|
2432 |
-
|
2433 |
-
/**
|
2434 |
-
* Check by action to exclude the form checking
|
2435 |
-
* @param action string
|
2436 |
-
* @return boolean
|
2437 |
-
*/
|
2438 |
-
function ct_check_internal__is_exclude_form(action) {
|
2439 |
-
// An array contains forms action need to be excluded.
|
2440 |
-
let ct_internal_script_exclusions = [
|
2441 |
-
ctPublic.blog_home + 'wp-login.php', // WordPress login page
|
2442 |
-
ctPublic.blog_home + 'wp-comments-post.php', // WordPress Comments Form
|
2443 |
-
];
|
2444 |
-
|
2445 |
-
return ct_internal_script_exclusions.some((item) => {
|
2446 |
-
return action.match(new RegExp('^' + item)) !== null;
|
2447 |
-
});
|
2448 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/cleantalk-admin-settings-page.js
DELETED
@@ -1,560 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function(){
|
2 |
-
|
3 |
-
// Top level settings
|
4 |
-
jQuery('.apbct_setting---data__email_decoder').on('click', (event) => {
|
5 |
-
if ( event.target.type === 'checkbox' ) {
|
6 |
-
const postFix = event.target.checked ? '__On' : '__Off';
|
7 |
-
document.getElementById('apbct_setting_data__email_decoder' + postFix).checked = true;
|
8 |
-
} else {
|
9 |
-
document.getElementById('apbct_setting_data__email_decoder').checked = parseInt(event.target.value) === 1;
|
10 |
-
}
|
11 |
-
});
|
12 |
-
|
13 |
-
// Crunch for Right to Left direction languages
|
14 |
-
if(document.getElementsByClassName('apbct_settings-title')[0]) {
|
15 |
-
if(getComputedStyle(document.getElementsByClassName('apbct_settings-title')[0]).direction === 'rtl'){
|
16 |
-
jQuery('.apbct_switchers').css('text-align', 'right');
|
17 |
-
}
|
18 |
-
}
|
19 |
-
|
20 |
-
// Show/Hide access key
|
21 |
-
jQuery('#apbct_showApiKey').on('click', function(){
|
22 |
-
jQuery('.apbct_setting---apikey').val(jQuery('.apbct_setting---apikey').attr('key'));
|
23 |
-
jQuery('.apbct_setting---apikey+div').show();
|
24 |
-
jQuery(this).fadeOut(300);
|
25 |
-
});
|
26 |
-
|
27 |
-
var d = new Date();
|
28 |
-
jQuery('#ct_admin_timezone').val(d.getTimezoneOffset()/60*(-1));
|
29 |
-
|
30 |
-
// Key KEY automatically
|
31 |
-
jQuery('#apbct_button__get_key_auto').on('click', function(){
|
32 |
-
apbct_admin_sendAJAX(
|
33 |
-
{action: 'apbct_get_key_auto'},
|
34 |
-
{
|
35 |
-
timeout: 25000,
|
36 |
-
button: document.getElementById('apbct_button__get_key_auto' ),
|
37 |
-
spinner: jQuery('#apbct_button__get_key_auto .apbct_preloader_button' ),
|
38 |
-
callback: function(result, data, params, obj){
|
39 |
-
jQuery('#apbct_button__get_key_auto .apbct_success').show(300);
|
40 |
-
setTimeout(function(){jQuery('#apbct_button__get_key_auto .apbct_success').hide(300);}, 2000);
|
41 |
-
if(result.reload)
|
42 |
-
document.location.reload();
|
43 |
-
if(result.getTemplates) {
|
44 |
-
cleantalkModal.loaded = result.getTemplates;
|
45 |
-
cleantalkModal.open();
|
46 |
-
document.addEventListener("cleantalkModalClosed", function( e ) {
|
47 |
-
document.location.reload();
|
48 |
-
});
|
49 |
-
}
|
50 |
-
}
|
51 |
-
}
|
52 |
-
);
|
53 |
-
});
|
54 |
-
|
55 |
-
// Import settings
|
56 |
-
jQuery( document ).on('click', '#apbct_settings_templates_import_button', function(){
|
57 |
-
jQuery('#apbct-ajax-result').remove();
|
58 |
-
var optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_import'));
|
59 |
-
var templateNameInput = jQuery('#apbct_settings_templates_import_name');
|
60 |
-
templateNameInput.css('border-color', 'inherit');
|
61 |
-
if( typeof optionSelected.data('id') === "undefined" ) {
|
62 |
-
console.log( 'Attribute "data-id" not set for the option.' );
|
63 |
-
return;
|
64 |
-
}
|
65 |
-
var data = {
|
66 |
-
'template_id' : optionSelected.data('id'),
|
67 |
-
'template_name' : optionSelected.data('name'),
|
68 |
-
'settings' : optionSelected.data('settings')
|
69 |
-
};
|
70 |
-
var button = this;
|
71 |
-
apbct_admin_sendAJAX(
|
72 |
-
{action: 'settings_templates_import', data: data},
|
73 |
-
{
|
74 |
-
timeout: 25000,
|
75 |
-
button: button,
|
76 |
-
spinner: jQuery('#apbct_settings_templates_import_button .apbct_preloader_button' ),
|
77 |
-
notJson: true,
|
78 |
-
callback: function(result, data, params, obj){
|
79 |
-
if(result.success) {
|
80 |
-
jQuery( "<p id='apbct-ajax-result' class='success'>" + result.data + "</p>" ).insertAfter( jQuery(button) );
|
81 |
-
jQuery('#apbct_settings_templates_import_button .apbct_success').show(300);
|
82 |
-
setTimeout(function(){jQuery('#apbct_settings_templates_import_button .apbct_success').hide(300);}, 2000);
|
83 |
-
document.addEventListener("cleantalkModalClosed", function( e ) {
|
84 |
-
document.location.reload();
|
85 |
-
});
|
86 |
-
setTimeout(function(){cleantalkModal.close()}, 2000);
|
87 |
-
} else {
|
88 |
-
jQuery( "<p id='apbct-ajax-result' class='error'>" + result.data + "</p>" ).insertAfter( jQuery(button) );
|
89 |
-
}
|
90 |
-
}
|
91 |
-
}
|
92 |
-
);
|
93 |
-
});
|
94 |
-
|
95 |
-
// Export settings
|
96 |
-
jQuery( document ).on('click', '#apbct_settings_templates_export_button', function(){
|
97 |
-
jQuery('#apbct-ajax-result').remove();
|
98 |
-
var optionSelected = jQuery('option:selected', jQuery('#apbct_settings_templates_export'));
|
99 |
-
var templateNameInput = jQuery('#apbct_settings_templates_export_name');
|
100 |
-
templateNameInput.css('border-color', 'inherit');
|
101 |
-
if( typeof optionSelected.data('id') === "undefined" ) {
|
102 |
-
console.log( 'Attribute "data-id" not set for the option.' );
|
103 |
-
return;
|
104 |
-
}
|
105 |
-
if( optionSelected.data('id') === 'new_template' ) {
|
106 |
-
var templateName = templateNameInput.val();
|
107 |
-
if( templateName === '' ) {
|
108 |
-
templateNameInput.css('border-color', 'red');
|
109 |
-
return;
|
110 |
-
}
|
111 |
-
var data = {
|
112 |
-
'template_name' : templateName
|
113 |
-
}
|
114 |
-
} else {
|
115 |
-
var data = {
|
116 |
-
'template_id' : optionSelected.data('id')
|
117 |
-
}
|
118 |
-
}
|
119 |
-
var button = this;
|
120 |
-
apbct_admin_sendAJAX(
|
121 |
-
{action: 'settings_templates_export', data: data},
|
122 |
-
{
|
123 |
-
timeout: 25000,
|
124 |
-
button: button,
|
125 |
-
spinner: jQuery('#apbct_settings_templates_export_button .apbct_preloader_button' ),
|
126 |
-
notJson: true,
|
127 |
-
callback: function(result, data, params, obj){
|
128 |
-
if(result.success) {
|
129 |
-
jQuery( "<p id='apbct-ajax-result' class='success'>" + result.data + "</p>" ).insertAfter( jQuery(button) );
|
130 |
-
jQuery('#apbct_settings_templates_export_button .apbct_success').show(300);
|
131 |
-
setTimeout(function(){jQuery('#apbct_settings_templates_export_button .apbct_success').hide(300);}, 2000);
|
132 |
-
document.addEventListener("cleantalkModalClosed", function( e ) {
|
133 |
-
document.location.reload();
|
134 |
-
});
|
135 |
-
setTimeout(function(){cleantalkModal.close()}, 2000);
|
136 |
-
} else {
|
137 |
-
jQuery( "<p id='apbct-ajax-result' class='error'>" + result.data + "</p>" ).insertAfter( jQuery(button) );
|
138 |
-
}
|
139 |
-
}
|
140 |
-
}
|
141 |
-
);
|
142 |
-
});
|
143 |
-
|
144 |
-
// Reset settings
|
145 |
-
jQuery( document ).on('click', '#apbct_settings_templates_reset_button', function(){
|
146 |
-
var button = this;
|
147 |
-
apbct_admin_sendAJAX(
|
148 |
-
{action: 'settings_templates_reset'},
|
149 |
-
{
|
150 |
-
timeout: 25000,
|
151 |
-
button: button,
|
152 |
-
spinner: jQuery('#apbct_settings_templates_reset_button .apbct_preloader_button' ),
|
153 |
-
notJson: true,
|
154 |
-
callback: function(result, data, params, obj){
|
155 |
-
if(result.success) {
|
156 |
-
jQuery( "<p id='apbct-ajax-result' class='success'>" + result.data + "</p>" ).insertAfter( jQuery(button) );
|
157 |
-
jQuery('#apbct_settings_templates_reset_button .apbct_success').show(300);
|
158 |
-
setTimeout(function(){jQuery('#apbct_settings_templates_reset_button .apbct_success').hide(300);}, 2000);
|
159 |
-
document.addEventListener("cleantalkModalClosed", function( e ) {
|
160 |
-
document.location.reload();
|
161 |
-
});
|
162 |
-
setTimeout(function(){cleantalkModal.close()}, 2000);
|
163 |
-
} else {
|
164 |
-
jQuery( "<p id='apbct-ajax-result' class='error'>" + result.data + "</p>" ).insertAfter( jQuery(button) );
|
165 |
-
}
|
166 |
-
}
|
167 |
-
}
|
168 |
-
);
|
169 |
-
});
|
170 |
-
|
171 |
-
// Sync button
|
172 |
-
jQuery('#apbct_button__sync').on('click', function(){
|
173 |
-
apbct_admin_sendAJAX(
|
174 |
-
{action: 'apbct_sync'},
|
175 |
-
{
|
176 |
-
timeout: 25000,
|
177 |
-
button: document.getElementById('apbct_button__sync' ),
|
178 |
-
spinner: jQuery('#apbct_button__sync .apbct_preloader_button' ),
|
179 |
-
callback: function(result, data, params, obj){
|
180 |
-
jQuery('#apbct_button__sync .apbct_success').show(300);
|
181 |
-
setTimeout(function(){jQuery('#apbct_button__sync .apbct_success').hide(300);}, 2000);
|
182 |
-
if(result.reload)
|
183 |
-
document.location.reload();
|
184 |
-
}
|
185 |
-
}
|
186 |
-
);
|
187 |
-
});
|
188 |
-
|
189 |
-
if( ctSettingsPage.key_changed )
|
190 |
-
jQuery('#apbct_button__sync').click();
|
191 |
-
|
192 |
-
jQuery(document).on('click', '.apbct_settings-long_description---show', function(){
|
193 |
-
self = jQuery(this);
|
194 |
-
apbct_settings__showDescription(self, self.attr('setting'));
|
195 |
-
});
|
196 |
-
|
197 |
-
if (jQuery('#cleantalk_notice_renew').length || jQuery('#cleantalk_notice_trial').length)
|
198 |
-
apbct_banner_check();
|
199 |
-
|
200 |
-
jQuery(document).on('change', '#apbct_settings_templates_export',function(){
|
201 |
-
var optionSelected = jQuery("option:selected", this);
|
202 |
-
if ( optionSelected.data("id") === 'new_template' ) {
|
203 |
-
jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').show();
|
204 |
-
} else {
|
205 |
-
jQuery(this).parent().parent().find('#apbct_settings_templates_export_name').hide();
|
206 |
-
}
|
207 |
-
});
|
208 |
-
|
209 |
-
apbct_save_button_position();
|
210 |
-
window.addEventListener('scroll', apbct_save_button_position);
|
211 |
-
jQuery('#ct_adv_showhide a').on('click', apbct_save_button_position);
|
212 |
-
|
213 |
-
|
214 |
-
/**
|
215 |
-
* Change cleantalk account email
|
216 |
-
*/
|
217 |
-
jQuery('#apbct-change-account-email').on('click', function (e) {
|
218 |
-
e.preventDefault();
|
219 |
-
|
220 |
-
var $this = jQuery(this);
|
221 |
-
var accountEmailField = jQuery('#apbct-account-email');
|
222 |
-
var accountEmail = accountEmailField.text();
|
223 |
-
|
224 |
-
$this.toggleClass('active');
|
225 |
-
|
226 |
-
if ($this.hasClass('active')) {
|
227 |
-
$this.text($this.data('save-text'));
|
228 |
-
accountEmailField.attr('contenteditable', 'true');
|
229 |
-
accountEmailField.on('keydown', function (e) {
|
230 |
-
if (e.code === 'Enter') {
|
231 |
-
e.preventDefault()
|
232 |
-
}
|
233 |
-
})
|
234 |
-
accountEmailField.on('input', function (e) {
|
235 |
-
if (e.inputType === 'insertParagraph') {
|
236 |
-
e.preventDefault()
|
237 |
-
}
|
238 |
-
})
|
239 |
-
} else {
|
240 |
-
apbct_admin_sendAJAX(
|
241 |
-
{
|
242 |
-
action: 'apbct_update_account_email',
|
243 |
-
accountEmail: accountEmail
|
244 |
-
},
|
245 |
-
{
|
246 |
-
timeout: 5000,
|
247 |
-
callback: function(result, data, params, obj){
|
248 |
-
if (result.success !== undefined && result.success === 'ok') {
|
249 |
-
if (result.manuallyLink !== undefined) {
|
250 |
-
jQuery('#apbct-key-manually-link').attr('href', result.manuallyLink);
|
251 |
-
}
|
252 |
-
}
|
253 |
-
|
254 |
-
if (result.error !== undefined) {
|
255 |
-
jQuery('#apbct-account-email').css('border-color', 'red');
|
256 |
-
}
|
257 |
-
}
|
258 |
-
}
|
259 |
-
);
|
260 |
-
|
261 |
-
accountEmailField.attr('contenteditable', 'false');
|
262 |
-
$this.text($this.data('default-text'));
|
263 |
-
}
|
264 |
-
});
|
265 |
-
|
266 |
-
/**
|
267 |
-
* Validate apkikey and hide get auto btn
|
268 |
-
*/
|
269 |
-
jQuery('#apbct_setting_apikey').on('input', function () {
|
270 |
-
var enteredValue = jQuery(this).val();
|
271 |
-
jQuery('button.cleantalk_link[value="save_changes"]').off('click')
|
272 |
-
if (enteredValue !== '' && enteredValue.match(/^[a-z\d]{3,30}\s*$/) === null) {
|
273 |
-
jQuery('#apbct_button__get_key_auto__wrapper').show();
|
274 |
-
jQuery('button.cleantalk_link[value="save_changes"]').on('click',
|
275 |
-
function (e) {
|
276 |
-
e.preventDefault()
|
277 |
-
if (!jQuery('#apbct_bad_key_notice').length){
|
278 |
-
jQuery( "<div class='apbct_notice_inner error'><h4 id='apbct_bad_key_notice'>" +
|
279 |
-
"Please, insert a correct access key before saving changes!" +
|
280 |
-
"</h4></div>" ).insertAfter( jQuery('#apbct_setting_apikey') );
|
281 |
-
}
|
282 |
-
apbct_highlight_element('apbct_setting_apikey',3)
|
283 |
-
|
284 |
-
}
|
285 |
-
)
|
286 |
-
return;
|
287 |
-
}
|
288 |
-
|
289 |
-
});
|
290 |
-
|
291 |
-
if ( jQuery('#apbct_setting_apikey').val() && ctSettingsPage.key_is_ok) {
|
292 |
-
jQuery('#apbct_button__get_key_auto__wrapper').hide();
|
293 |
-
}
|
294 |
-
|
295 |
-
/**
|
296 |
-
* Handle synchronization errors when key is no ok to force user check the key and restart the sync
|
297 |
-
*/
|
298 |
-
if( !ctSettingsPage.key_is_ok ){
|
299 |
-
jQuery('button.cleantalk_link[value="save_changes"]').on('click',
|
300 |
-
function (e) {
|
301 |
-
e.preventDefault()
|
302 |
-
if (!jQuery('#sync_required_notice').length){
|
303 |
-
jQuery( "<div class='apbct_notice_inner error'><h4 id='sync_required_notice'>" +
|
304 |
-
"Synchronization process failed. Please, check the acces key and restart the synch." +
|
305 |
-
"<h4></div>" ).insertAfter( jQuery('#apbct_button__sync') );
|
306 |
-
}
|
307 |
-
apbct_highlight_element('apbct_setting_apikey',3)
|
308 |
-
apbct_highlight_element('apbct_button__sync',3)
|
309 |
-
jQuery('#apbct_button__get_key_auto__wrapper').show();
|
310 |
-
}
|
311 |
-
)
|
312 |
-
}
|
313 |
-
|
314 |
-
});
|
315 |
-
|
316 |
-
/**
|
317 |
-
* Checking current account status for renew notice
|
318 |
-
*/
|
319 |
-
function apbct_banner_check() {
|
320 |
-
var bannerChecker = setInterval( function() {
|
321 |
-
apbct_admin_sendAJAX(
|
322 |
-
{action: 'apbct_settings__check_renew_banner'},
|
323 |
-
{
|
324 |
-
callback: function(result, data, params, obj){
|
325 |
-
if (result.close_renew_banner) {
|
326 |
-
if (jQuery('#cleantalk_notice_renew').length)
|
327 |
-
jQuery('#cleantalk_notice_renew').hide('slow');
|
328 |
-
if (jQuery('#cleantalk_notice_trial').length)
|
329 |
-
jQuery('#cleantalk_notice_trial').hide('slow');
|
330 |
-
clearInterval(bannerChecker);
|
331 |
-
}
|
332 |
-
}
|
333 |
-
}
|
334 |
-
);
|
335 |
-
}, 900000);
|
336 |
-
}
|
337 |
-
|
338 |
-
/**
|
339 |
-
* Select elems like #{selector} or .{selector}
|
340 |
-
* Selector passed in string separated by ,
|
341 |
-
*
|
342 |
-
* @param elems
|
343 |
-
* @returns {*}
|
344 |
-
*/
|
345 |
-
function apbct_get_elems(elems){
|
346 |
-
elems = elems.split(',');
|
347 |
-
for( var i=0, len = elems.length, tmp; i < len; i++){
|
348 |
-
tmp = jQuery('#'+elems[i]);
|
349 |
-
elems[i] = tmp.length === 0 ? jQuery('.'+elems[i]) : tmp;
|
350 |
-
}
|
351 |
-
return elems;
|
352 |
-
}
|
353 |
-
|
354 |
-
/**
|
355 |
-
* Select elems like #{selector} or .{selector}
|
356 |
-
* Selector could be passed in a string ( separated by comma ) or in array ( [ elem1, elem2, ... ] )
|
357 |
-
*
|
358 |
-
* @param elems string|array
|
359 |
-
* @returns array
|
360 |
-
*/
|
361 |
-
function apbct_get_elems__native(elems){
|
362 |
-
|
363 |
-
// Make array from a string
|
364 |
-
if(typeof elems === 'string')
|
365 |
-
elems = elems.split(',');
|
366 |
-
|
367 |
-
var out = [];
|
368 |
-
|
369 |
-
elems.forEach(function(elem, i, arr) {
|
370 |
-
|
371 |
-
// try to get elements with such IDs
|
372 |
-
var tmp = document.getElementById(elem);
|
373 |
-
if (tmp !== null){
|
374 |
-
out.push( tmp[key] );
|
375 |
-
return;
|
376 |
-
}
|
377 |
-
|
378 |
-
// try to get elements with such class name
|
379 |
-
// write each elem from collection to new element of output array
|
380 |
-
tmp = document.getElementsByClassName(elem);
|
381 |
-
if (tmp !== null && tmp.length !==0 ){
|
382 |
-
for(key in tmp){
|
383 |
-
if( +key >= 0 ){
|
384 |
-
out.push( tmp[key] );
|
385 |
-
}
|
386 |
-
}
|
387 |
-
}
|
388 |
-
});
|
389 |
-
|
390 |
-
return out;
|
391 |
-
}
|
392 |
-
|
393 |
-
function apbct_show_hide_elem(elems){
|
394 |
-
elems = apbct_get_elems(elems);
|
395 |
-
for( var i=0, len = elems.length; i < len; i++){
|
396 |
-
elems[i].each(function (i, elem) {
|
397 |
-
elem = jQuery(elem);
|
398 |
-
var label = elem.next('label') || elem.prev('label') || null;
|
399 |
-
if (elem.is(":visible")) {
|
400 |
-
elem.hide();
|
401 |
-
if (label) label.hide();
|
402 |
-
} else {
|
403 |
-
elem.show();
|
404 |
-
if (label) label.show();
|
405 |
-
}
|
406 |
-
});
|
407 |
-
}
|
408 |
-
}
|
409 |
-
|
410 |
-
/**
|
411 |
-
* Settings dependences. Switch|toggle depended elements state (disabled|enabled)
|
412 |
-
* Recieve list of selectors ( without class mark (.) or id mark (#) )
|
413 |
-
*
|
414 |
-
* @param ids string|array Selectors
|
415 |
-
* @param enable
|
416 |
-
*/
|
417 |
-
function apbctSettingsDependencies(ids, enable){
|
418 |
-
|
419 |
-
|
420 |
-
enable = ! isNaN(enable) ? enable : null;
|
421 |
-
|
422 |
-
// Get elements
|
423 |
-
var elems = apbct_get_elems__native( ids );
|
424 |
-
|
425 |
-
elems.forEach(function(elem, i, arr){
|
426 |
-
|
427 |
-
var do_disable = function(){elem.setAttribute('disabled', 'disabled');},
|
428 |
-
do_enable = function(){elem.removeAttribute('disabled');};
|
429 |
-
|
430 |
-
// Set defined state
|
431 |
-
if(enable === null) // Set
|
432 |
-
enable = elem.getAttribute('disabled') === null ? 0 : 1;
|
433 |
-
|
434 |
-
enable === 1 ? do_enable() : do_disable();
|
435 |
-
|
436 |
-
if( elem.getAttribute('apbct_children') !== null){
|
437 |
-
var state = apbctSettingsDependencies_getState( elem ) && enable;
|
438 |
-
if( state !== null ) {
|
439 |
-
apbctSettingsDependencies( elem.getAttribute('apbct_children'), state );
|
440 |
-
}
|
441 |
-
}
|
442 |
-
|
443 |
-
});
|
444 |
-
}
|
445 |
-
|
446 |
-
function apbctSettingsDependencies_getState( elem ){
|
447 |
-
|
448 |
-
var state;
|
449 |
-
|
450 |
-
switch ( elem.getAttribute( 'type' ) ){
|
451 |
-
case 'checkbox':
|
452 |
-
state = +elem.checked;
|
453 |
-
break;
|
454 |
-
case 'radio':
|
455 |
-
state = +(+elem.getAttribute('value') === 1);
|
456 |
-
break;
|
457 |
-
default:
|
458 |
-
state = null;
|
459 |
-
}
|
460 |
-
|
461 |
-
return state;
|
462 |
-
}
|
463 |
-
|
464 |
-
function apbct_settings__showDescription(label, setting_id){
|
465 |
-
|
466 |
-
var remove_desc_func = function(e){
|
467 |
-
if(typeof e === 'undefined' || ((jQuery(e.target).parent('.apbct_long_desc').length == 0 || jQuery(e.target).hasClass('apbct_long_desc__cancel')) && !jQuery(e.target).hasClass('apbct_long_description__show'))){
|
468 |
-
jQuery('.apbct_long_desc').remove();
|
469 |
-
jQuery(document).off('click', remove_desc_func);
|
470 |
-
}
|
471 |
-
};
|
472 |
-
|
473 |
-
remove_desc_func();
|
474 |
-
|
475 |
-
label.after("<div id='apbct_long_desc__"+setting_id+"' class='apbct_long_desc'></div>");
|
476 |
-
var obj = jQuery('#apbct_long_desc__'+setting_id);
|
477 |
-
obj.append("<i class= 'apbct-icon-spin1 animate-spin'></i>")
|
478 |
-
.append("<div class='apbct_long_desc__angle'></div>")
|
479 |
-
.css({
|
480 |
-
top: label.position().top - 5,
|
481 |
-
left: label.position().left + 25
|
482 |
-
});
|
483 |
-
|
484 |
-
|
485 |
-
apbct_admin_sendAJAX(
|
486 |
-
{action: 'apbct_settings__get__long_description', setting_id: setting_id},
|
487 |
-
{
|
488 |
-
spinner: obj.children('img'),
|
489 |
-
callback: function(result, data, params, obj){
|
490 |
-
|
491 |
-
obj.empty()
|
492 |
-
.append("<div class='apbct_long_desc__angle'></div>")
|
493 |
-
.append("<i class='apbct_long_desc__cancel apbct-icon-cancel'></i>")
|
494 |
-
.append("<h3 class='apbct_long_desc__title'>"+result.title+"</h3>")
|
495 |
-
.append("<p>"+result.desc+"</p>");
|
496 |
-
|
497 |
-
jQuery(document).on('click', remove_desc_func);
|
498 |
-
}
|
499 |
-
},
|
500 |
-
obj
|
501 |
-
);
|
502 |
-
}
|
503 |
-
|
504 |
-
function apbct_save_button_position() {
|
505 |
-
if (
|
506 |
-
document.getElementById('apbct_settings__before_advanced_settings') === null ||
|
507 |
-
document.getElementById('apbct_settings__after_advanced_settings') === null ||
|
508 |
-
document.getElementById('apbct_settings__button_section') === null ||
|
509 |
-
document.getElementById('apbct_settings__advanced_settings') === null ||
|
510 |
-
document.getElementById('apbct_hidden_section_nav') === null
|
511 |
-
) {
|
512 |
-
return;
|
513 |
-
}
|
514 |
-
var docInnerHeight = window.innerHeight;
|
515 |
-
var advSettingsBlock = document.getElementById('apbct_settings__advanced_settings');
|
516 |
-
var advSettingsOffset = advSettingsBlock.getBoundingClientRect().top;
|
517 |
-
var buttonBlock = document.getElementById('apbct_settings__button_section');
|
518 |
-
var buttonHeight = buttonBlock.getBoundingClientRect().height;
|
519 |
-
var navBlock = document.getElementById('apbct_hidden_section_nav');
|
520 |
-
var navBlockOffset = navBlock.getBoundingClientRect().top;
|
521 |
-
var navBlockHeight = navBlock.getBoundingClientRect().height;
|
522 |
-
|
523 |
-
// Set Save button position
|
524 |
-
if ( getComputedStyle(advSettingsBlock).display !== "none" ) {
|
525 |
-
jQuery('#apbct_settings__main_save_button').hide();
|
526 |
-
if ( docInnerHeight < navBlockOffset + navBlockHeight + buttonHeight ) {
|
527 |
-
buttonBlock.style.bottom = '';
|
528 |
-
buttonBlock.style.top = navBlockOffset + navBlockHeight + 20 + 'px';
|
529 |
-
} else {
|
530 |
-
buttonBlock.style.bottom = 0;
|
531 |
-
buttonBlock.style.top = '';
|
532 |
-
}
|
533 |
-
} else {
|
534 |
-
jQuery('#apbct_settings__main_save_button').show();
|
535 |
-
}
|
536 |
-
|
537 |
-
// Set nav position
|
538 |
-
if ( advSettingsOffset <= 0 ) {
|
539 |
-
navBlock.style.top = - advSettingsOffset + 30 + 'px';
|
540 |
-
} else {
|
541 |
-
navBlock.style.top = 0;
|
542 |
-
}
|
543 |
-
}
|
544 |
-
|
545 |
-
// Hightlights element
|
546 |
-
function apbct_highlight_element(id, times){
|
547 |
-
times = times-1 || 0;
|
548 |
-
let key_field = jQuery('#'+id)
|
549 |
-
jQuery("html, body").animate({ scrollTop: key_field.offset().top - 100 }, "slow");
|
550 |
-
key_field.addClass('apbct_highlighted');
|
551 |
-
key_field.animate({opacity: 0 }, 400, 'linear', function(){
|
552 |
-
key_field.animate({opacity: 1 }, 400, 'linear', function(){
|
553 |
-
if(times>0){
|
554 |
-
apbct_highlight_element(id, times);
|
555 |
-
}else{
|
556 |
-
key_field.removeClass('apbct_highlighted');
|
557 |
-
}
|
558 |
-
});
|
559 |
-
});
|
560 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/cleantalk-admin.js
DELETED
@@ -1,93 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function(){
|
2 |
-
|
3 |
-
// Auto update banner close handler
|
4 |
-
jQuery('.apbct_update_notice').on('click', 'button', function(){
|
5 |
-
var ct_date = new Date(new Date().getTime() + 1000 * 86400 * 30 );
|
6 |
-
var ctSecure = location.protocol === 'https:' ? '; secure' : '';
|
7 |
-
document.cookie = "apbct_update_banner_closed=1; path=/; expires=" + ct_date.toUTCString() + "; samesite=lax" + ctSecure;
|
8 |
-
});
|
9 |
-
|
10 |
-
jQuery('li a[href="options-general.php?page=cleantalk"]').css('white-space','nowrap').css('display','inline-block');
|
11 |
-
|
12 |
-
jQuery('body').on('click', '.apbct-notice .notice-dismiss', function(e){
|
13 |
-
var apbct_notice_name = jQuery(e.target).parent().attr('id');
|
14 |
-
if( apbct_notice_name ) {
|
15 |
-
apbct_admin_sendAJAX( { 'action' : 'cleantalk_dismiss_notice', 'notice_id' : apbct_notice_name }, { 'callback' : null } );
|
16 |
-
}
|
17 |
-
});
|
18 |
-
|
19 |
-
// Notice when deleting user
|
20 |
-
jQuery('.ct_username .row-actions .delete a').on('click', function (e) {
|
21 |
-
e.preventDefault();
|
22 |
-
|
23 |
-
let result = confirm(ctAdminCommon.notice_when_deleting_user_text);
|
24 |
-
|
25 |
-
if (result) {
|
26 |
-
window.location = this.href
|
27 |
-
}
|
28 |
-
});
|
29 |
-
|
30 |
-
});
|
31 |
-
function apbct_admin_sendAJAX(data, params, obj){
|
32 |
-
|
33 |
-
// Default params
|
34 |
-
var callback = params.callback || null;
|
35 |
-
var callback_context = params.callback_context || null;
|
36 |
-
var callback_params = params.callback_params || null;
|
37 |
-
var async = params.async || true;
|
38 |
-
var notJson = params.notJson || null;
|
39 |
-
var timeout = params.timeout || 15000;
|
40 |
-
var obj = obj || null;
|
41 |
-
var button = params.button || null;
|
42 |
-
var spinner = params.spinner || null;
|
43 |
-
var progressbar = params.progressbar || null;
|
44 |
-
|
45 |
-
if(typeof (data) === 'string') {
|
46 |
-
data = data + '&_ajax_nonce=' + ctAdminCommon._ajax_nonce + '&no_cache=' + Math.random();
|
47 |
-
} else {
|
48 |
-
data._ajax_nonce = ctAdminCommon._ajax_nonce;
|
49 |
-
data.no_cache = Math.random();
|
50 |
-
}
|
51 |
-
// Button and spinner
|
52 |
-
if(button) {button.setAttribute('disabled', 'disabled'); button.style.cursor = 'not-allowed'; }
|
53 |
-
if(spinner) jQuery(spinner).css('display', 'inline');
|
54 |
-
|
55 |
-
jQuery.ajax({
|
56 |
-
type: "POST",
|
57 |
-
url: ctAdminCommon._ajax_url,
|
58 |
-
data: data,
|
59 |
-
async: async,
|
60 |
-
success: function(result){
|
61 |
-
if(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }
|
62 |
-
if(spinner) jQuery(spinner).css('display', 'none');
|
63 |
-
if(!notJson) result = JSON.parse(result);
|
64 |
-
if(result.error){
|
65 |
-
setTimeout(function(){ if(progressbar) progressbar.fadeOut('slow'); }, 1000);
|
66 |
-
if( typeof cleantalkModal !== 'undefined' ) {
|
67 |
-
// Show the result by modal
|
68 |
-
cleantalkModal.loaded = 'Error:<br>' + result.error.toString();
|
69 |
-
cleantalkModal.open();
|
70 |
-
} else {
|
71 |
-
alert('Error happens: ' + (result.error || 'Unkown'));
|
72 |
-
}
|
73 |
-
|
74 |
-
}else{
|
75 |
-
if(callback) {
|
76 |
-
if (callback_params)
|
77 |
-
callback.apply( callback_context, callback_params.concat( result, data, params, obj ) );
|
78 |
-
else
|
79 |
-
callback(result, data, params, obj);
|
80 |
-
}
|
81 |
-
}
|
82 |
-
},
|
83 |
-
error: function(jqXHR, textStatus, errorThrown){
|
84 |
-
if(button){ button.removeAttribute('disabled'); button.style.cursor = 'pointer'; }
|
85 |
-
if(spinner) jQuery(spinner).css('display', 'none');
|
86 |
-
console.log('APBCT_AJAX_ERROR');
|
87 |
-
console.log(jqXHR);
|
88 |
-
console.log(textStatus);
|
89 |
-
console.log(errorThrown);
|
90 |
-
},
|
91 |
-
timeout: timeout,
|
92 |
-
});
|
93 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/cleantalk-comments-checkspam.js
DELETED
@@ -1,455 +0,0 @@
|
|
1 |
-
// Printf for JS
|
2 |
-
String.prototype.printf = function(){
|
3 |
-
var formatted = this;
|
4 |
-
for( var arg in arguments ) {
|
5 |
-
var before_formatted = formatted.substring(0, formatted.indexOf("%s", 0));
|
6 |
-
var after_formatted = formatted.substring(formatted.indexOf("%s", 0)+2, formatted.length);
|
7 |
-
formatted = before_formatted + arguments[arg] + after_formatted;
|
8 |
-
}
|
9 |
-
return formatted;
|
10 |
-
};
|
11 |
-
|
12 |
-
// Flags
|
13 |
-
var ct_working = false,
|
14 |
-
ct_new_check = true,
|
15 |
-
ct_cooling_down_flag = false,
|
16 |
-
ct_close_animate = true,
|
17 |
-
ct_accurate_check = false,
|
18 |
-
ct_pause = false,
|
19 |
-
ct_prev_accurate = ctCommentsCheck.ct_prev_accurate,
|
20 |
-
ct_prev_from = ctCommentsCheck.ct_prev_from,
|
21 |
-
ct_prev_till = ctCommentsCheck.ct_prev_till;
|
22 |
-
// Settings
|
23 |
-
var ct_cool_down_time = 90000,
|
24 |
-
ct_requests_counter = 0,
|
25 |
-
ct_max_requests = 60;
|
26 |
-
// Variables
|
27 |
-
var ct_ajax_nonce = ctCommentsCheck.ct_ajax_nonce,
|
28 |
-
ct_comments_total = 0,
|
29 |
-
ct_comments_checked = 0,
|
30 |
-
ct_comments_spam = 0,
|
31 |
-
ct_comments_bad = 0,
|
32 |
-
ct_unchecked = 'unset',
|
33 |
-
ct_date_from = 0,
|
34 |
-
ct_date_till = 0;
|
35 |
-
|
36 |
-
function animate_comment(to,id){
|
37 |
-
if(ct_close_animate){
|
38 |
-
if(to==0.3){
|
39 |
-
jQuery('#comment-'+id).fadeTo(200,to,function(){
|
40 |
-
animate_comment(1,id)
|
41 |
-
});
|
42 |
-
}else{
|
43 |
-
jQuery('#comment-'+id).fadeTo(200,to,function(){
|
44 |
-
animate_comment(0.3,id)
|
45 |
-
});
|
46 |
-
}
|
47 |
-
}else{
|
48 |
-
ct_close_animate=true;
|
49 |
-
}
|
50 |
-
}
|
51 |
-
|
52 |
-
function ct_clear_comments(){
|
53 |
-
|
54 |
-
var from = 0, till = 0;
|
55 |
-
if(jQuery('#ct_allow_date_range').is(':checked')) {
|
56 |
-
from = jQuery('#ct_date_range_from').val();
|
57 |
-
till = jQuery('#ct_date_range_till').val();
|
58 |
-
}
|
59 |
-
var ctSecure = location.protocol === 'https:' ? '; secure' : '';
|
60 |
-
document.cookie = 'apbct_check_comments_offset' + "=" + 0 + "; path=/; samesite=lax" + ctSecure;
|
61 |
-
|
62 |
-
var data = {
|
63 |
-
'action' : 'ajax_clear_comments',
|
64 |
-
'security' : ct_ajax_nonce,
|
65 |
-
'from' : from,
|
66 |
-
'till' : till
|
67 |
-
};
|
68 |
-
|
69 |
-
jQuery.ajax({
|
70 |
-
type: "POST",
|
71 |
-
url: ajaxurl,
|
72 |
-
data: data,
|
73 |
-
success: function(msg){
|
74 |
-
ct_show_info();
|
75 |
-
ct_send_comments();
|
76 |
-
}
|
77 |
-
});
|
78 |
-
}
|
79 |
-
|
80 |
-
//Continues the check after cooldown time
|
81 |
-
//Called by ct_send_users();
|
82 |
-
function ct_cooling_down_toggle(){
|
83 |
-
ct_cooling_down_flag = false;
|
84 |
-
ct_send_comments();
|
85 |
-
ct_show_info();
|
86 |
-
}
|
87 |
-
|
88 |
-
function ct_send_comments(){
|
89 |
-
|
90 |
-
if(ct_cooling_down_flag === true)
|
91 |
-
return;
|
92 |
-
|
93 |
-
if(ct_requests_counter >= ct_max_requests){
|
94 |
-
setTimeout(ct_cooling_down_toggle, ct_cool_down_time);
|
95 |
-
ct_requests_counter = 0;
|
96 |
-
ct_cooling_down_flag = true;
|
97 |
-
return;
|
98 |
-
}else{
|
99 |
-
ct_requests_counter++;
|
100 |
-
}
|
101 |
-
|
102 |
-
var data = {
|
103 |
-
'action': 'ajax_check_comments',
|
104 |
-
'security': ct_ajax_nonce,
|
105 |
-
'new_check': ct_new_check,
|
106 |
-
'unchecked': ct_unchecked,
|
107 |
-
'offset' : Number(ctGetCookie('apbct_check_comments_offset'))
|
108 |
-
};
|
109 |
-
|
110 |
-
if(ct_accurate_check)
|
111 |
-
data['accurate_check'] = true;
|
112 |
-
|
113 |
-
if(ct_date_from && ct_date_till){
|
114 |
-
data['from'] = ct_date_from;
|
115 |
-
data['till'] = ct_date_till;
|
116 |
-
}
|
117 |
-
|
118 |
-
jQuery.ajax({
|
119 |
-
type: "POST",
|
120 |
-
url: ajaxurl,
|
121 |
-
data: data,
|
122 |
-
success: function(msg){
|
123 |
-
|
124 |
-
msg = jQuery.parseJSON(msg);
|
125 |
-
|
126 |
-
if(parseInt(msg.error)){
|
127 |
-
ct_working=false;
|
128 |
-
if(!confirm(msg.error_message+". Do you want to proceed?")){
|
129 |
-
var new_href = 'edit-comments.php?page=ct_check_spam';
|
130 |
-
if(ct_date_from != 0 && ct_date_till != 0)
|
131 |
-
new_href+='&from='+ct_date_from+'&till='+ct_date_till;
|
132 |
-
location.href = new_href;
|
133 |
-
}else
|
134 |
-
ct_send_comments();
|
135 |
-
}else{
|
136 |
-
ct_new_check = false;
|
137 |
-
if(parseInt(msg.end) == 1 || ct_pause === true){
|
138 |
-
if(parseInt(msg.end) == 1)
|
139 |
-
document.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';
|
140 |
-
ct_working=false;
|
141 |
-
jQuery('#ct_working_message').hide();
|
142 |
-
var new_href = 'edit-comments.php?page=ct_check_spam';
|
143 |
-
if(ct_date_from != 0 && ct_date_till != 0)
|
144 |
-
new_href+='&from='+ct_date_from+'&till='+ct_date_till;
|
145 |
-
location.href = new_href;
|
146 |
-
}else if(parseInt(msg.end) == 0){
|
147 |
-
ct_comments_checked += msg.checked;
|
148 |
-
ct_comments_spam += msg.spam;
|
149 |
-
ct_comments_bad += msg.bad;
|
150 |
-
ct_comments_total += msg.total;
|
151 |
-
ct_unchecked = ct_comments_total - ct_comments_checked - ct_comments_bad;
|
152 |
-
var status_string = String(ctCommentsCheck.ct_status_string);
|
153 |
-
var status_string = status_string.printf(ct_comments_checked, ct_comments_spam, ct_comments_bad);
|
154 |
-
if(parseInt(ct_comments_spam) > 0)
|
155 |
-
status_string += ctCommentsCheck.ct_status_string_warning;
|
156 |
-
jQuery('#ct_checking_status').html(status_string);
|
157 |
-
jQuery('#ct_error_message').hide();
|
158 |
-
// If DB woks not properly
|
159 |
-
if(+ct_comments_total < ct_comments_checked + ct_comments_bad){
|
160 |
-
document.cookie = 'ct_comments_start_check=1; path=/; samesite=lax';
|
161 |
-
location.href = 'edit-comments.php?page=ct_check_spam';
|
162 |
-
}
|
163 |
-
|
164 |
-
var offset = Number(ctGetCookie('apbct_check_comments_offset')) + 100;
|
165 |
-
document.cookie = 'apbct_check_comments_offset' + "=" + offset + "; path=/";
|
166 |
-
|
167 |
-
ct_send_comments();
|
168 |
-
}
|
169 |
-
}
|
170 |
-
},
|
171 |
-
error: function(jqXHR, textStatus, errorThrown) {
|
172 |
-
jQuery('#ct_error_message').show();
|
173 |
-
jQuery('#cleantalk_ajax_error').html(textStatus);
|
174 |
-
jQuery('#cleantalk_js_func').html('Check comments');
|
175 |
-
setTimeout(ct_send_comments(), 3000);
|
176 |
-
},
|
177 |
-
timeout: 25000
|
178 |
-
});
|
179 |
-
}
|
180 |
-
function ct_show_info(){
|
181 |
-
|
182 |
-
if(ct_working){
|
183 |
-
|
184 |
-
if(ct_cooling_down_flag == true){
|
185 |
-
jQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)');
|
186 |
-
jQuery('#ct_cooling_notice').show();
|
187 |
-
return;
|
188 |
-
}else{
|
189 |
-
jQuery('#ct_cooling_notice').hide();
|
190 |
-
}
|
191 |
-
|
192 |
-
if(!ct_comments_total){
|
193 |
-
|
194 |
-
var data = {
|
195 |
-
'action': 'ajax_info_comments',
|
196 |
-
'security': ct_ajax_nonce
|
197 |
-
};
|
198 |
-
|
199 |
-
if(ct_date_from && ct_date_till){
|
200 |
-
data['from'] = ct_date_from;
|
201 |
-
data['till'] = ct_date_till;
|
202 |
-
}
|
203 |
-
|
204 |
-
jQuery.ajax({
|
205 |
-
type: "POST",
|
206 |
-
url: ajaxurl,
|
207 |
-
data: data,
|
208 |
-
success: function(msg){
|
209 |
-
msg = jQuery.parseJSON(msg);
|
210 |
-
jQuery('#ct_checking_status').html(msg.message);
|
211 |
-
ct_comments_total = msg.total;
|
212 |
-
ct_comments_spam = msg.spam;
|
213 |
-
ct_comments_checked = msg.checked;
|
214 |
-
ct_comments_bad = msg.bad;
|
215 |
-
},
|
216 |
-
error: function(jqXHR, textStatus, errorThrown) {
|
217 |
-
jQuery('#ct_error_message').show();
|
218 |
-
jQuery('#cleantalk_ajax_error').html(textStatus);
|
219 |
-
jQuery('#cleantalk_js_func').html('Check comments');
|
220 |
-
setTimeout(ct_show_info(), 3000);
|
221 |
-
},
|
222 |
-
timeout: 15000
|
223 |
-
});
|
224 |
-
}
|
225 |
-
}
|
226 |
-
}
|
227 |
-
|
228 |
-
// Function to toggle dependences
|
229 |
-
function ct_toggle_depended(obj, secondary){
|
230 |
-
|
231 |
-
secondary = secondary || null;
|
232 |
-
|
233 |
-
var depended = jQuery(obj.data('depended')),
|
234 |
-
state = obj.data('state');
|
235 |
-
|
236 |
-
if(!state && !secondary){
|
237 |
-
obj.data('state', true);
|
238 |
-
depended.removeProp('disabled');
|
239 |
-
}else{
|
240 |
-
obj.data('state', false);
|
241 |
-
depended.prop('disabled', true);
|
242 |
-
depended.removeProp('checked');
|
243 |
-
if(depended.data('depended'))
|
244 |
-
ct_toggle_depended(depended, true);
|
245 |
-
}
|
246 |
-
}
|
247 |
-
|
248 |
-
function ct_trash_all( e ) {
|
249 |
-
|
250 |
-
var data = {
|
251 |
-
'action': 'ajax_trash_all',
|
252 |
-
'security': ct_ajax_nonce
|
253 |
-
};
|
254 |
-
|
255 |
-
jQuery('.' + e.target.id).addClass('disabled');
|
256 |
-
jQuery('.spinner').css('visibility', 'visible');
|
257 |
-
jQuery.ajax({
|
258 |
-
type: "POST",
|
259 |
-
url: ajaxurl,
|
260 |
-
data: data,
|
261 |
-
success: function( msg ){
|
262 |
-
if( msg > 0 ){
|
263 |
-
jQuery('#cleantalk_comments_left').html(msg);
|
264 |
-
ct_trash_all( e );
|
265 |
-
}else{
|
266 |
-
jQuery('.' + e.target.id).removeClass('disabled');
|
267 |
-
jQuery('.spinner').css('visibility', 'hidden');
|
268 |
-
location.href='edit-comments.php?page=ct_check_spam';
|
269 |
-
}
|
270 |
-
},
|
271 |
-
error: function(jqXHR, textStatus, errorThrown) {
|
272 |
-
jQuery('#ct_error_message').show();
|
273 |
-
jQuery('#cleantalk_ajax_error').html(textStatus);
|
274 |
-
jQuery('#cleantalk_js_func').html('Check comments');
|
275 |
-
setTimeout(ct_trash_all( e ), 3000);
|
276 |
-
},
|
277 |
-
timeout: 25000
|
278 |
-
});
|
279 |
-
|
280 |
-
}
|
281 |
-
|
282 |
-
function ct_spam_all( e ) {
|
283 |
-
|
284 |
-
var data = {
|
285 |
-
'action': 'ajax_spam_all',
|
286 |
-
'security': ct_ajax_nonce
|
287 |
-
};
|
288 |
-
|
289 |
-
jQuery('.' + e.target.id).addClass('disabled');
|
290 |
-
jQuery('.spinner').css('visibility', 'visible');
|
291 |
-
jQuery.ajax({
|
292 |
-
type: "POST",
|
293 |
-
url: ajaxurl,
|
294 |
-
data: data,
|
295 |
-
success: function( msg ){
|
296 |
-
if( msg > 0 ){
|
297 |
-
jQuery('#cleantalk_comments_left').html(msg);
|
298 |
-
ct_spam_all( e );
|
299 |
-
}else{
|
300 |
-
jQuery('.' + e.target.id).removeClass('disabled');
|
301 |
-
jQuery('.spinner').css('visibility', 'hidden');
|
302 |
-
location.href='edit-comments.php?page=ct_check_spam';
|
303 |
-
}
|
304 |
-
},
|
305 |
-
error: function(jqXHR, textStatus, errorThrown) {
|
306 |
-
jQuery('#ct_error_message').show();
|
307 |
-
jQuery('#cleantalk_ajax_error').html(textStatus);
|
308 |
-
jQuery('#cleantalk_js_func').html('Check comments');
|
309 |
-
setTimeout(ct_spam_all( e ), 3000);
|
310 |
-
},
|
311 |
-
timeout: 25000
|
312 |
-
});
|
313 |
-
|
314 |
-
}
|
315 |
-
|
316 |
-
jQuery(document).ready(function(){
|
317 |
-
|
318 |
-
// Prev check parameters
|
319 |
-
if(ct_prev_accurate){
|
320 |
-
jQuery("#ct_accurate_check").prop('checked', true);
|
321 |
-
}
|
322 |
-
if(ct_prev_from){
|
323 |
-
jQuery("#ct_allow_date_range").prop('checked', true).data('state', true);
|
324 |
-
jQuery("#ct_date_range_from").removeProp('disabled').val(ct_prev_from);
|
325 |
-
jQuery("#ct_date_range_till").removeProp('disabled').val(ct_prev_till);
|
326 |
-
}
|
327 |
-
|
328 |
-
// Toggle dependences
|
329 |
-
jQuery("#ct_allow_date_range").on('change', function(){
|
330 |
-
document.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';
|
331 |
-
document.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';
|
332 |
-
if( this.checked ) {
|
333 |
-
document.cookie = 'ct_spam_dates_allowed=1; path=/; samesite=lax';
|
334 |
-
jQuery('.ct_date').prop('checked', true).attr('disabled',false);
|
335 |
-
} else {
|
336 |
-
document.cookie = 'ct_spam_dates_allowed=0; path=/; samesite=lax';
|
337 |
-
jQuery('.ct_date').prop('disabled', true).attr('disabled',true);
|
338 |
-
}
|
339 |
-
});
|
340 |
-
|
341 |
-
jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);
|
342 |
-
var dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(
|
343 |
-
{
|
344 |
-
dateFormat: 'M d yy',
|
345 |
-
maxDate:"+0D",
|
346 |
-
changeMonth:true,
|
347 |
-
changeYear:true,
|
348 |
-
showAnim: 'slideDown',
|
349 |
-
onSelect: function(selectedDate){
|
350 |
-
var option = this.id == "ct_date_range_from" ? "minDate" : "maxDate",
|
351 |
-
instance = jQuery( this ).data( "datepicker" ),
|
352 |
-
date = jQuery.datepicker.parseDate(
|
353 |
-
instance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,
|
354 |
-
selectedDate, instance.settings);
|
355 |
-
dates.not(this).datepicker("option", option, date);
|
356 |
-
document.cookie = 'ct_spam_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';
|
357 |
-
document.cookie = 'ct_spam_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';
|
358 |
-
}
|
359 |
-
}
|
360 |
-
);
|
361 |
-
|
362 |
-
function ct_start_check(continue_check){
|
363 |
-
|
364 |
-
continue_check = continue_check || null;
|
365 |
-
|
366 |
-
if(jQuery('#ct_allow_date_range').is(':checked')){
|
367 |
-
|
368 |
-
ct_date_from = jQuery('#ct_date_range_from').val();
|
369 |
-
ct_date_till = jQuery('#ct_date_range_till').val();
|
370 |
-
|
371 |
-
if(!(ct_date_from != '' && ct_date_till != '')){
|
372 |
-
alert('Please, specify a date range.');
|
373 |
-
return;
|
374 |
-
}
|
375 |
-
}
|
376 |
-
|
377 |
-
if(jQuery('#ct_accurate_check').is(':checked')){
|
378 |
-
ct_accurate_check = true;
|
379 |
-
}
|
380 |
-
|
381 |
-
jQuery('.ct_to_hide').hide();
|
382 |
-
jQuery('#ct_working_message').show();
|
383 |
-
jQuery('#ct_preloader').show();
|
384 |
-
jQuery('#ct_pause').show();
|
385 |
-
|
386 |
-
ct_working=true;
|
387 |
-
|
388 |
-
if(continue_check){
|
389 |
-
ct_show_info();
|
390 |
-
ct_send_comments();
|
391 |
-
}else
|
392 |
-
ct_clear_comments();
|
393 |
-
|
394 |
-
}
|
395 |
-
|
396 |
-
// Check comments
|
397 |
-
jQuery("#ct_check_spam_button").click(function(){
|
398 |
-
document.cookie = 'ct_paused_spam_check=0; path=/; samesite=lax';
|
399 |
-
ct_start_check(false);
|
400 |
-
});
|
401 |
-
jQuery("#ct_proceed_check_button").click(function(){
|
402 |
-
ct_start_check(true);
|
403 |
-
});
|
404 |
-
|
405 |
-
// Pause the check
|
406 |
-
jQuery('#ct_pause').on('click', function(){
|
407 |
-
ct_pause = true;
|
408 |
-
var ct_check = {
|
409 |
-
'accurate': ct_accurate_check,
|
410 |
-
'from' : ct_date_from,
|
411 |
-
'till' : ct_date_till
|
412 |
-
};
|
413 |
-
document.cookie = 'ct_paused_spam_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';
|
414 |
-
});
|
415 |
-
|
416 |
-
|
417 |
-
if(ctCommentsCheck.start === '1'){
|
418 |
-
document.cookie = 'ct_comments_start_check=0; expires=' + new Date(0).toUTCString() + '; path=/; samesite=lax';
|
419 |
-
jQuery('#ct_check_spam_button').click();
|
420 |
-
}
|
421 |
-
|
422 |
-
// Delete all spam comments
|
423 |
-
jQuery(".ct_trash_all").click(function( e ){
|
424 |
-
|
425 |
-
if (!confirm(ctCommentsCheck.ct_confirm_trash_all))
|
426 |
-
return false;
|
427 |
-
|
428 |
-
ct_trash_all( e );
|
429 |
-
|
430 |
-
});
|
431 |
-
|
432 |
-
// Mark as spam all spam comments
|
433 |
-
jQuery(".ct_spam_all").click(function( e ){
|
434 |
-
|
435 |
-
if (!confirm(ctCommentsCheck.ct_confirm_spam_all))
|
436 |
-
return false;
|
437 |
-
|
438 |
-
ct_spam_all( e );
|
439 |
-
|
440 |
-
});
|
441 |
-
|
442 |
-
});
|
443 |
-
|
444 |
-
|
445 |
-
/**
|
446 |
-
* Get cookie by name
|
447 |
-
* @param name
|
448 |
-
* @returns {string|undefined}
|
449 |
-
*/
|
450 |
-
function ctGetCookie(name) {
|
451 |
-
var matches = document.cookie.match(new RegExp(
|
452 |
-
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
453 |
-
));
|
454 |
-
return matches ? decodeURIComponent(matches[1]) : undefined;
|
455 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/cleantalk-comments-editscreen.js
DELETED
@@ -1,134 +0,0 @@
|
|
1 |
-
function ct_is_email(str){
|
2 |
-
return str.search(/.*@.*\..*/);
|
3 |
-
}
|
4 |
-
function ct_is_ip(str){
|
5 |
-
return str.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/);
|
6 |
-
}
|
7 |
-
|
8 |
-
jQuery(document).ready(function(){
|
9 |
-
|
10 |
-
/* Shows link to blacklists near every email and IP address */
|
11 |
-
if(parseInt(ctCommentsScreen.ct_show_check_links))
|
12 |
-
jQuery('.column-author a, .comment-author a').each(function(){
|
13 |
-
var ct_curr_str = jQuery(this).html();
|
14 |
-
if(ct_is_email(ct_curr_str) != -1 || ct_is_ip(ct_curr_str) != -1){
|
15 |
-
jQuery(this).after(' <a href="https://cleantalk.org/blacklists/'+ct_curr_str+'" target="_blank" title="https://cleantalk.org/blacklists/'+ct_curr_str+'" class="ct_link_new_tab"><img src="'+ctCommentsScreen.ct_img_src_new_tab+'"></a>');
|
16 |
-
}
|
17 |
-
});
|
18 |
-
|
19 |
-
/* Feedback for comments */
|
20 |
-
var ct_comment_id;
|
21 |
-
|
22 |
-
// For approved
|
23 |
-
jQuery('span.approve').on('click', function(){
|
24 |
-
var result = jQuery(this).children('a').attr('href');
|
25 |
-
result = result.match(/^comment\.php\?.*c=(\d*).*/);
|
26 |
-
ct_comment_id = result[1];
|
27 |
-
undo_comment_id = ct_comment_id;
|
28 |
-
ct_send_feedback_request(ct_comment_id, 'approve', 0);
|
29 |
-
});
|
30 |
-
|
31 |
-
// For unapprove
|
32 |
-
jQuery('span.unapprove').on('click', function(){
|
33 |
-
var result = jQuery(this).children('a').attr('href');
|
34 |
-
result = result.match(/^comment\.php\?.*c=(\d*).*/);
|
35 |
-
ct_comment_id = result[1];
|
36 |
-
undo_comment_id = ct_comment_id;
|
37 |
-
ct_send_feedback_request(ct_comment_id, 'spam', 0);
|
38 |
-
});
|
39 |
-
|
40 |
-
// For spammed
|
41 |
-
jQuery('span.spam').on('click', function(){
|
42 |
-
var result = jQuery(this).children('a').attr('href');
|
43 |
-
result = result.match(/^comment\.php\?.*c=(\d*).*/);
|
44 |
-
ct_comment_id = result[1];
|
45 |
-
undo_comment_id = ct_comment_id;
|
46 |
-
ct_send_feedback_request(ct_comment_id, 'spam', 0);
|
47 |
-
|
48 |
-
setTimeout(function(){
|
49 |
-
jQuery('tr#undo-'+ct_comment_id+' span.unspam a').click(function(){
|
50 |
-
var result = jQuery(this).attr('href');
|
51 |
-
result = result.match(/^comment\.php\?.*&c=(\d*).*/);
|
52 |
-
ct_comment_id = result[1];
|
53 |
-
ct_send_feedback_request(ct_comment_id, 'approve', 1);
|
54 |
-
});
|
55 |
-
}, 202);
|
56 |
-
|
57 |
-
});
|
58 |
-
|
59 |
-
// For unspammed
|
60 |
-
jQuery('span.unspam').on('click', function(){
|
61 |
-
var result = jQuery(this).children('a').attr('href');
|
62 |
-
result = result.match(/^comment\.php\?.*c=(\d*).*/);
|
63 |
-
ct_comment_id = result[1];
|
64 |
-
ct_send_feedback_request(ct_comment_id, 'approve', 0);
|
65 |
-
});
|
66 |
-
|
67 |
-
// For untrashed
|
68 |
-
jQuery('span.untrash a').on('click', function(){
|
69 |
-
var result = jQuery(this).attr('href');
|
70 |
-
result = result.match(/^comment\.php\?.*c=(\d*).*/);
|
71 |
-
ct_comment_id = result[1];
|
72 |
-
feedback_result = ct_send_feedback_request(ct_comment_id, 'approve', 0);
|
73 |
-
});
|
74 |
-
});
|
75 |
-
|
76 |
-
// Send feedback to backend
|
77 |
-
function ct_send_feedback_request(ct_comment_id, ct_comment_status, ct_undo){
|
78 |
-
|
79 |
-
var data = {
|
80 |
-
'action': 'ct_feedback_comment',
|
81 |
-
'security': ctCommentsScreen.ct_ajax_nonce,
|
82 |
-
'comment_id': ct_comment_id,
|
83 |
-
'comment_status': ct_comment_status
|
84 |
-
};
|
85 |
-
|
86 |
-
jQuery.ajax({
|
87 |
-
type: "POST",
|
88 |
-
url: ajaxurl,
|
89 |
-
data: data,
|
90 |
-
success: function(msg){
|
91 |
-
ct_feedback_message_output(ct_comment_id, ct_comment_status, msg, ct_undo);
|
92 |
-
},
|
93 |
-
error: function(jqXHR, textStatus, errorThrown) {
|
94 |
-
console.log(jqXHR);
|
95 |
-
console.log(textStatus);
|
96 |
-
console.log(errorThrown);
|
97 |
-
},
|
98 |
-
timeout: 5000
|
99 |
-
});
|
100 |
-
}
|
101 |
-
|
102 |
-
// Outputs CT message about feedback
|
103 |
-
function ct_feedback_message_output(ct_comment_id, ct_comment_status, ct_result, ct_undo){
|
104 |
-
if(ct_result == 1){
|
105 |
-
if(ct_comment_status == 'approve' && !ct_undo){
|
106 |
-
jQuery('tr#comment-'+ct_comment_id)
|
107 |
-
.html('')
|
108 |
-
.show()
|
109 |
-
.append("<td colspan='5'></td>").children('td')
|
110 |
-
.css('background', 'rgba(110,240,110,0.7)')
|
111 |
-
.append("<div class='spam-undo-inside'>"+ctCommentsScreen.ct_feedback_msg+"</div>");
|
112 |
-
}
|
113 |
-
if(ct_comment_status == 'spam'){
|
114 |
-
if(jQuery('tr').is('#undo-'+ct_comment_id)){
|
115 |
-
jQuery('tr#undo-'+ct_comment_id)
|
116 |
-
.css('background', 'rgba(240,110,110,0.7)');
|
117 |
-
jQuery('tr#undo-'+ct_comment_id+' div.spam-undo-inside')
|
118 |
-
.append(" "+ctCommentsScreen.ct_feedback_msg);
|
119 |
-
}else{
|
120 |
-
jQuery('tr#comment-'+ct_comment_id)
|
121 |
-
.html('')
|
122 |
-
.show()
|
123 |
-
.css('background', 'rgba(240,110,110,0.7)')
|
124 |
-
.append("<td colspan='5'></td>").children('td')
|
125 |
-
.append("<div class='spam-undo-inside'>"+ctCommentsScreen.ct_feedback_msg+"</div>");
|
126 |
-
}
|
127 |
-
}
|
128 |
-
}
|
129 |
-
if(ct_result == 0){
|
130 |
-
// Error occurred
|
131 |
-
}if(ct_result == 'no_hash'){
|
132 |
-
// No hash for this comment
|
133 |
-
}
|
134 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/cleantalk-dashboard-widget.js
DELETED
@@ -1,60 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function(){
|
2 |
-
|
3 |
-
// Set "refresh" link handler
|
4 |
-
jQuery(".ct_widget_refresh_link").on('click', function(){
|
5 |
-
jQuery('.ct_preloader').show();
|
6 |
-
setTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);
|
7 |
-
setTimeout(function(){jQuery("#ct_refresh_form").submit();}, 2500);
|
8 |
-
});
|
9 |
-
|
10 |
-
if(location.hash == '#ct_widget')
|
11 |
-
setTimeout(function(){window.scrollTo(0, jQuery('#ct_widget_wrapper').offset().top - 130);}, 1);
|
12 |
-
|
13 |
-
// Fixing default wrapper style
|
14 |
-
jQuery("#ct_widget_wrapper").parent().css('padding', 0);
|
15 |
-
|
16 |
-
// Chart
|
17 |
-
var ct_chart = document.getElementById('ct_widget_chart'),
|
18 |
-
locale = navigator.language || navigator.userLanguage;
|
19 |
-
|
20 |
-
function ctParseData(date){
|
21 |
-
var date_formatter = new Intl.DateTimeFormat(locale, {
|
22 |
-
month: "short",
|
23 |
-
day: "numeric"
|
24 |
-
});
|
25 |
-
date.sort(function(a,b){
|
26 |
-
return new Date(a[0]) - new Date(b[0])
|
27 |
-
});
|
28 |
-
date.forEach(function(d){
|
29 |
-
d[0] = Date.parse(d[0]);
|
30 |
-
d[0] = date_formatter.format(d[0]);
|
31 |
-
});
|
32 |
-
}
|
33 |
-
|
34 |
-
google.charts.load('current', {packages:['corechart', 'bar']});
|
35 |
-
google.charts.setOnLoadCallback(drawStuff);
|
36 |
-
|
37 |
-
function drawStuff() {
|
38 |
-
var data = new google.visualization.DataTable();
|
39 |
-
data.addColumn('string', 'Spam Blocked');
|
40 |
-
data.addColumn('number', 'Frequency');
|
41 |
-
|
42 |
-
ctParseData(apbctDashboardWidget.data);
|
43 |
-
data.addRows(apbctDashboardWidget.data);
|
44 |
-
|
45 |
-
var options = {
|
46 |
-
width: jQuery(".ct_widget_block").first().width(),
|
47 |
-
height: 300,
|
48 |
-
colors: ['steelblue'],
|
49 |
-
legend: 'none',
|
50 |
-
bar: {groupWidth: '95%'},
|
51 |
-
chartArea:{left:30,top:20,width:'93%',height:'80%'},
|
52 |
-
vAxis: { gridlines: { count: 5 } }
|
53 |
-
};
|
54 |
-
|
55 |
-
if(ct_chart){
|
56 |
-
var chart = new google.visualization.ColumnChart(ct_chart);
|
57 |
-
chart.draw(data, options);
|
58 |
-
}
|
59 |
-
};
|
60 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/cleantalk-debug-ajax.js
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function(){
|
2 |
-
|
3 |
-
console.log('CT debug');
|
4 |
-
|
5 |
-
// Debug. Console all AJAX requests.
|
6 |
-
jQuery(document).ajaxComplete(function(event, xhr, settings, data) {
|
7 |
-
console.log("Success!")
|
8 |
-
console.log('Event:\n');
|
9 |
-
console.log(event);
|
10 |
-
console.log('Response:\n');
|
11 |
-
console.log(xhr);
|
12 |
-
console.log('Request settings:\n');
|
13 |
-
console.log(settings);
|
14 |
-
console.log('Data:\n');
|
15 |
-
console.log(data);
|
16 |
-
});
|
17 |
-
|
18 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/cleantalk-public-admin.js
DELETED
@@ -1,89 +0,0 @@
|
|
1 |
-
jQuery(document).ready(function(){
|
2 |
-
|
3 |
-
// Set background-color similar to parents
|
4 |
-
jQuery('.ct_comment_info').parents().each(function() {
|
5 |
-
if ((e = jQuery(this).css('background-color')).length > 0 && e != 'rgba(0, 0, 0, 0)'){
|
6 |
-
jQuery('.ct_comment_info').css('background', e);
|
7 |
-
return false;
|
8 |
-
}
|
9 |
-
});
|
10 |
-
|
11 |
-
// Set same float style with article
|
12 |
-
var ct_post_float = jQuery('.ct_comment_info').prev().last().css('float');
|
13 |
-
jQuery('.ct_comment_info').css('float', ct_post_float);
|
14 |
-
|
15 |
-
var ct_posts = jQuery('.ct_comment_info');
|
16 |
-
|
17 |
-
jQuery(ct_posts).each(function(indx, elem){
|
18 |
-
curr_elem = jQuery(elem);
|
19 |
-
curr_elem.parent().prepend(curr_elem);
|
20 |
-
});
|
21 |
-
|
22 |
-
// Handler for buttons
|
23 |
-
jQuery('.ct_this_is').on('click', function(){
|
24 |
-
|
25 |
-
var ct_current_button = jQuery(this),
|
26 |
-
ct_feedback_wrap = jQuery(this).siblings('.ct_feedback_wrap'),
|
27 |
-
ct_feedback_msg = jQuery('.ct_feedback_msg'),
|
28 |
-
ct_comment_status;
|
29 |
-
|
30 |
-
if(ct_current_button.hasClass('ct_this_is_spam'))
|
31 |
-
ct_comment_status = 'spam';
|
32 |
-
else
|
33 |
-
ct_comment_status = 'approve';
|
34 |
-
|
35 |
-
var data = {
|
36 |
-
'action': 'ct_feedback_comment',
|
37 |
-
'security': ctPublicAdmin.ct_ajax_nonce,
|
38 |
-
'comment_id': ct_current_button.attr('commentid'),
|
39 |
-
'comment_status': ct_comment_status,
|
40 |
-
'change_status': 1
|
41 |
-
};
|
42 |
-
|
43 |
-
jQuery.ajax({
|
44 |
-
type: "POST",
|
45 |
-
url: ctPublicAdmin.ajaxurl,
|
46 |
-
data: data,
|
47 |
-
success: function(msg){
|
48 |
-
ct_current_button.hide();
|
49 |
-
ct_current_button.siblings('span.ct_this_is').show();
|
50 |
-
|
51 |
-
jQuery('.ct_feedback_result').hide();
|
52 |
-
if(ct_comment_status == 'approve')
|
53 |
-
jQuery('.ct_feedback_result_not_spam').show();
|
54 |
-
else
|
55 |
-
jQuery('.ct_feedback_result_spam').show();
|
56 |
-
|
57 |
-
if(msg == 1){
|
58 |
-
ct_feedback_msg.addClass('ct_feedback_success');
|
59 |
-
ct_feedback_msg.html(ctPublicAdmin.ct_feedback_msg);
|
60 |
-
}else if(msg == 0){
|
61 |
-
// Error occurred
|
62 |
-
ct_feedback_msg.addClass('ct_feedback_error');
|
63 |
-
ct_feedback_msg.html(ctPublicAdmin.ct_feedback_error);
|
64 |
-
}else if(msg == 'no_hash'){
|
65 |
-
// No hash for this comment
|
66 |
-
ct_feedback_msg.addClass('ct_feedback_no_hash');
|
67 |
-
ct_feedback_msg.html(ctPublicAdmin.ct_feedback_no_hash);
|
68 |
-
}
|
69 |
-
// Hidding feedback message for every message type
|
70 |
-
ct_feedback_wrap.show();
|
71 |
-
ct_feedback_wrap.css('display', 'inline-block');
|
72 |
-
|
73 |
-
var ct_timeout_id = ct_feedback_wrap.data('interval_id');
|
74 |
-
clearInterval(ct_timeout_id);
|
75 |
-
ct_timeout_id = setTimeout(function(){
|
76 |
-
ct_feedback_wrap.fadeOut(1000);
|
77 |
-
}, 5000);
|
78 |
-
ct_feedback_wrap.data('interval_id', ct_timeout_id);
|
79 |
-
},
|
80 |
-
error: function(jqXHR, textStatus, errorThrown) {
|
81 |
-
console.log(jqXHR);
|
82 |
-
console.log(textStatus);
|
83 |
-
console.log(errorThrown);
|
84 |
-
},
|
85 |
-
timeout: 15000
|
86 |
-
});
|
87 |
-
});
|
88 |
-
|
89 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/cleantalk-users-checkspam.js
DELETED
@@ -1,596 +0,0 @@
|
|
1 |
-
// Printf for JS
|
2 |
-
String.prototype.printf = function(){
|
3 |
-
var formatted = this;
|
4 |
-
for( var arg in arguments ) {
|
5 |
-
var before_formatted = formatted.substring(0, formatted.indexOf("%s", 0));
|
6 |
-
var after_formatted = formatted.substring(formatted.indexOf("%s", 0)+2, formatted.length);
|
7 |
-
formatted = before_formatted + arguments[arg] + after_formatted;
|
8 |
-
}
|
9 |
-
return formatted;
|
10 |
-
};
|
11 |
-
|
12 |
-
// Set deafult amount to check by request.
|
13 |
-
document.cookie = "ct_check_users__amount=" + 100 + "; path=/; samesite=lax";
|
14 |
-
|
15 |
-
// Flags
|
16 |
-
var ct_working = false,
|
17 |
-
ct_new_check = true,
|
18 |
-
ct_cooling_down_flag = false,
|
19 |
-
ct_close_animate = true,
|
20 |
-
ct_accurate_check = false,
|
21 |
-
ct_pause = false,
|
22 |
-
ct_prev_accurate = ctUsersCheck.ct_prev_accurate,
|
23 |
-
ct_prev_from = ctUsersCheck.ct_prev_from,
|
24 |
-
ct_prev_till = ctUsersCheck.ct_prev_till;
|
25 |
-
// Settings
|
26 |
-
var ct_cool_down_time = 90000,
|
27 |
-
ct_requests_counter = 0,
|
28 |
-
ct_max_requests = 60;
|
29 |
-
// Variables
|
30 |
-
var ct_ajax_nonce = ctUsersCheck.ct_ajax_nonce,
|
31 |
-
ct_users_total = 0,
|
32 |
-
ct_users_checked = 0,
|
33 |
-
ct_users_spam = 0,
|
34 |
-
ct_users_bad = 0,
|
35 |
-
ct_unchecked = 'unset',
|
36 |
-
ct_date_from = 0,
|
37 |
-
ct_date_till = 0;
|
38 |
-
|
39 |
-
/* Function: Reuturns cookie with prefix */
|
40 |
-
function apbct_cookie__get(names, prefixes){
|
41 |
-
var cookie = {};
|
42 |
-
names = names || null;
|
43 |
-
if(typeof names == 'string') names = names.split();
|
44 |
-
prefixes = prefixes || ['apbct_', 'ct_'];
|
45 |
-
if(prefixes === 'none') prefixes = null;
|
46 |
-
if(typeof prefixes == 'string') prefixes = prefixes.split();
|
47 |
-
document.cookie.split(';').forEach(function(item, i, arr){
|
48 |
-
var curr = item.trim().split('=');
|
49 |
-
// Detect by full cookie name
|
50 |
-
if(names){
|
51 |
-
names.forEach(function(name, i, all){
|
52 |
-
if(curr[0] === name)
|
53 |
-
cookie[curr[0]] = (curr[1]);
|
54 |
-
});
|
55 |
-
}
|
56 |
-
// Detect by name prefix
|
57 |
-
if(prefixes){
|
58 |
-
prefixes.forEach(function(prefix, i, all){
|
59 |
-
if(curr[0].indexOf(prefix) === 0)
|
60 |
-
cookie[curr[0]] = (curr[1]);
|
61 |
-
});
|
62 |
-
}
|
63 |
-
});
|
64 |
-
return cookie;
|
65 |
-
}
|
66 |
-
|
67 |
-
function apbct_get_cookie( name ){
|
68 |
-
var cookie = apbct_cookie__get( name, name );
|
69 |
-
if(typeof cookie === 'object' && typeof cookie[name] != 'undefined'){
|
70 |
-
return cookie[name];
|
71 |
-
}else
|
72 |
-
return null;
|
73 |
-
}
|
74 |
-
|
75 |
-
function animate_comment(to,id){
|
76 |
-
if(ct_close_animate){
|
77 |
-
if(to === 0.3){
|
78 |
-
jQuery('#comment-'+id).fadeTo(200,to,function(){
|
79 |
-
animate_comment(1,id)
|
80 |
-
});
|
81 |
-
}else{
|
82 |
-
jQuery('#comment-'+id).fadeTo(200,to,function(){
|
83 |
-
animate_comment(0.3,id)
|
84 |
-
});
|
85 |
-
}
|
86 |
-
}else{
|
87 |
-
ct_close_animate=true;
|
88 |
-
}
|
89 |
-
}
|
90 |
-
|
91 |
-
function ct_clear_users(){
|
92 |
-
|
93 |
-
var from = 0, till = 0;
|
94 |
-
if(jQuery('#ct_allow_date_range').is(':checked')) {
|
95 |
-
from = jQuery('#ct_date_range_from').val();
|
96 |
-
till = jQuery('#ct_date_range_till').val();
|
97 |
-
}
|
98 |
-
|
99 |
-
var ctSecure = location.protocol === 'https:' ? '; secure' : '';
|
100 |
-
document.cookie = 'apbct_check_users_offset' + "=" + 0 + "; path=/; samesite=lax" + ctSecure;
|
101 |
-
|
102 |
-
var data = {
|
103 |
-
'action' : 'ajax_clear_users',
|
104 |
-
'security' : ct_ajax_nonce,
|
105 |
-
'from' : from,
|
106 |
-
'till' : till,
|
107 |
-
'no_cache': Math.random()
|
108 |
-
};
|
109 |
-
|
110 |
-
jQuery.ajax({
|
111 |
-
type: "POST",
|
112 |
-
url: ajaxurl,
|
113 |
-
data: data,
|
114 |
-
success: function(msg){
|
115 |
-
ct_show_users_info();
|
116 |
-
ct_send_users();
|
117 |
-
}
|
118 |
-
});
|
119 |
-
|
120 |
-
}
|
121 |
-
|
122 |
-
//Continues the check after cooldown time
|
123 |
-
//Called by ct_send_users();
|
124 |
-
function ct_cooling_down_toggle(){
|
125 |
-
ct_cooling_down_flag = false;
|
126 |
-
ct_send_users();
|
127 |
-
ct_show_users_info();
|
128 |
-
}
|
129 |
-
|
130 |
-
function ct_send_users(){
|
131 |
-
|
132 |
-
if(ct_cooling_down_flag === true)
|
133 |
-
return;
|
134 |
-
|
135 |
-
if(ct_requests_counter >= ct_max_requests){
|
136 |
-
setTimeout(ct_cooling_down_toggle, ct_cool_down_time);
|
137 |
-
ct_requests_counter = 0;
|
138 |
-
ct_cooling_down_flag = true;
|
139 |
-
return;
|
140 |
-
}else{
|
141 |
-
ct_requests_counter++;
|
142 |
-
}
|
143 |
-
|
144 |
-
var check_amount = apbct_get_cookie('ct_check_users__amount');
|
145 |
-
|
146 |
-
var data = {
|
147 |
-
action: 'ajax_check_users',
|
148 |
-
security: ct_ajax_nonce,
|
149 |
-
new_check: ct_new_check,
|
150 |
-
unchecked: ct_unchecked,
|
151 |
-
amount: check_amount,
|
152 |
-
'no_cache': Math.random(),
|
153 |
-
'offset' : Number(getCookie('apbct_check_users_offset'))
|
154 |
-
};
|
155 |
-
|
156 |
-
if(ct_accurate_check)
|
157 |
-
data['accurate_check'] = true;
|
158 |
-
|
159 |
-
if(ct_date_from && ct_date_till){
|
160 |
-
data['from'] = ct_date_from;
|
161 |
-
data['till'] = ct_date_till;
|
162 |
-
}
|
163 |
-
|
164 |
-
jQuery.ajax({
|
165 |
-
type: "POST",
|
166 |
-
url: ajaxurl,
|
167 |
-
data: data,
|
168 |
-
success: function(msg){
|
169 |
-
|
170 |
-
msg = jQuery.parseJSON(msg);
|
171 |
-
|
172 |
-
if(parseInt(msg.error)){
|
173 |
-
ct_working=false;
|
174 |
-
if(!confirm(msg.error_message+". Do you want to proceed?")){
|
175 |
-
var new_href = 'users.php?page=ct_check_users';
|
176 |
-
if(ct_date_from != 0 && ct_date_till != 0)
|
177 |
-
new_href+='&from='+ct_date_from+'&till='+ct_date_till;
|
178 |
-
location.href = new_href;
|
179 |
-
}else
|
180 |
-
ct_send_users();
|
181 |
-
}else{
|
182 |
-
ct_new_check = false;
|
183 |
-
if(parseInt(msg.end) == 1 || ct_pause == true){
|
184 |
-
if(parseInt(msg.end) == 1)
|
185 |
-
document.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';
|
186 |
-
ct_working=false;
|
187 |
-
jQuery('#ct_working_message').hide();
|
188 |
-
var new_href = 'users.php?page=ct_check_users&ct_worked=1';
|
189 |
-
if(ct_date_from != 0 && ct_date_till != 0)
|
190 |
-
new_href+='&from='+ct_date_from+'&till='+ct_date_till;
|
191 |
-
location.href = new_href;
|
192 |
-
}else if(parseInt(msg.end) == 0){
|
193 |
-
ct_users_checked = parseInt( ct_users_checked ) + parseInt( msg.checked );
|
194 |
-
ct_users_spam = parseInt( ct_users_spam ) + parseInt (msg.spam );
|
195 |
-
ct_users_bad = parseInt( msg.bad );
|
196 |
-
ct_unchecked = ct_users_total - ct_users_checked - ct_users_bad;
|
197 |
-
var status_string = String(ctUsersCheck.ct_status_string);
|
198 |
-
var status_string = status_string.printf(ct_users_checked, ct_users_spam, ct_users_bad);
|
199 |
-
if(parseInt(ct_users_spam) > 0)
|
200 |
-
status_string += ctUsersCheck.ct_status_string_warning;
|
201 |
-
jQuery('#ct_checking_status').html(status_string);
|
202 |
-
jQuery('#ct_error_message').hide();
|
203 |
-
|
204 |
-
var offset = Number(getCookie('apbct_check_users_offset')) + 100;
|
205 |
-
var ctSecure = location.protocol === 'https:' ? '; secure' : '';
|
206 |
-
document.cookie = 'apbct_check_users_offset' + "=" + offset + "; path=/; samesite=lax" + ctSecure;
|
207 |
-
|
208 |
-
ct_send_users();
|
209 |
-
}
|
210 |
-
}
|
211 |
-
},
|
212 |
-
error: function(jqXHR, textStatus, errorThrown) {
|
213 |
-
if(check_amount > 20){
|
214 |
-
check_amount -= 20;
|
215 |
-
document.cookie = "ct_check_users__amount=" + check_amount + "; path=/; samesite=lax";
|
216 |
-
}
|
217 |
-
jQuery('#ct_error_message').show();
|
218 |
-
jQuery('#cleantalk_ajax_error').html(textStatus);
|
219 |
-
jQuery('#cleantalk_js_func').html('Check users');
|
220 |
-
setTimeout(ct_send_users(), 3000);
|
221 |
-
},
|
222 |
-
timeout: 25000
|
223 |
-
});
|
224 |
-
}
|
225 |
-
function ct_show_users_info(){
|
226 |
-
|
227 |
-
if( ct_working ){
|
228 |
-
|
229 |
-
if(ct_cooling_down_flag === true){
|
230 |
-
jQuery('#ct_cooling_notice').html('Waiting for API to cool down. (About a minute)').show();
|
231 |
-
return;
|
232 |
-
}else{
|
233 |
-
jQuery('#ct_cooling_notice').hide();
|
234 |
-
}
|
235 |
-
|
236 |
-
if( ! ct_users_total ){
|
237 |
-
|
238 |
-
var data = {
|
239 |
-
'action': 'ajax_info_users',
|
240 |
-
'security': ct_ajax_nonce,
|
241 |
-
'no_cache': Math.random()
|
242 |
-
};
|
243 |
-
|
244 |
-
if( ct_date_from && ct_date_till ){
|
245 |
-
data['from'] = ct_date_from;
|
246 |
-
data['till'] = ct_date_till;
|
247 |
-
}
|
248 |
-
|
249 |
-
jQuery.ajax({
|
250 |
-
type: "POST",
|
251 |
-
url: ajaxurl,
|
252 |
-
data: data,
|
253 |
-
success: function(msg){
|
254 |
-
msg = jQuery.parseJSON(msg);
|
255 |
-
jQuery('#ct_checking_status').html(msg.message);
|
256 |
-
ct_users_spam = msg.spam;
|
257 |
-
ct_users_checked = msg.checked;
|
258 |
-
ct_users_bad = msg.bad;
|
259 |
-
},
|
260 |
-
error: function (jqXHR, textStatus, errorThrown){
|
261 |
-
jQuery('#ct_error_message').show();
|
262 |
-
jQuery('#cleantalk_ajax_error').html(textStatus);
|
263 |
-
jQuery('#cleantalk_js_func').html('Show users');
|
264 |
-
setTimeout(ct_show_users_info(), 3000);
|
265 |
-
},
|
266 |
-
timeout: 15000
|
267 |
-
});
|
268 |
-
}
|
269 |
-
}
|
270 |
-
}
|
271 |
-
// Function to toggle dependences
|
272 |
-
function ct_toggle_depended(obj, secondary){
|
273 |
-
|
274 |
-
secondary = secondary || null;
|
275 |
-
|
276 |
-
var depended = jQuery(obj.data('depended')),
|
277 |
-
state = obj.data('state');
|
278 |
-
|
279 |
-
if(!state && !secondary){
|
280 |
-
obj.data('state', true);
|
281 |
-
depended.removeProp('disabled');
|
282 |
-
}else{
|
283 |
-
obj.data('state', false);
|
284 |
-
depended.prop('disabled', true);
|
285 |
-
depended.removeProp('checked');
|
286 |
-
if(depended.data('depended'))
|
287 |
-
ct_toggle_depended(depended, true);
|
288 |
-
}
|
289 |
-
}
|
290 |
-
|
291 |
-
// Main function of checking
|
292 |
-
function ct_start_check( continue_check ){
|
293 |
-
|
294 |
-
continue_check = continue_check || null;
|
295 |
-
|
296 |
-
if(jQuery('#ct_allow_date_range').is(':checked')){
|
297 |
-
|
298 |
-
ct_date_from = jQuery('#ct_date_range_from').val();
|
299 |
-
ct_date_till = jQuery('#ct_date_range_till').val();
|
300 |
-
|
301 |
-
if(!(ct_date_from !== '' && ct_date_till !== '')){
|
302 |
-
alert(ctUsersCheck.ct_specify_date_range);
|
303 |
-
return;
|
304 |
-
}
|
305 |
-
}
|
306 |
-
|
307 |
-
if(jQuery('#ct_accurate_check').is(':checked')){
|
308 |
-
ct_accurate_check = true;
|
309 |
-
}
|
310 |
-
|
311 |
-
//
|
312 |
-
if (
|
313 |
-
jQuery('#ct_accurate_check').is(':checked') &&
|
314 |
-
! jQuery('#ct_allow_date_range').is(':checked')
|
315 |
-
) {
|
316 |
-
alert(ctUsersCheck.ct_select_date_range);
|
317 |
-
return;
|
318 |
-
}
|
319 |
-
|
320 |
-
jQuery('.ct_to_hide').hide();
|
321 |
-
jQuery('#ct_working_message').show();
|
322 |
-
jQuery('#ct_preloader').show();
|
323 |
-
jQuery('#ct_pause').show();
|
324 |
-
|
325 |
-
ct_working = true;
|
326 |
-
|
327 |
-
if( continue_check ){
|
328 |
-
ct_show_users_info();
|
329 |
-
ct_send_users();
|
330 |
-
} else {
|
331 |
-
ct_clear_users();
|
332 |
-
}
|
333 |
-
|
334 |
-
}
|
335 |
-
|
336 |
-
function ct_delete_all_users( e ){
|
337 |
-
|
338 |
-
var data = {
|
339 |
-
'action': 'ajax_delete_all_users',
|
340 |
-
'security': ct_ajax_nonce,
|
341 |
-
'no_cache': Math.random()
|
342 |
-
};
|
343 |
-
|
344 |
-
jQuery('.' + e.target.id).addClass('disabled');
|
345 |
-
jQuery('.spinner').css('visibility', 'visible');
|
346 |
-
jQuery.ajax({
|
347 |
-
type: "POST",
|
348 |
-
url: ajaxurl,
|
349 |
-
data: data,
|
350 |
-
success: function( msg ){
|
351 |
-
if( msg > 0 ){
|
352 |
-
jQuery('#cleantalk_users_left').html(msg);
|
353 |
-
ct_delete_all_users( e, data );
|
354 |
-
}else{
|
355 |
-
jQuery('.' + e.target.id).removeClass('disabled');
|
356 |
-
jQuery('.spinner').css('visibility', 'hidden');
|
357 |
-
location.href='users.php?page=ct_check_users';
|
358 |
-
}
|
359 |
-
},
|
360 |
-
error: function(jqXHR, textStatus, errorThrown) {
|
361 |
-
jQuery('#ct_error_message').show();
|
362 |
-
jQuery('#cleantalk_ajax_error').html(textStatus);
|
363 |
-
jQuery('#cleantalk_js_func').html('All users deleteion');
|
364 |
-
setTimeout(ct_delete_all_users( e ), 3000);
|
365 |
-
},
|
366 |
-
timeout: 25000
|
367 |
-
});
|
368 |
-
}
|
369 |
-
|
370 |
-
jQuery(document).ready(function(){
|
371 |
-
|
372 |
-
// Setting dependences
|
373 |
-
|
374 |
-
// Prev check parameters
|
375 |
-
if(ct_prev_accurate){
|
376 |
-
jQuery("#ct_accurate_check").prop('checked', true);
|
377 |
-
}
|
378 |
-
if(ct_prev_from){
|
379 |
-
jQuery("#ct_allow_date_range").prop('checked', true).data('state', true);
|
380 |
-
jQuery("#ct_date_range_from").removeProp('disabled').val(ct_prev_from);
|
381 |
-
jQuery("#ct_date_range_till").removeProp('disabled').val(ct_prev_till);
|
382 |
-
}
|
383 |
-
|
384 |
-
// Toggle dependences
|
385 |
-
jQuery("#ct_allow_date_range").on('change', function(){
|
386 |
-
document.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';
|
387 |
-
document.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';
|
388 |
-
if( this.checked ) {
|
389 |
-
document.cookie = 'ct_users_dates_allowed=1; path=/; samesite=lax';
|
390 |
-
jQuery('.ct_date').prop('checked', true).attr('disabled',false);
|
391 |
-
} else {
|
392 |
-
document.cookie = 'ct_users_dates_allowed=0; path=/; samesite=lax';
|
393 |
-
jQuery('.ct_date').prop('disabled', true).attr('disabled',true);
|
394 |
-
}
|
395 |
-
});
|
396 |
-
|
397 |
-
jQuery.datepicker.setDefaults(jQuery.datepicker.regional['en']);
|
398 |
-
var dates = jQuery('#ct_date_range_from, #ct_date_range_till').datepicker(
|
399 |
-
{
|
400 |
-
dateFormat: 'M d yy',
|
401 |
-
maxDate:"+0D",
|
402 |
-
changeMonth:true,
|
403 |
-
changeYear:true,
|
404 |
-
showAnim: 'slideDown',
|
405 |
-
onSelect: function(selectedDate){
|
406 |
-
var option = this.id == "ct_date_range_from" ? "minDate" : "maxDate",
|
407 |
-
instance = jQuery( this ).data( "datepicker" ),
|
408 |
-
date = jQuery.datepicker.parseDate(
|
409 |
-
instance.settings.dateFormat || jQuery.datepicker._defaults.dateFormat,
|
410 |
-
selectedDate, instance.settings);
|
411 |
-
dates.not(this).datepicker("option", option, date);
|
412 |
-
document.cookie = 'ct_users_dates_from='+ jQuery('#ct_date_range_from').val() +'; path=/; samesite=lax';
|
413 |
-
document.cookie = 'ct_users_dates_till='+ jQuery('#ct_date_range_till').val() +'; path=/; samesite=lax';
|
414 |
-
}
|
415 |
-
}
|
416 |
-
);
|
417 |
-
|
418 |
-
// Check users
|
419 |
-
jQuery("#ct_check_spam_button").click(function(){
|
420 |
-
document.cookie = 'ct_paused_users_check=0; path=/; samesite=lax';
|
421 |
-
|
422 |
-
//
|
423 |
-
|
424 |
-
|
425 |
-
ct_start_check(false);
|
426 |
-
});
|
427 |
-
jQuery("#ct_proceed_check_button").click(function(){
|
428 |
-
ct_start_check(true);
|
429 |
-
});
|
430 |
-
|
431 |
-
// Pause the check
|
432 |
-
jQuery('#ct_pause').on('click', function(){
|
433 |
-
ct_pause = true;
|
434 |
-
var ct_check = {
|
435 |
-
'accurate': ct_accurate_check,
|
436 |
-
'from' : ct_date_from,
|
437 |
-
'till' : ct_date_till
|
438 |
-
};
|
439 |
-
document.cookie = 'ct_paused_users_check=' + JSON.stringify(ct_check) + '; path=/; samesite=lax';
|
440 |
-
});
|
441 |
-
|
442 |
-
//Approve button
|
443 |
-
jQuery(".cleantalk_delete_from_list_button").click(function(){
|
444 |
-
ct_id = jQuery(this).attr("data-id");
|
445 |
-
|
446 |
-
// Approving
|
447 |
-
var data = {
|
448 |
-
'action': 'ajax_ct_approve_user',
|
449 |
-
'security': ct_ajax_nonce,
|
450 |
-
'id': ct_id,
|
451 |
-
'no_cache': Math.random()
|
452 |
-
};
|
453 |
-
jQuery.ajax({
|
454 |
-
type: "POST",
|
455 |
-
url: ajaxurl,
|
456 |
-
data: data,
|
457 |
-
success: function(msg){
|
458 |
-
jQuery("#comment-"+ct_id).fadeOut('slow', function(){
|
459 |
-
jQuery("#comment-"+ct_id).remove();
|
460 |
-
});
|
461 |
-
},
|
462 |
-
});
|
463 |
-
|
464 |
-
// Positive feedback
|
465 |
-
var data = {
|
466 |
-
'action': 'ct_feedback_user',
|
467 |
-
'security': ct_ajax_nonce,
|
468 |
-
'user_id': ct_id,
|
469 |
-
'status': 'approve',
|
470 |
-
'no_cache': Math.random()
|
471 |
-
};
|
472 |
-
jQuery.ajax({
|
473 |
-
type: "POST",
|
474 |
-
url: ajaxurl,
|
475 |
-
data: data,
|
476 |
-
success: function(msg){
|
477 |
-
if(msg == 1){
|
478 |
-
// Success
|
479 |
-
}
|
480 |
-
if(msg == 0){
|
481 |
-
// Error occurred
|
482 |
-
}
|
483 |
-
if(msg == 'no_hash'){
|
484 |
-
// No hash
|
485 |
-
}
|
486 |
-
},
|
487 |
-
error: function(jqXHR, textStatus, errorThrown) {
|
488 |
-
|
489 |
-
},
|
490 |
-
timeout: 5000
|
491 |
-
});
|
492 |
-
|
493 |
-
});
|
494 |
-
|
495 |
-
// Request to Download CSV file.
|
496 |
-
jQuery(".ct_get_csv_file").click(function( e ){
|
497 |
-
var data = {
|
498 |
-
'action': 'ajax_ct_get_csv_file',
|
499 |
-
'security': ct_ajax_nonce,
|
500 |
-
'filename': ctUsersCheck.ct_csv_filename,
|
501 |
-
'no_cache': Math.random()
|
502 |
-
};
|
503 |
-
jQuery('.' + e.target.id).addClass('disabled');
|
504 |
-
jQuery('.spinner').css('visibility', 'visible');
|
505 |
-
jQuery.ajax({
|
506 |
-
type: "POST",
|
507 |
-
url: ajaxurl,
|
508 |
-
data: data,
|
509 |
-
success: function(msg){
|
510 |
-
if( parseInt(msg) === 0 ) {
|
511 |
-
alert(ctUsersCheck.ct_bad_csv);
|
512 |
-
} else {
|
513 |
-
var url = URL.createObjectURL(new Blob([msg]));
|
514 |
-
|
515 |
-
var dummy = document.createElement('a');
|
516 |
-
dummy.href = url;
|
517 |
-
dummy.download = ctUsersCheck.ct_csv_filename + '.csv';
|
518 |
-
|
519 |
-
document.body.appendChild(dummy);
|
520 |
-
dummy.click();
|
521 |
-
}
|
522 |
-
jQuery('.' + e.target.id).removeClass('disabled');
|
523 |
-
jQuery('.spinner').css('visibility', 'hidden');
|
524 |
-
}
|
525 |
-
});
|
526 |
-
});
|
527 |
-
|
528 |
-
// Delete inserted users
|
529 |
-
jQuery(".ct_insert_users").click(function( e ){
|
530 |
-
ct_insert_users();
|
531 |
-
});
|
532 |
-
|
533 |
-
// Insert users
|
534 |
-
jQuery(".ct_insert_users__delete").click(function( e ){
|
535 |
-
ct_insert_users( true );
|
536 |
-
});
|
537 |
-
|
538 |
-
// Delete all spam users
|
539 |
-
jQuery(".ct_delete_all_users").click(function( e ){
|
540 |
-
|
541 |
-
if ( ! confirm( ctUsersCheck.ct_confirm_deletion_all ) )
|
542 |
-
return false;
|
543 |
-
|
544 |
-
ct_delete_all_users( e );
|
545 |
-
|
546 |
-
});
|
547 |
-
|
548 |
-
function ct_insert_users(delete_accounts){
|
549 |
-
|
550 |
-
delete_accounts = delete_accounts || null;
|
551 |
-
|
552 |
-
var data = {
|
553 |
-
'action': 'ajax_insert_users',
|
554 |
-
'security': ct_ajax_nonce,
|
555 |
-
'no_cache': Math.random()
|
556 |
-
};
|
557 |
-
|
558 |
-
if(delete_accounts)
|
559 |
-
data['delete'] = true;
|
560 |
-
|
561 |
-
jQuery.ajax({
|
562 |
-
type: "POST",
|
563 |
-
url: ajaxurl,
|
564 |
-
data: data,
|
565 |
-
success: function(msg){
|
566 |
-
if(delete_accounts)
|
567 |
-
alert('Deleted ' + msg + ' users');
|
568 |
-
else
|
569 |
-
alert('Inserted ' + msg + ' users');
|
570 |
-
}
|
571 |
-
});
|
572 |
-
}
|
573 |
-
|
574 |
-
|
575 |
-
/**
|
576 |
-
* Checked ct_accurate_check
|
577 |
-
*/
|
578 |
-
jQuery('#ct_accurate_check').change(function () {
|
579 |
-
if(this.checked) {
|
580 |
-
jQuery('#ct_allow_date_range').prop('checked', true);
|
581 |
-
jQuery('.ct_date').prop('checked', true).attr('disabled',false);
|
582 |
-
}
|
583 |
-
});
|
584 |
-
});
|
585 |
-
|
586 |
-
/**
|
587 |
-
* Get cookie by name
|
588 |
-
* @param name
|
589 |
-
* @returns {string|undefined}
|
590 |
-
*/
|
591 |
-
function getCookie(name) {
|
592 |
-
let matches = document.cookie.match(new RegExp(
|
593 |
-
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
|
594 |
-
));
|
595 |
-
return matches ? decodeURIComponent(matches[1]) : undefined;
|
596 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/src/cleantalk-users-editscreen.js
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
function ct_is_email(str){
|
2 |
-
return str.search(/.*@.*\..*/);
|
3 |
-
}
|
4 |
-
function ct_is_ip(str){
|
5 |
-
return str.search(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/);
|
6 |
-
}
|
7 |
-
|
8 |
-
jQuery(document).ready(function(){
|
9 |
-
|
10 |
-
|
11 |
-
if(parseInt(ctUsersScreen.ct_show_check_links)) {
|
12 |
-
|
13 |
-
/* Shows link to blacklists near every email and IP address */
|
14 |
-
jQuery('.column-email a').each(function(){
|
15 |
-
var ct_curr_str = jQuery(this).html();
|
16 |
-
if( ct_is_email(ct_curr_str) !== -1 ){
|
17 |
-
jQuery(this).after(' <a href="https://cleantalk.org/blacklists/'+ct_curr_str+'" target="_blank" title="https://cleantalk.org/blacklists/'+ct_curr_str+'" class="ct_link_new_tab"><img src="'+ctUsersScreen.ct_img_src_new_tab+'"></a>');
|
18 |
-
}
|
19 |
-
});
|
20 |
-
|
21 |
-
/* Show checked ico near avatar */
|
22 |
-
jQuery('.username.column-username').each(function(){
|
23 |
-
|
24 |
-
var apbct_checking_el = jQuery(this).siblings('.apbct_status').children('span');
|
25 |
-
var apbct_checking_status = apbct_checking_el.attr('id');
|
26 |
-
var apbct_checking_status_text = apbct_checking_el.text();
|
27 |
-
|
28 |
-
var apbct_add_text_element = jQuery('<span>', {
|
29 |
-
text : apbct_checking_status_text
|
30 |
-
});
|
31 |
-
var apbct_add_ico_ok = jQuery('<i>', {
|
32 |
-
class : 'apbct-icon-ok'
|
33 |
-
});
|
34 |
-
var apbct_add_ico_cancel = jQuery('<i>', {
|
35 |
-
class : 'apbct-icon-cancel',
|
36 |
-
css : {
|
37 |
-
color : 'red'
|
38 |
-
}
|
39 |
-
});
|
40 |
-
|
41 |
-
if( apbct_checking_status ==='apbct_not_checked' ) {
|
42 |
-
jQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);
|
43 |
-
}
|
44 |
-
if( apbct_checking_status ==='apbct_checked_not_spam' ) {
|
45 |
-
apbct_add_ico_ok.attr('style', 'color:green;');
|
46 |
-
jQuery(this).children('.row-actions').before(apbct_add_ico_ok).before(apbct_add_text_element);
|
47 |
-
}
|
48 |
-
if( apbct_checking_status ==='apbct_checked_spam' ) {
|
49 |
-
jQuery(this).children('.row-actions').before(apbct_add_ico_cancel).before(apbct_add_text_element);
|
50 |
-
}
|
51 |
-
|
52 |
-
});
|
53 |
-
|
54 |
-
}
|
55 |
-
|
56 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lib/Cleantalk/Antispam/Cleantalk.php
CHANGED
@@ -416,7 +416,7 @@ class Cleantalk
|
|
416 |
}
|
417 |
|
418 |
$starttime = microtime(true);
|
419 |
-
$file = @fsockopen($host,
|
420 |
$stoptime = microtime(true);
|
421 |
|
422 |
if ( ! $file ) {
|
416 |
}
|
417 |
|
418 |
$starttime = microtime(true);
|
419 |
+
$file = @fsockopen($host, 443, $errno, $errstr, $this->max_server_timeout / 1000);
|
420 |
$stoptime = microtime(true);
|
421 |
|
422 |
if ( ! $file ) {
|
lib/Cleantalk/Antispam/Integrations/EasyDigitalDownloads.php
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Cleantalk\Antispam\Integrations;
|
4 |
+
|
5 |
+
use Cleantalk\ApbctWP\Variables\Post;
|
6 |
+
|
7 |
+
class EasyDigitalDownloads extends IntegrationBase
|
8 |
+
{
|
9 |
+
public function getDataForChecking($argument)
|
10 |
+
{
|
11 |
+
if ( Post::get('edd_action') === "user_register" ) {
|
12 |
+
/**
|
13 |
+
* Filter for POST
|
14 |
+
*/
|
15 |
+
$input_array = apply_filters('apbct__filter_post', $_POST);
|
16 |
+
$data = ct_get_fields_any($input_array);
|
17 |
+
$data['register'] = true;
|
18 |
+
return $data;
|
19 |
+
}
|
20 |
+
return null;
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* @param $message
|
25 |
+
*
|
26 |
+
* @psalm-suppress UnusedVariable
|
27 |
+
*/
|
28 |
+
public function doBlock($message)
|
29 |
+
{
|
30 |
+
global $ct_comment;
|
31 |
+
$ct_comment = $message;
|
32 |
+
ct_die(null, null);
|
33 |
+
}
|
34 |
+
}
|
lib/Cleantalk/Antispam/Integrations/GiveWP.php
CHANGED
@@ -8,7 +8,7 @@ class GiveWP extends IntegrationBase
|
|
8 |
{
|
9 |
public function getDataForChecking($argument)
|
10 |
{
|
11 |
-
if ( Post::get('action') === 'give_process_donation'
|
12 |
/**
|
13 |
* Filter for POST
|
14 |
*/
|
8 |
{
|
9 |
public function getDataForChecking($argument)
|
10 |
{
|
11 |
+
if ( Post::get('action') === 'give_process_donation' ) {
|
12 |
/**
|
13 |
* Filter for POST
|
14 |
*/
|
lib/Cleantalk/Antispam/Integrations/MemberPress.php
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
namespace Cleantalk\Antispam\Integrations;
|
4 |
+
|
5 |
+
use Cleantalk\ApbctWP\Variables\Post;
|
6 |
+
|
7 |
+
class MemberPress extends IntegrationBase
|
8 |
+
{
|
9 |
+
private $return_argument = true;
|
10 |
+
|
11 |
+
public function getDataForChecking($argument)
|
12 |
+
{
|
13 |
+
$this->return_argument = $argument;
|
14 |
+
if (
|
15 |
+
apbct_is_plugin_active('memberpress/memberpress.php')
|
16 |
+
&& ! empty($_POST)
|
17 |
+
&& Post::get('user_email')
|
18 |
+
&& Post::get('user_login')
|
19 |
+
) {
|
20 |
+
/**
|
21 |
+
* Filter for POST
|
22 |
+
*/
|
23 |
+
$input_array = apply_filters('apbct__filter_post', $_POST);
|
24 |
+
$data = ct_get_fields_any($input_array);
|
25 |
+
$data['register'] = true;
|
26 |
+
|
27 |
+
return $data;
|
28 |
+
}
|
29 |
+
|
30 |
+
return null;
|
31 |
+
}
|
32 |
+
|
33 |
+
/**
|
34 |
+
* @param $message
|
35 |
+
*
|
36 |
+
* @return array
|
37 |
+
* @psalm-suppress UnusedVariable
|
38 |
+
*/
|
39 |
+
public function doBlock($message)
|
40 |
+
{
|
41 |
+
global $ct_comment;
|
42 |
+
$ct_comment = ! empty($ct_comment) ?: 'Forbidden. Spam registration detected.';
|
43 |
+
|
44 |
+
return array('user_email' => $ct_comment);
|
45 |
+
}
|
46 |
+
|
47 |
+
public function allow()
|
48 |
+
{
|
49 |
+
return $this->return_argument;
|
50 |
+
}
|
51 |
+
}
|
lib/Cleantalk/ApbctWP/CleantalkUpgrader.php
CHANGED
@@ -80,6 +80,8 @@ class CleantalkUpgrader extends \Plugin_Upgrader
|
|
80 |
* @param array|object $options
|
81 |
*
|
82 |
* @return array|bool|string|\WP_Error
|
|
|
|
|
83 |
*/
|
84 |
public function run($options)
|
85 |
{
|
80 |
* @param array|object $options
|
81 |
*
|
82 |
* @return array|bool|string|\WP_Error
|
83 |
+
*
|
84 |
+
* @psalm-suppress ImplementedReturnTypeMismatch
|
85 |
*/
|
86 |
public function run($options)
|
87 |
{
|
lib/Cleantalk/ApbctWP/CleantalkUpgraderSkin.php
CHANGED
@@ -27,9 +27,9 @@ class CleantalkUpgraderSkin extends \WP_Upgrader_Skin
|
|
27 |
|
28 |
/**
|
29 |
*
|
30 |
-
* @param string $
|
31 |
*/
|
32 |
-
public function feedback($
|
33 |
{
|
34 |
}
|
35 |
|
27 |
|
28 |
/**
|
29 |
*
|
30 |
+
* @param string $feedback
|
31 |
*/
|
32 |
+
public function feedback($feedback, ...$args)
|
33 |
{
|
34 |
}
|
35 |
|
lib/Cleantalk/ApbctWP/CleantalkUpgraderSkinDeprecated.php
CHANGED
@@ -28,11 +28,11 @@ class CleantalkUpgraderSkinDeprecated extends \WP_Upgrader_Skin
|
|
28 |
|
29 |
/**
|
30 |
*
|
31 |
-
* @param string $
|
32 |
*
|
33 |
* @psalm-suppress MethodSignatureMismatch
|
34 |
*/
|
35 |
-
public function feedback($
|
36 |
{
|
37 |
}
|
38 |
|
28 |
|
29 |
/**
|
30 |
*
|
31 |
+
* @param string $feedback
|
32 |
*
|
33 |
* @psalm-suppress MethodSignatureMismatch
|
34 |
*/
|
35 |
+
public function feedback($feedback)
|
36 |
{
|
37 |
}
|
38 |
|
lib/Cleantalk/ApbctWP/Firewall/AntiCrawler.php
CHANGED
@@ -436,9 +436,12 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule
|
|
436 |
|
437 |
$net_count = $apbct->stats['sfw']['entries'];
|
438 |
|
439 |
-
|
440 |
-
|
441 |
-
|
|
|
|
|
|
|
442 |
}
|
443 |
|
444 |
$block_message = sprintf(
|
@@ -451,7 +454,6 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule
|
|
451 |
|
452 |
// Translation
|
453 |
$replaces = array(
|
454 |
-
'{SFW_DIE_CUSTOM_LOGO}' => $custom_logo,
|
455 |
'{SFW_DIE_NOTICE_IP}' => $block_message,
|
456 |
'{SFW_DIE_MAKE_SURE_JS_ENABLED}' => __(
|
457 |
'To continue working with the web site, please make sure that you have enabled JavaScript.',
|
@@ -470,7 +472,10 @@ class AntiCrawler extends \Cleantalk\Common\Firewall\FirewallModule
|
|
470 |
'{COOKIE_ANTICRAWLER}' => hash('sha256', $apbct->api_key . $apbct->data['salt']),
|
471 |
'{COOKIE_ANTICRAWLER_PASSED}' => '1',
|
472 |
'{GENERATED}' => '<p>The page was generated at ' . date('D, d M Y H:i:s') . "</p>",
|
473 |
-
'{SCRIPT_URL}' => $js_url
|
|
|
|
|
|
|
474 |
);
|
475 |
|
476 |
foreach ( $replaces as $place_holder => $replace ) {
|
436 |
|
437 |
$net_count = $apbct->stats['sfw']['entries'];
|
438 |
|
439 |
+
// Custom Logo
|
440 |
+
$custom_logo_img = '';
|
441 |
+
$custom_logo_id = isset($apbct->settings['cleantalk_custom_logo']) ? $apbct->settings['cleantalk_custom_logo'] : false;
|
442 |
+
|
443 |
+
if ($custom_logo_id && ($image_attributes = wp_get_attachment_image_src($custom_logo_id, array(150, 150)))) {
|
444 |
+
$custom_logo_img = '<img src="' . esc_url($image_attributes[0]) . '" width="150" alt="" />';
|
445 |
}
|
446 |
|
447 |
$block_message = sprintf(
|
454 |
|
455 |
// Translation
|
456 |
$replaces = array(
|
|
|
457 |
'{SFW_DIE_NOTICE_IP}' => $block_message,
|
458 |
'{SFW_DIE_MAKE_SURE_JS_ENABLED}' => __(
|
459 |
'To continue working with the web site, please make sure that you have enabled JavaScript.',
|
472 |
'{COOKIE_ANTICRAWLER}' => hash('sha256', $apbct->api_key . $apbct->data['salt']),
|
473 |
'{COOKIE_ANTICRAWLER_PASSED}' => '1',
|
474 |
'{GENERATED}' => '<p>The page was generated at ' . date('D, d M Y H:i:s') . "</p>",
|
475 |
+
'{SCRIPT_URL}' => $js_url,
|
476 |
+
|
477 |
+
// Custom Logo
|
478 |
+
'{CUSTOM_LOGO}' => $custom_logo_img
|
479 |
);
|
480 |
|
481 |
foreach ( $replaces as $place_holder => $replace ) {
|
lib/Cleantalk/ApbctWP/Firewall/AntiFlood.php
CHANGED
@@ -214,6 +214,14 @@ class AntiFlood extends \Cleantalk\Common\Firewall\FirewallModule
|
|
214 |
|
215 |
$net_count = $apbct->stats['sfw']['entries'];
|
216 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
217 |
// Translation
|
218 |
$replaces = array(
|
219 |
'{SFW_DIE_NOTICE_IP}' => __(
|
@@ -238,7 +246,10 @@ class AntiFlood extends \Cleantalk\Common\Firewall\FirewallModule
|
|
238 |
'{HOST}' => get_home_url() . ', ' . APBCT_VERSION,
|
239 |
'{GENERATED}' => '<p>The page was generated at ' . date('D, d M Y H:i:s') . "</p>",
|
240 |
'{COOKIE_ANTIFLOOD_PASSED}' => md5($this->api_key . $result['ip']),
|
241 |
-
'{SCRIPT_URL}' => $js_url
|
|
|
|
|
|
|
242 |
);
|
243 |
|
244 |
foreach ($replaces as $place_holder => $replace) {
|
214 |
|
215 |
$net_count = $apbct->stats['sfw']['entries'];
|
216 |
|
217 |
+
// Custom Logo
|
218 |
+
$custom_logo_img = '';
|
219 |
+
$custom_logo_id = isset($apbct->settings['cleantalk_custom_logo']) ? $apbct->settings['cleantalk_custom_logo'] : false;
|
220 |
+
|
221 |
+
if ($custom_logo_id && ($image_attributes = wp_get_attachment_image_src($custom_logo_id, array(150, 150)))) {
|
222 |
+
$custom_logo_img = '<img src="' . esc_url($image_attributes[0]) . '" width="150" alt="" />';
|
223 |
+
}
|
224 |
+
|
225 |
// Translation
|
226 |
$replaces = array(
|
227 |
'{SFW_DIE_NOTICE_IP}' => __(
|
246 |
'{HOST}' => get_home_url() . ', ' . APBCT_VERSION,
|
247 |
'{GENERATED}' => '<p>The page was generated at ' . date('D, d M Y H:i:s') . "</p>",
|
248 |
'{COOKIE_ANTIFLOOD_PASSED}' => md5($this->api_key . $result['ip']),
|
249 |
+
'{SCRIPT_URL}' => $js_url,
|
250 |
+
|
251 |
+
// Custom Logo
|
252 |
+
'{CUSTOM_LOGO}' => $custom_logo_img
|
253 |
);
|
254 |
|
255 |
foreach ($replaces as $place_holder => $replace) {
|
lib/Cleantalk/ApbctWP/Firewall/SFW.php
CHANGED
@@ -321,6 +321,14 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule
|
|
321 |
$request_uri = preg_replace('%sfw_test_ip=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}&?%', '', $request_uri);
|
322 |
}
|
323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
// Translation
|
325 |
$replaces = array(
|
326 |
'{SFW_DIE_NOTICE_IP}' => $block_message,
|
@@ -365,6 +373,9 @@ class SFW extends \Cleantalk\Common\Firewall\FirewallModule
|
|
365 |
|
366 |
// Message about IP status
|
367 |
'{MESSAGE_IP_STATUS}' => '',
|
|
|
|
|
|
|
368 |
);
|
369 |
|
370 |
/**
|
321 |
$request_uri = preg_replace('%sfw_test_ip=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}&?%', '', $request_uri);
|
322 |
}
|
323 |
|
324 |
+
// Custom Logo
|
325 |
+
$custom_logo_img = '';
|
326 |
+
$custom_logo_id = isset($apbct->settings['cleantalk_custom_logo']) ? $apbct->settings['cleantalk_custom_logo'] : false;
|
327 |
+
|
328 |
+
if ($custom_logo_id && ($image_attributes = wp_get_attachment_image_src($custom_logo_id, array(150, 150)))) {
|
329 |
+
$custom_logo_img = '<img src="' . esc_url($image_attributes[0]) . '" width="150" alt="" />';
|
330 |
+
}
|
331 |
+
|
332 |
// Translation
|
333 |
$replaces = array(
|
334 |
'{SFW_DIE_NOTICE_IP}' => $block_message,
|
373 |
|
374 |
// Message about IP status
|
375 |
'{MESSAGE_IP_STATUS}' => '',
|
376 |
+
|
377 |
+
// Custom Logo
|
378 |
+
'{CUSTOM_LOGO}' => $custom_logo_img
|
379 |
);
|
380 |
|
381 |
/**
|
lib/Cleantalk/ApbctWP/Firewall/die_page_anticrawler.html
CHANGED
@@ -201,7 +201,7 @@
|
|
201 |
<body>
|
202 |
<div class='container'>
|
203 |
<div>
|
204 |
-
{
|
205 |
</div>
|
206 |
<h1 class='main'>{SFW_DIE_NOTICE_IP}</h1>
|
207 |
|
201 |
<body>
|
202 |
<div class='container'>
|
203 |
<div>
|
204 |
+
{CUSTOM_LOGO}
|
205 |
</div>
|
206 |
<h1 class='main'>{SFW_DIE_NOTICE_IP}</h1>
|
207 |
|
lib/Cleantalk/ApbctWP/Firewall/die_page_antiflood.html
CHANGED
@@ -200,6 +200,9 @@
|
|
200 |
|
201 |
<body>
|
202 |
<div class='container'>
|
|
|
|
|
|
|
203 |
<h1 class='main'>{SFW_DIE_NOTICE_IP}<a href='https://cleantalk.org/blacklists/{REMOTE_ADDRESS}' target='_blank'> {REMOTE_ADDRESS}</a></h1>
|
204 |
|
205 |
<div id='js_info'><br />{SFW_DIE_MAKE_SURE_JS_ENABLED}</div>
|
200 |
|
201 |
<body>
|
202 |
<div class='container'>
|
203 |
+
<div>
|
204 |
+
{CUSTOM_LOGO}
|
205 |
+
</div>
|
206 |
<h1 class='main'>{SFW_DIE_NOTICE_IP}<a href='https://cleantalk.org/blacklists/{REMOTE_ADDRESS}' target='_blank'> {REMOTE_ADDRESS}</a></h1>
|
207 |
|
208 |
<div id='js_info'><br />{SFW_DIE_MAKE_SURE_JS_ENABLED}</div>
|
lib/Cleantalk/ApbctWP/Firewall/die_page_sfw.html
CHANGED
@@ -204,8 +204,10 @@
|
|
204 |
|
205 |
<body>
|
206 |
<div class='container'>
|
|
|
|
|
|
|
207 |
<h1 class='main'>{SFW_DIE_NOTICE_IP}</h1>
|
208 |
-
|
209 |
<h3>{REAL_IP__HEADER} {REAL_IP}</h3>
|
210 |
<h3>{TEST_IP__HEADER} {TEST_IP}</h3>
|
211 |
|
204 |
|
205 |
<body>
|
206 |
<div class='container'>
|
207 |
+
<div>
|
208 |
+
{CUSTOM_LOGO}
|
209 |
+
</div>
|
210 |
<h1 class='main'>{SFW_DIE_NOTICE_IP}</h1>
|
|
|
211 |
<h3>{REAL_IP__HEADER} {REAL_IP}</h3>
|
212 |
<h3>{TEST_IP__HEADER} {TEST_IP}</h3>
|
213 |
|
lib/Cleantalk/ApbctWP/Variables/NoCookie.php
CHANGED
@@ -3,8 +3,6 @@
|
|
3 |
namespace Cleantalk\ApbctWP\Variables;
|
4 |
|
5 |
use Cleantalk\ApbctWP\Helper;
|
6 |
-
use Cleantalk\Variables\Post;
|
7 |
-
use Cleantalk\Variables\Server;
|
8 |
|
9 |
class NoCookie
|
10 |
{
|
3 |
namespace Cleantalk\ApbctWP\Variables;
|
4 |
|
5 |
use Cleantalk\ApbctWP\Helper;
|
|
|
|
|
6 |
|
7 |
class NoCookie
|
8 |
{
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== Spam protection, AntiSpam, FireWall by CleanTalk ===
|
2 |
-
Contributors:
|
3 |
Tags: spam, antispam, anti-spam, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 6.0
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 5.
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
@@ -13,7 +13,7 @@ Spam protection, anti-spam, firewall, premium plugin. No spam comments & users,
|
|
13 |
|
14 |
No CAPTCHA, no questions, no animal counting, no puzzles, no math and no spam bots. Universal AntiSpam plugin.
|
15 |
|
16 |
-
=
|
17 |
1. Stops spam comments.
|
18 |
2. Stops spam registrations.
|
19 |
3. Stops spam contact emails.
|
@@ -23,20 +23,20 @@ No CAPTCHA, no questions, no animal counting, no puzzles, no math and no spam bo
|
|
23 |
7. Stops spam surveys, polls.
|
24 |
8. Stops spam in widgets.
|
25 |
9. Stops spam in WooCommerce.
|
26 |
-
10.
|
27 |
-
11.
|
28 |
-
12. Compatible with
|
29 |
-
13.
|
30 |
14. Blocking disposable & temporary emails.
|
31 |
15. No Spam - No Google Penalties. Give your SEO boost.
|
32 |
16. Mobile friendly Anti Spam & FireWall.
|
33 |
17. Stops spam in Search Form.
|
34 |
18. Disable comments.
|
35 |
-
19. Spam FireWall: Anti-Flood
|
36 |
-
20. Spam FireWall: Anti-Crawler
|
37 |
-
21. Hide «Website» field for comments
|
38 |
-
22. Block messages by languages, countries, networks.
|
39 |
-
23. Email Address Encoder
|
40 |
|
41 |
= Free trial then $12 per year =
|
42 |
CleanTalk is an anti-spam plugin which works with the premium Cloud Anti-Spam service cleantalk.org. This plugin as a service <a href="https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#6-software-as-a-service-is-permitted">https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#6-software-as-a-service-is-permitted</a>
|
@@ -45,8 +45,9 @@ CleanTalk is an anti-spam plugin which works with the premium Cloud Anti-Spam se
|
|
45 |
> CleanTalk - Cloud-Based Anti-Spam Service to Keep Your Site Bot-Free.
|
46 |
> <a href="https://newswatchtv.com/2018/07/18/cleantalk-newswatch-review/" target="_blank">NewsWatch Review</a>.
|
47 |
|
48 |
-
>
|
49 |
-
>
|
|
|
50 |
|
51 |
>I know you have heard of a number of anti-spam plugins. But you must know, the cloud-based ones are the best regarding detection rate. They compare all the content in forms with their own algorithm to find out the legibility.
|
52 |
>*<a href="https://www.techwibe.com/cleantalk-wordpress-plugin-review/" target="_blank">www.techwibe.com</a>*
|
@@ -57,10 +58,6 @@ CleanTalk is an anti-spam plugin which works with the premium Cloud Anti-Spam se
|
|
57 |
= AntiSpam protection for comments =
|
58 |
Native spam protection for WordPress, JetPack comments and any other comment plugins. The plugin moves spam comments to SPAM folder or you can set the option to ban spam comments silently. You can also enable the option in the plugin settings to auto-delete comments from SPAM folder.
|
59 |
|
60 |
-
= Spam bots registrations filter =
|
61 |
-
|
62 |
-
= Spam filter for contact forms =
|
63 |
-
|
64 |
= Contact Form by WPForms spam filter =
|
65 |
Plugin extends Contact Form by WPForms to provide spam protection. It filters spam submissions for each type of forms - simple contact form, marketing form, request a quote and etc.
|
66 |
|
@@ -77,13 +74,9 @@ Plugin extends spam protection for Formidable Form Builder. It filters spam subm
|
|
77 |
Plugin extends spam protection for Contact Form 7 (CF7). It can be used with any other third-party spam filters.
|
78 |
<a href="https://blog.cleantalk.org/how-to-protect-your-contactform7-contact-form-using-cleantalk-anti-spam-plugin/">How to protect your Contact Form 7 using CleanTalk Anti-Spam plugin</a>
|
79 |
|
80 |
-
= Ninja forms contact form spam filter =
|
81 |
-
|
82 |
= WooCommerce spam filter =
|
83 |
Anti-spam by CleanTalk filters spam registrations and spam reviews for WooCommerce. The plugin is fully compatible with WooCommerce 2.1 and higher.
|
84 |
|
85 |
-
= Newsletters antispam filter =
|
86 |
-
|
87 |
= Spam filter for theme contact forms =
|
88 |
The plugin blocks spam emails via any theme (built-in ones included) contact forms. The plugin filters spam emails silently (without any error notices on WordPress frontend) in AJAX forms as well.
|
89 |
|
@@ -93,10 +86,12 @@ Spam protection for everything about bbPress: logins, registrations, forums, top
|
|
93 |
= Other spam filters =
|
94 |
* WordPress Landing Pages.
|
95 |
* WP User Frontend, UserPro.
|
|
|
|
|
|
|
|
|
96 |
* Any WordPress form (checkbox 'Custom contact forms').
|
97 |
-
* Any submission to the site (checkbox 'Check all POST data')
|
98 |
-
|
99 |
-
= Compatible with WordPress cache plugins =
|
100 |
|
101 |
= Check existing comments for spam. Bulk spam comments removal. Spam comment Cleaner =
|
102 |
With the help of anti-spam by CleanTalk you can inspect through existing comments to find and quickly delete spam comments at once. To use this function, go to WP Console -> Comments -> Find spam comments.
|
@@ -104,97 +99,48 @@ With the help of anti-spam by CleanTalk you can inspect through existing comment
|
|
104 |
= Check existing users for spam. Bulk spam accounts removal. Spam users cleaner =
|
105 |
With the help of anti-spam by CleanTalk you can inspect through existing accounts to find and quickly delete spam users at once. For use this function, go to WP Console -> Users -> Check for spam. Also, you can export a list of spam users to the CSV.
|
106 |
|
107 |
-
= Blocking users by country =
|
108 |
-
Automatically block comments and registrations from the countries you have set a ban for. This option is useful in cases of manual spam protection and for protection enhancement. If your site is not intended for international audience and you do not expect comments/users from other countries.
|
109 |
-
|
110 |
-
= Blocking comments by "stop words" =
|
111 |
-
You can block comments which contain "stop words" to enhance spam protection and messages with obscene words blocking. You can add particular words or phrases.
|
112 |
-
|
113 |
= Private black lists for anti-spam service =
|
114 |
-
Automatically block comments and registrations from your private black
|
115 |
-
IP/email address list. This option helps to strengthen the spam protection from a manual spam or block unwanted comments from users. You can add not only the certain IP addresses, but also a separate subnet to your personal black list.
|
116 |
-
|
117 |
-
= Private black list for Spam FireWall =
|
118 |
-
It allows you to add individual IP addresses and subnets to Spam FireWall. It
|
119 |
-
blocks the spam attacks from IP addresses which are not included in the SFW base yet. This option can help to block HTTP/HTTPS DDoS, SQL, brute force attacks and any others that made it through the HTTP/HTTPS. You can add not only the certain IP addresses, but also a separate subnet to your personal black list.
|
120 |
|
121 |
= Hide «Website» field for comments =
|
122 |
This option hides the «Website» field from standard WordPress comments forms. After that spammers won't be able to send spam links using «Website» field in the bottom of the comments form.
|
123 |
-
This option is disabled by default and can be enabled in plugin Settings in your WordPress dashboard.
|
124 |
|
125 |
= Low false/positive rate =
|
126 |
-
This plugin uses multiple anti-spam tests to filter spam bots having as low false/positive rate as possible.
|
127 |
-
|
128 |
-
= How effective is CleanTalk? =
|
129 |
-
Accurately blocking spam is not an easy thing to do, but CleanTalk has a very low proven False/Positive rate. Here is actual statistics on false positives for all customers.
|
130 |
-
|
131 |
-
* Registrations - 0.004%
|
132 |
-
* Comments - 0.004%
|
133 |
-
* Contact forms - 0.006%
|
134 |
-
* Orders (WooCommerce) - 0.016%
|
135 |
-
* Site search - 0.001%
|
136 |
|
137 |
-
|
138 |
-
|
139 |
-
= How CleanTalk improves SEO for your website? =
|
140 |
So, you already know that the speed of the site has a direct impact on SEO.
|
141 |
|
142 |
*CleanTalk works faster than most of the other anti-spam plugins.* It is common knowledge that the faster your site loads, the better your customer experience is, the better your SEO will be, and the better your site will convert. Speed is becoming increasingly important in SEO, conversion and user experience. Today, site speed is one of the most important ranking factors on Google. A site that loads slowly will lose visitors and potential revenue.
|
143 |
|
144 |
-
|
145 |
-
|
146 |
-
Among anti-spam plugins CleanTalk AntiSpam is one of the fastest. Despite the
|
147 |
-
large plugin functionality, the developers have optimized the performance of
|
148 |
the plugin so that AntiSpam by CleanTalk is faster than most analogs. This contributes to the cloud service architecture, as all calculations take place in the cloud, not on the server, the server receives the finished result for further action.
|
149 |
|
150 |
https://s.w.org/plugins/cleantalk-spam-protect/screenshot-5.png?r=1288723
|
151 |
|
152 |
-
|
153 |
-
* A visitor writes a comment or registers
|
154 |
-
* Anti-Spam by CleanTalk plugin sends action parameters into the CleanTalk cloud
|
155 |
-
* Service analyzes the parameters
|
156 |
-
* If this is a visitor, the comment will be published. If it's a spam bot, then CleanTalk blocks this comment or registration.
|
157 |
-
* Parameters are written to the spam log which can be viewed in the service Dashboard.
|
158 |
-
|
159 |
-
CleanTalk team has been developing a cloud antispam system for five years and has created a truly reliable anti-spam service designed for you to guarantee
|
160 |
-
your safety.
|
161 |
-
|
162 |
-
= Spam attacks log =
|
163 |
-
Service CleanTalk (this plugin is a client application for CleanTalk anti-spam service) records all filtered comments, registration and other spam attacks in the "Log of spam attacks" and stores the data in the log for up to 45 days. Using the log, you can ensure reliable protection of your website from spam and no false/positive filtering.
|
164 |
|
165 |
= Spam FireWall =
|
166 |
-
|
167 |
-
|
168 |
-
Spam FireWall is fully compatible with the most popular VPN services.
|
169 |
-
Also, Spam FireWall supports all search engines Google, Bing, Yahoo, Baidu, MSN, Yandex and etc.
|
170 |
|
171 |
-
= How Spam FireWall
|
172 |
* The visitor enters to your web site.
|
173 |
* HTTP request data are being checked in the nearly 5.8 million of the identified spam bot IPs.
|
174 |
* If it is an active spam bot, the bot gets a blank page, if it is a visitor then he receives a normal page. This process is completely transparent for the visitors.
|
175 |
|
176 |
All the CleanTalk Spam FireWall activity is being logged in the process of filtering.
|
177 |
|
178 |
-
= Spam FireWall DDoS Protection =
|
179 |
-
Spam FireWall can mitigate HTTP/HTTPS DDoS attacks. When an intruder makes GET requests to attack your website, Spam FireWall blocks all requests from bad IP addresses. Your website gives the intruder a special page with the description of DDoS rejection instead of the website pages. Therefore Spam FireWall helps to reduce CPU usage of your server.
|
180 |
-
[youtube https://www.youtube.com/watch?v=Eu5Zqryvj4k]
|
181 |
-
|
182 |
= Spam FireWall: Anti-Flood & Anti-Crawler =
|
183 |
Spam FireWall: Anti-Flood and Anti-Crawler options are intended for blocking unwanted bots, content parsing, shop goods prices parsing or aggressive website scanning bots. Learn more https://cleantalk.org/help/anti-flood-and-anti-crawler
|
184 |
|
185 |
-
=
|
186 |
-
|
187 |
-
|
188 |
-
= AntiSpam plugin info =
|
189 |
-
CleanTalk is an all-in-one antispam solution for WordPress that protects login, comment, contact and WooCommerce forms at once. You don't need to install separate antispam plugins for each form. It allows your blog to work faster and save resources. After installation you will forget about spam; your CleanTalk plugin will do all the work. You won't have to deal with spam as CleanTalk does this for you automatically.
|
190 |
|
191 |
CleanTalk is a transparent antispam tool, we provide detailed stats of all incoming comments and logins. You can always be sure that **there are no errors**. We have developed a mobile app for you to see antispam stats wherever you want.
|
192 |
|
193 |
-
We have developed the antispam for WordPress that protects you from spam bots at the maximum level allowing you to provide your visitors a simple and convenient form of comments/registrations without annoying CAPTCHAs and puzzles. CleanTalk detects spam in multistage tests allowing us to block up to 99.998% of spam bots.
|
194 |
-
The anti-spam method offered by CleanTalk avoids inconvenient for communication methods (CAPTCHA, question-answer etc.), and offers to your site visitors a more comfortable one.
|
195 |
|
196 |
-
CleanTalk is a premium anti-spam service for WordPress, the plugin works with
|
197 |
-
our own CleanTalk Cloud Service. Anti Spam by CleanTalk offers a free trial, you can look at the <a href="https://cleantalk.org/price">pricing</a> here. We provide anti-spam services at the highest level. To maintain this level we cannot afford to offer a free version of our service, as this will immediately affect the quality of the providing anti-spam protection. Paying for a year of anti-spam service, you save a lot more and receive:
|
198 |
|
199 |
* Up to 99.998% protection from spam bots.
|
200 |
* Time and resources saving.
|
@@ -206,36 +152,14 @@ our own CleanTalk Cloud Service. Anti Spam by CleanTalk offers a free trial, you
|
|
206 |
* Clear stats.
|
207 |
* Spam FireWall.
|
208 |
* No captcha (reCaptcha), puzzles, etc.
|
209 |
-
* Free mobile app to control anti-spam protection on your website.
|
210 |
-
|
211 |
-
= Additional features =
|
212 |
-
* Daily and weekly detailed anti-spam reports: traffic VS spam.
|
213 |
-
* AntiSpam apps for most popular CMS on cleantalk.org.
|
214 |
|
215 |
= How to protect sites from spam bots without CAPTCHA? =
|
216 |
-
The most popular anti
|
217 |
|
218 |
*"Ultimately, CAPTCHAs are useless for spam because they're designed to tell you if someone is 'human' or not, but not whether something is spam or not." Matt Mullenweg*
|
219 |
|
220 |
You do not have to work in IT to know what spam is. Besides piles of unwanted email, there are spam bots, or special software programs designed to act as human website visitors that post unwelcome messages over the Internet to advertise dubious services. More often than not spam messages do not even make sense. Similar to bacteria and virus mutations developing antibiotic resistance, spam bots are becoming more resilient in penetrating Internet firewalls and security layers.
|
221 |
|
222 |
-
= CleanTalk's features =
|
223 |
-
Anti-Spam by CleanTalk with Spam FireWall is one of the fastest plugins that allows you to lower the server load. One of the important parameters for each webmaster is the speed of the site, so we make sure that our plugin consumes as few server resources as possible. The Cloud Service provides the advantage: all data processing takes place in the Cloud.
|
224 |
-
|
225 |
-
CleanTalk team has developed unique anti spam algorithms to assess visitors behavior. CleanTalk analyzes user behavior and the parameters of the filled forms. Our anti-spam module, being installed in your website, sends the behavior parameters of either a visitor or a spam bot. When these parameters are estimated, the anti spam service makes a decision - to post a message or to define it as spam and reject it. Based on these checks, the service forms its own list of email addresses used by spam bots.
|
226 |
-
|
227 |
-
The registrations of visitors are being checked in a similar manner. The service adds to the blacklist not just email addresses, but also IP addresses and domains of websites that promote themselves through spam mailing. All of this happens automatically and requires no action from the administration of the website. In 2.5 million queries the service makes a mistake in 40-45 cases, i.e. CleanTalk detects spam with 99.9982% accuracy. We constantly monitor these errors and make adjustments to our algorithms. Even with this exceptional accuracy our team is aiming to improve the figures over time.
|
228 |
-
|
229 |
-
All-in-one. CleanTalk protects form spam all forms instantaneously - comments, registrations, feedback, contacts. No need to install additional plugins for each form. You save resources and increase performance of your website.
|
230 |
-
|
231 |
-
Spam attacks log. Anti-Spam by CleanTalk records all filtered comments, registrations and other spam attacks in the "Log of spam attacks" and stores the data in the log for up to 45 days. Using the log, you can ensure reliable protection of your website from spam and experience no false/positive filtering.
|
232 |
-
|
233 |
-
With the help of anti-spam by CleanTalk you can check existing comments and users, to find and quickly delete spam comments at once. This allows administrators of websites to automatically check and identify spam bots, comments and users, which were not detected by conventional anti-spam tools. The existing comments and users checking process is performed in a database of the nearly 2 million identified spam bots. Detailed spam stats allows CleanTalk customers to fully control it.
|
234 |
-
|
235 |
-
CleanTalk has an advanced option "Spam FireWall". This option allows you to block the most active spam bots before they get access to your website. It unloads you website pages when an attempt attack was made, so your web server won't run unnecessary scripts on these pages. Also it prevents any scanning of website pages by spam bots. Subsequently Spam FireWall significantly reduces your webserver load. Spam FireWall can mitigate HTTP/HTTPS DDoS attacks. When an intruder makes GET requests to attack your website, Spam FireWall will block requests from bad IP addresses. Your website gives the intruder a special page with a description of DDoS rejection instead of the website pages. Spam FireWall can help to reduce the CPU usage of your server because of this reason.
|
236 |
-
|
237 |
-
"CleanTalk team has been developing a cloud spam protection system for five years and has created a truly reliable anti-spam service designed for you to guarantee your safety".
|
238 |
-
|
239 |
= White Label Mode =
|
240 |
|
241 |
To switch the plugin work in the white-label mode you should set up a few settings on your main site in Wordpress Multisite Network:
|
@@ -247,14 +171,6 @@ To switch the plugin work in the white-label mode you should set up a few settin
|
|
247 |
|
248 |
The plugin will do everything rest.
|
249 |
|
250 |
-
= Auto-Update CleanTalk AntiSpam =
|
251 |
-
|
252 |
-
CleanTalk Dashboard allows you to set auto-update plugin and select several websites and update the plugin at once on all sites by one click or you can setup auto-update for all websites or separate websites.
|
253 |
-
|
254 |
-
Note: there is 24 hours delay before auto-update will do. This delay allows needing to avoid any issues. All updates that made through CleanTalk Dashboard manually will do immediately.
|
255 |
-
|
256 |
-
Auto-updating system will work from CleanTalk AntiSpam version 5.88
|
257 |
-
|
258 |
= Real-time email validation. Is email real or Not. =
|
259 |
It is very important to be sure that the user used his real email address. Spambots very often use fake email addresses, i.e. which addresses do not exist.
|
260 |
|
@@ -274,8 +190,7 @@ Block fake and suspicious users with disposable & temporary emails to improve em
|
|
274 |
|
275 |
= Stops Spam in Search Form =
|
276 |
|
277 |
-
Spam bots can use your search form to make a GET request with spam text.
|
278 |
-
CleanTalk Anti-Spam has the option to protect your website search form from spam bots. Each time, the search generates a new page and if there are many requests, this can create additional load. So, under some conditions, spam searches can be indexed, which affects SEO,
|
279 |
|
280 |
* Spam FireWall blocks access to all website pages for the most active spambots. It lowers your web server load and traffic just by doing this.
|
281 |
* Anti-Spam protection for website search forms repels spambots.
|
@@ -285,7 +200,6 @@ CleanTalk Anti-Spam has the option to protect your website search form from spam
|
|
285 |
You will always know what users were looking for on your site.
|
286 |
|
287 |
= Disable comments =
|
288 |
-
|
289 |
This option disables comments on your site. You can choose one or several options:
|
290 |
|
291 |
* Disable comments for posts
|
@@ -296,17 +210,25 @@ When using Disables comments, existing comments will not be deleted and will rem
|
|
296 |
|
297 |
= Email Address Encoder =
|
298 |
|
299 |
-
CleanTalk Anti-Spam offers a feature called "Encode contact data" that is designed to encode all email addresses on the website pages. Encoding the email addresses increases the level of protection of contact data from being abused, parsed, getting spammed and used in spam mailing lists by bots and online criminals.
|
300 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
301 |
|
302 |
= Translations =
|
303 |
* Albanian (sq_AL) - thanks to fjalaime https://wordpress.org/support/users/fjalaime/
|
304 |
* French (fr_FR) - thanks to Gilles Santacreu http://net-ik.net
|
305 |
* Spanish (es_ES) - thanks to Andrew Kurtis and WebHostingHub
|
306 |
|
307 |
-
= Requirements =
|
308 |
-
WordPress 3.0 at least. PHP 5 with CURL or file_get_contents() function and enabled 'allow_url_fopen' setting. The plugin is fully compatible with PHP 7.
|
309 |
-
|
310 |
> Max power, all-in-one, premium anti-spam WordPress plugin. No comments & registrations spam, no contact spam, protects any forms. Just install and forget spam.
|
311 |
|
312 |
== Installation ==
|
@@ -356,12 +278,6 @@ Spam comments are being moved to SPAM folder by default or you can set the optio
|
|
356 |
= How can I test the anti-spam protection? =
|
357 |
Please use the email **stop_email@example.com** for comments, contacts or signups to see how the anti-spam protection works. Also, you can see the logs for the last 7 days in the <a href="http://cleantalk.org/my/show_requests">Dashboard</a> or look at the folder "Spam" for banned comments.
|
358 |
|
359 |
-
= Is the plugin effective against spam bots? =
|
360 |
-
The plugin Anti-Spam by CleanTalk stops up to 99.998% of spam comments, spam signups (registrations), spam contact emails, spam subscriptions, spam bookings or spam orders.
|
361 |
-
|
362 |
-
= Does the plugin protect from brute force, DoS attacks and spam attacks? =
|
363 |
-
Yes, it does. Please turn the option 'Spam FireWall' on in the plugin settings to protect your website from DoS/DDoS, XML-RPC attacks.
|
364 |
-
|
365 |
= How does the plugin stop spam? =
|
366 |
Please, note - administrator's actions are NOT being checked.
|
367 |
|
@@ -371,18 +287,9 @@ The plugin uses several simple tests to stop spammers:
|
|
371 |
1. **Email, IP, domain spam activity list entries check.** The plugin uses spam activity database online at cleantalk.org, consisting of more than 20 billion spam activity records of IPs, Emails, Domains and ASN. If the sender's IP or Email is in the database, the sender gets some spam scores. To reduce false/positive rate the plugin not only uses the blacklist test to ban spammers, the sender will be banned when and only when multiple spam tests have been failed.
|
372 |
1. **Comment submit time.** Spam bots usually submit the info immediately after the page has been loaded, this happens because spam bots don't actually fill the web form, they just send $_POST data to the blog. The normal visitor sends the data after several seconds or minutes.
|
373 |
|
374 |
-
= Will the anti-spam plugin protect my theme? =
|
375 |
-
Yes, it will. The Anti-spam by CleanTalk is compatible with any WordPress theme.
|
376 |
-
|
377 |
= What about pingback, trackback spam? =
|
378 |
The plugin passes pingbacks without any checks by default. All trackbacks will be blocked if the sender had spam activity.
|
379 |
|
380 |
-
= Can I use CleanTalk with Akismet? =
|
381 |
-
Sure, you can use CleanTalk with Akismet. In this case you will probably have higher false/positive rate (when legitimate comments/signups are being denied), but you will have stronger anti-spam protection on your website.
|
382 |
-
|
383 |
-
= Is CleanTalk better than Akismet? =
|
384 |
-
Please look at this features comparison here https://cleantalk.org/cleantalk-vs-akismet
|
385 |
-
|
386 |
= Can I use CleanTalk to remove pending spam comments? =
|
387 |
Yes, you can. The plugin has the option to test all pending comments via database of <a href="https://cleantalk.org/blacklists">spam active IP/Email</a>, found spam comments will be moved to Trash folder.
|
388 |
|
@@ -396,9 +303,6 @@ To check comments please go here:
|
|
396 |
To check users please go here:
|
397 |
> WordPress console -> Users -> Find spam users
|
398 |
|
399 |
-
= Should I use other anti-spam tools (Captcha, reCaptcha and etc.)? =
|
400 |
-
CleanTalk stops up to 99.998% of spam bots, so you can disable other anti-spam plugins (especially CAPTCHA-type anti-spam plugins). In some cases several anti-spam plugins could conflict with each other, so it would be better to use just one plugin.
|
401 |
-
|
402 |
= Is the plugin compatible with WordPress MultiUser (WPMU or WordPress network)? =
|
403 |
Yes, the plugin is compatible with WordPress MultiUser. Each blog in multisite environment has individual anti-spam options for the protection from spam bots.
|
404 |
|
@@ -487,16 +391,6 @@ To set up global CleanTalk access key for all websites in WPMU, define constant
|
|
487 |
|
488 |
Now, all subsites will have this access key.
|
489 |
|
490 |
-
= Why is CleanTalk faster and more reliable than stand-alone solutions? =
|
491 |
-
All anti-spam checks are held in the cloud and don't overload the web server. The cloud solutions have a huge advantage since the parameters are being compared with information from more than 100,000 websites.
|
492 |
-
|
493 |
-
= I see a lot of blocked messages with the reason "Forbidden. Please enable JavaScript. Spam sender name." in my logs =
|
494 |
-
A lot of spam bots can't perform JavaScript code, so it is one of the important checks and most of the spam bots will be blocked with the reason **"Forbidden. Please enable JavaScript. Spam sender name."** All browsers can perform JS code, so real visitors won't be blocked.
|
495 |
-
|
496 |
-
If you or some of your visitors have the error **"Forbidden. Enable JavaScript."** please check JavaScript support in your browser and do this JavaScript test at this page: https://cleantalk.org/checkout-javascript-support.
|
497 |
-
|
498 |
-
If you think that there is something wrong in the messages blocking, let us know about it. Please submit a support request here: https://cleantalk.org/my/support.
|
499 |
-
|
500 |
= Does the plugin work with Varnish? =
|
501 |
CleanTalk works with Varnish, it protects WordPress against spam, but by default the plugin generates a few cookies for the protection from spam bots and it also disables Varnish cache on pages where CleanTalk's cookies have been stored. To get rid of the issue with cache turn off the option 'Set cookies' in the plugin settings.
|
502 |
|
@@ -507,36 +401,9 @@ Now the plugin will protect WordPress comments, registrations and most of popula
|
|
507 |
= Does the anti-spam plugin work with Accelerated Mobile Pages (AMP)? =
|
508 |
Yes, it does. But you have to turn off the SpamFireWall and the option 'Use AJAX for JavaScript check' in Advanced settigns of the plugin to be fully compatible with Accelerated Mobile Pages.
|
509 |
|
510 |
-
= How to close renewal or trial notice in the WordPress backend? =
|
511 |
-
To close the notice please save the plugin settings again or it will be closed automatically within 60 minutes after the renewal.
|
512 |
-
|
513 |
-
= I'm using PHP 4.2 version and i'm getting errors related with JSON. Why does it happens? =
|
514 |
-
СleanTalk is no longer supports PHP lower than 5.2 version because the support code have incompatibility with PHP 7 version. Please, upgrade your PHP. If you couldn't perform that, let us know about it via support ticket here: https://cleantalk.org/my/support.
|
515 |
-
|
516 |
= Should I change anything in the plugin's settings or in my CleanTalk Dashboard when I switch my website from HTTP to HTTPS or vice versa? =
|
517 |
No. You don't need to change anything in the plugin's settings or in your CleanTalk Dashboard. The plugin will work regardless of the protocol.
|
518 |
|
519 |
-
= How to use Anti-Spam Log? =
|
520 |
-
The following possibilities are available for you in the Anti-Spam Log:
|
521 |
-
|
522 |
-
- Time period for all spam records you want to see.
|
523 |
-
|
524 |
-
- Filter spam records by their status: Any status, Denied, Approved.
|
525 |
-
|
526 |
-
- Filter spam records by your websites.
|
527 |
-
|
528 |
-
- Filter spam records by country they came from.
|
529 |
-
|
530 |
-
- Filter spam records by IP address, e-mail address or username.
|
531 |
-
|
532 |
-
- Available options for a specific record:
|
533 |
-
|
534 |
-
* Details - see item 4 below.
|
535 |
-
* Spam/Not Spam - press this string if our system made wrong decision and blocked or approved a registration, a comment ot a contact form submission. More about it here: https://cleantalk.org/faq#feedback_spam
|
536 |
-
* Delete - delete a record permanently.
|
537 |
-
* Personal blacklists - go to your website Black&White Lists page.
|
538 |
-
* Record details: block reason, body of the message, additional caught data.
|
539 |
-
|
540 |
= Spam FireWall and AntiSpam - Networks Blocking =
|
541 |
|
542 |
Anti-Spam - will blocks users from selected IP or network from using contacts/messages/registrations/comments forms.
|
@@ -565,29 +432,12 @@ To manage the actions with spam comments, go to the Control Panel, select the we
|
|
565 |
Please, read more here:
|
566 |
https://cleantalk.org/help/spam-comment-management
|
567 |
|
568 |
-
= How do I report a missed spam bot or incorrect filter? =
|
569 |
-
|
570 |
-
If you think the service has missed a spam bot or improperly filtered visitor to the website, you may notify us via the Anti-spam control panel. To do this,
|
571 |
-
Log in to Control panel https://cleantalk.org/my.
|
572 |
-
Click the line "Log" under the name of your website.
|
573 |
-
When you mark a record as "SPAM", its e-mail and IP-address will be added to your personal blacklist for your website.
|
574 |
-
When you mark a record as "Not SPAM", its e-mail and IP-address will be added to your personal white list for your website.
|
575 |
-
|
576 |
-
Please, read more here
|
577 |
-
https://cleantalk.org/faq#feedback_spam
|
578 |
-
|
579 |
-
= Is the plugin fast? =
|
580 |
-
We develop plugin to do it as optimized as possible, CleanTalk doesn't downgrade response time in backend or frontend. The plugin proccess only POST requests to WordPress core, it tackes less than 1 second to return results.
|
581 |
-
|
582 |
= Is the plugin EU GDPR compatible? =
|
583 |
Yes, it is. Please read this article,
|
584 |
<a href="https://cleantalk.org/publicoffer#cleantalk_gdpr_compliance">https://cleantalk.org/publicoffer#cleantalk_gdpr_compliance</a>
|
585 |
|
586 |
-
= Check external forms =
|
587 |
-
If your website has forms that send data to external sources, you can enable option to "Protect external forms". In this case, if plugin determinates that the current message is spam, your form action will be temporary replaced to your current hostname to prevent sending false data to an external source.
|
588 |
-
|
589 |
== Screenshots ==
|
590 |
-
1. AntiSpam settings are easy to use.
|
591 |
2. AntiSpam plugin rejected a spam bot at the CAPTCHA less registration form. The plugin provides explanation to visitor and websites about each rejected comment/registration or contact message.
|
592 |
3. Use AntiSpam analytics tool for each website in service Dashboard to have information about spam/legitimate stats.
|
593 |
4. Use AntiSpam log to control anti-spam plugin.
|
@@ -595,13 +445,33 @@ If your website has forms that send data to external sources, you can enable opt
|
|
595 |
6. The Dashboard with a map of most spam active countries per your account.
|
596 |
7. The plugin deletes/removes the existing spam comments and users accounts.
|
597 |
8. CleanTalk's dashboard update link.
|
598 |
-
9. Auto update confirmation.
|
599 |
10. Website's options.
|
600 |
11. CleanTalk's dashboard.
|
601 |
12. SpamFireWall log.
|
602 |
|
603 |
== Changelog ==
|
604 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
605 |
= 5.185.1 Sep 28 2022 =
|
606 |
#### Fixed a security issues.
|
607 |
* Fix. Fixed a security issues.
|
1 |
=== Spam protection, AntiSpam, FireWall by CleanTalk ===
|
2 |
+
Contributors: glomberg, artemacleantalk, alexandergull
|
3 |
Tags: spam, antispam, anti-spam, comments, firewall
|
4 |
Requires at least: 3.0
|
5 |
Tested up to: 6.0
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 5.186
|
8 |
License: GPLv2
|
9 |
|
10 |
Spam protection, anti-spam, firewall, premium plugin. No spam comments & users, no spam contact form & WooCommerce anti-spam.
|
13 |
|
14 |
No CAPTCHA, no questions, no animal counting, no puzzles, no math and no spam bots. Universal AntiSpam plugin.
|
15 |
|
16 |
+
= Anti-Spam features =
|
17 |
1. Stops spam comments.
|
18 |
2. Stops spam registrations.
|
19 |
3. Stops spam contact emails.
|
23 |
7. Stops spam surveys, polls.
|
24 |
8. Stops spam in widgets.
|
25 |
9. Stops spam in WooCommerce.
|
26 |
+
10. Real-time email validation. Is email real or Not.
|
27 |
+
11. Checks and removes the existing spam comments and spam users.
|
28 |
+
12. Compatible with mobile users and devices.
|
29 |
+
13. Compatible with General Data Protection Regulation (GDPR) (EU).
|
30 |
14. Blocking disposable & temporary emails.
|
31 |
15. No Spam - No Google Penalties. Give your SEO boost.
|
32 |
16. Mobile friendly Anti Spam & FireWall.
|
33 |
17. Stops spam in Search Form.
|
34 |
18. Disable comments.
|
35 |
+
19. Spam FireWall: Anti-Flood.
|
36 |
+
20. Spam FireWall: Anti-Crawler.
|
37 |
+
21. Hide «Website» field for comments.
|
38 |
+
22. Block messages by languages, countries, networks and stop words.
|
39 |
+
23. Email Address Encoder - protection for email addresses published on your site.
|
40 |
|
41 |
= Free trial then $12 per year =
|
42 |
CleanTalk is an anti-spam plugin which works with the premium Cloud Anti-Spam service cleantalk.org. This plugin as a service <a href="https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#6-software-as-a-service-is-permitted">https://developer.wordpress.org/plugins/wordpress-org/detailed-plugin-guidelines/#6-software-as-a-service-is-permitted</a>
|
45 |
> CleanTalk - Cloud-Based Anti-Spam Service to Keep Your Site Bot-Free.
|
46 |
> <a href="https://newswatchtv.com/2018/07/18/cleantalk-newswatch-review/" target="_blank">NewsWatch Review</a>.
|
47 |
|
48 |
+
> Compare reCAPTCHA & Akismet VS CleanTalk
|
49 |
+
> <a href="https://www.saashub.com/compare-recaptcha-vs-cleantalk">https://www.saashub.com/compare-recaptcha-vs-cleantalk</a>
|
50 |
+
> <a href="https://www.saashub.com/compare-akismet-vs-cleantalk">https://www.saashub.com/compare-akismet-vs-cleantalk</a>
|
51 |
|
52 |
>I know you have heard of a number of anti-spam plugins. But you must know, the cloud-based ones are the best regarding detection rate. They compare all the content in forms with their own algorithm to find out the legibility.
|
53 |
>*<a href="https://www.techwibe.com/cleantalk-wordpress-plugin-review/" target="_blank">www.techwibe.com</a>*
|
58 |
= AntiSpam protection for comments =
|
59 |
Native spam protection for WordPress, JetPack comments and any other comment plugins. The plugin moves spam comments to SPAM folder or you can set the option to ban spam comments silently. You can also enable the option in the plugin settings to auto-delete comments from SPAM folder.
|
60 |
|
|
|
|
|
|
|
|
|
61 |
= Contact Form by WPForms spam filter =
|
62 |
Plugin extends Contact Form by WPForms to provide spam protection. It filters spam submissions for each type of forms - simple contact form, marketing form, request a quote and etc.
|
63 |
|
74 |
Plugin extends spam protection for Contact Form 7 (CF7). It can be used with any other third-party spam filters.
|
75 |
<a href="https://blog.cleantalk.org/how-to-protect-your-contactform7-contact-form-using-cleantalk-anti-spam-plugin/">How to protect your Contact Form 7 using CleanTalk Anti-Spam plugin</a>
|
76 |
|
|
|
|
|
77 |
= WooCommerce spam filter =
|
78 |
Anti-spam by CleanTalk filters spam registrations and spam reviews for WooCommerce. The plugin is fully compatible with WooCommerce 2.1 and higher.
|
79 |
|
|
|
|
|
80 |
= Spam filter for theme contact forms =
|
81 |
The plugin blocks spam emails via any theme (built-in ones included) contact forms. The plugin filters spam emails silently (without any error notices on WordPress frontend) in AJAX forms as well.
|
82 |
|
86 |
= Other spam filters =
|
87 |
* WordPress Landing Pages.
|
88 |
* WP User Frontend, UserPro.
|
89 |
+
* Ninja forms <a href="https://ninjaforms.com/">https://ninjaforms.com</a>.
|
90 |
+
* Contact Form Plugin by Fluent Forms Ninja forms <a href="https://fluentforms.com/">https://fluentforms.com</a>.
|
91 |
+
* Forminator contact from <a href="https://wpmudev.com/project/forminator-pro/">https://wpmudev.com/project/forminator-pro/</a>.
|
92 |
+
* Newsletters - MC4WP: Mailchimp for WordPress (<a href="https://www.mc4wp.com/">mc4wp.com</a>), MailPoet – emails and newsletters in WordPress (https://www.mailpoet.com/).
|
93 |
* Any WordPress form (checkbox 'Custom contact forms').
|
94 |
+
* Any submission to the site (checkbox 'Check all POST data').
|
|
|
|
|
95 |
|
96 |
= Check existing comments for spam. Bulk spam comments removal. Spam comment Cleaner =
|
97 |
With the help of anti-spam by CleanTalk you can inspect through existing comments to find and quickly delete spam comments at once. To use this function, go to WP Console -> Comments -> Find spam comments.
|
99 |
= Check existing users for spam. Bulk spam accounts removal. Spam users cleaner =
|
100 |
With the help of anti-spam by CleanTalk you can inspect through existing accounts to find and quickly delete spam users at once. For use this function, go to WP Console -> Users -> Check for spam. Also, you can export a list of spam users to the CSV.
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
= Private black lists for anti-spam service =
|
103 |
+
Automatically block comments and registrations from your private black IP/email address list.
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
= Hide «Website» field for comments =
|
106 |
This option hides the «Website» field from standard WordPress comments forms. After that spammers won't be able to send spam links using «Website» field in the bottom of the comments form.
|
|
|
107 |
|
108 |
= Low false/positive rate =
|
109 |
+
This plugin uses multiple anti-spam tests to filter spam bots having as low false/positive rate as possible.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
+
= How does CleanTalk improve SEO for your website? =
|
|
|
|
|
112 |
So, you already know that the speed of the site has a direct impact on SEO.
|
113 |
|
114 |
*CleanTalk works faster than most of the other anti-spam plugins.* It is common knowledge that the faster your site loads, the better your customer experience is, the better your SEO will be, and the better your site will convert. Speed is becoming increasingly important in SEO, conversion and user experience. Today, site speed is one of the most important ranking factors on Google. A site that loads slowly will lose visitors and potential revenue.
|
115 |
|
116 |
+
Among anti-spam plugins CleanTalk AntiSpam is one of the fastest. Despite the large plugin functionality, the developers have optimized the performance of
|
|
|
|
|
|
|
117 |
the plugin so that AntiSpam by CleanTalk is faster than most analogs. This contributes to the cloud service architecture, as all calculations take place in the cloud, not on the server, the server receives the finished result for further action.
|
118 |
|
119 |
https://s.w.org/plugins/cleantalk-spam-protect/screenshot-5.png?r=1288723
|
120 |
|
121 |
+
Unlike stand-alone plugins (WP Armour, Antispam Bee, WP Cerber) Anti-Spam by CleanTalk uses less CPU that improves site response, visitors experience and SEO results.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
|
123 |
= Spam FireWall =
|
124 |
+
Spam FireWall allows blocking the most active spam bots before they get access to your website. It prevents spam bots from loading website pages so your web server doesn't have to perform all scripts on these pages. Also it prevents scanning of pages of the website by spam bots. Therefore Spam FireWall significantly reduces the load on your web server. Spam FireWall also makes CleanTalk the two-step protection from spam bots. Spam FireWall is the first step and it blocks the most active spam bots. CleanTalk Anti-Spam is the second step and checks all other requests on the website in the moment of submitting comments/registers etc.
|
|
|
|
|
|
|
125 |
|
126 |
+
= How does Spam FireWall work? =
|
127 |
* The visitor enters to your web site.
|
128 |
* HTTP request data are being checked in the nearly 5.8 million of the identified spam bot IPs.
|
129 |
* If it is an active spam bot, the bot gets a blank page, if it is a visitor then he receives a normal page. This process is completely transparent for the visitors.
|
130 |
|
131 |
All the CleanTalk Spam FireWall activity is being logged in the process of filtering.
|
132 |
|
|
|
|
|
|
|
|
|
133 |
= Spam FireWall: Anti-Flood & Anti-Crawler =
|
134 |
Spam FireWall: Anti-Flood and Anti-Crawler options are intended for blocking unwanted bots, content parsing, shop goods prices parsing or aggressive website scanning bots. Learn more https://cleantalk.org/help/anti-flood-and-anti-crawler
|
135 |
|
136 |
+
= Anti-Spam plugin info =
|
137 |
+
CleanTalk is an all-in-one anti-spam solution for WordPress that protects login, comment, contact and WooCommerce forms at once. You don't need to install separate antispam plugins for each form. It allows your blog to work faster and save resources.
|
|
|
|
|
|
|
138 |
|
139 |
CleanTalk is a transparent antispam tool, we provide detailed stats of all incoming comments and logins. You can always be sure that **there are no errors**. We have developed a mobile app for you to see antispam stats wherever you want.
|
140 |
|
141 |
+
We have developed the antispam for WordPress that protects you from spam bots at the maximum level allowing you to provide your visitors a simple and convenient form of comments/registrations without annoying CAPTCHAs and puzzles. CleanTalk detects spam in multistage tests allowing us to block up to 99.998% of spam bots. The anti-spam method offered by CleanTalk avoids inconvenient for communication methods (CAPTCHA, question-answer etc.), and offers to your site visitors a more comfortable one.
|
|
|
142 |
|
143 |
+
CleanTalk is a premium anti-spam service for WordPress, the plugin works with our own CleanTalk Cloud Service. Anti Spam by CleanTalk offers a free trial, you can look at the <a href="https://cleantalk.org/price">pricing</a> here. We provide anti-spam services at the highest level. To maintain this level we cannot afford to offer a free version of our service, as this will immediately affect the quality of the providing anti-spam protection. Paying for a year of anti-spam service, you save a lot more and receive:
|
|
|
144 |
|
145 |
* Up to 99.998% protection from spam bots.
|
146 |
* Time and resources saving.
|
152 |
* Clear stats.
|
153 |
* Spam FireWall.
|
154 |
* No captcha (reCaptcha), puzzles, etc.
|
|
|
|
|
|
|
|
|
|
|
155 |
|
156 |
= How to protect sites from spam bots without CAPTCHA? =
|
157 |
+
The most popular anti-spam method is CAPTCHA - the annoying picture with curved and sloping symbols, which are presented to the visitor to decipher and fill in. In is supposed that spam bots won't discern these CAPTCHA, but a visitor will. CAPTCHA provokes great irritation, but if the visitor wants to comment, he has to fill in these symbols time after time, making mistakes and starting once again. Sometimes CAPTCHA reminds us of the doodles of a two year old child. For users with vision problems CAPTCHA is an insurmountable obstacle. Users hate captcha. Captcha for users means "hate". Unreadable CAPTCHA stops about 80% of site visitors. After 2 failed attempts to decipher CAPTCHA 95% of visitors reject further attempts. At the sight of CAPTCHA and after input errors, many visitors leave the resource. Thus, CAPTCHA helps to protect the resource spam both from bots and visitors. CAPTCHA is not a panacea from spam. Doubts concerning the Need for CAPTCHA?
|
158 |
|
159 |
*"Ultimately, CAPTCHAs are useless for spam because they're designed to tell you if someone is 'human' or not, but not whether something is spam or not." Matt Mullenweg*
|
160 |
|
161 |
You do not have to work in IT to know what spam is. Besides piles of unwanted email, there are spam bots, or special software programs designed to act as human website visitors that post unwelcome messages over the Internet to advertise dubious services. More often than not spam messages do not even make sense. Similar to bacteria and virus mutations developing antibiotic resistance, spam bots are becoming more resilient in penetrating Internet firewalls and security layers.
|
162 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
= White Label Mode =
|
164 |
|
165 |
To switch the plugin work in the white-label mode you should set up a few settings on your main site in Wordpress Multisite Network:
|
171 |
|
172 |
The plugin will do everything rest.
|
173 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
= Real-time email validation. Is email real or Not. =
|
175 |
It is very important to be sure that the user used his real email address. Spambots very often use fake email addresses, i.e. which addresses do not exist.
|
176 |
|
190 |
|
191 |
= Stops Spam in Search Form =
|
192 |
|
193 |
+
Spam bots can use your search form to make a GET request with spam text. CleanTalk Anti-Spam has the option to protect your website search form from spam bots. Each time, the search generates a new page and if there are many requests, this can create additional load. So, under some conditions, spam searches can be indexed, which affects SEO,
|
|
|
194 |
|
195 |
* Spam FireWall blocks access to all website pages for the most active spambots. It lowers your web server load and traffic just by doing this.
|
196 |
* Anti-Spam protection for website search forms repels spambots.
|
200 |
You will always know what users were looking for on your site.
|
201 |
|
202 |
= Disable comments =
|
|
|
203 |
This option disables comments on your site. You can choose one or several options:
|
204 |
|
205 |
* Disable comments for posts
|
210 |
|
211 |
= Email Address Encoder =
|
212 |
|
213 |
+
CleanTalk Anti-Spam offers a feature called "Encode contact data" that is designed to encode all email addresses on the website pages. Encoding the email addresses increases the level of protection of contact data from being abused, parsed, getting spammed and used in spam mailing lists by bots and online criminals. To reveal the encoded email address simply click on it and it will be decoded instantly.
|
214 |
+
|
215 |
+
= Will the anti-spam plugin protect my theme? =
|
216 |
+
Yes, it will. The Anti-spam by CleanTalk is compatible with any WordPress theme.
|
217 |
+
|
218 |
+
= Should I use other anti-spam tools (Captcha, reCaptcha and etc.)? =
|
219 |
+
CleanTalk stops up to 99.998% of spam bots, so you can disable other anti-spam plugins (especially CAPTCHA-type anti-spam plugins). In some cases several anti-spam plugins could conflict with each other, so it would be better to use just one plugin.
|
220 |
+
|
221 |
+
= Can I use CleanTalk with Akismet? =
|
222 |
+
Sure, you can use CleanTalk with Akismet. In this case you will probably have higher false/positive rate (when legitimate comments/signups are being denied), but you will have stronger anti-spam protection on your website.
|
223 |
+
|
224 |
+
= Is CleanTalk better than Akismet? =
|
225 |
+
Please look at this features comparison here https://cleantalk.org/cleantalk-vs-akismet
|
226 |
|
227 |
= Translations =
|
228 |
* Albanian (sq_AL) - thanks to fjalaime https://wordpress.org/support/users/fjalaime/
|
229 |
* French (fr_FR) - thanks to Gilles Santacreu http://net-ik.net
|
230 |
* Spanish (es_ES) - thanks to Andrew Kurtis and WebHostingHub
|
231 |
|
|
|
|
|
|
|
232 |
> Max power, all-in-one, premium anti-spam WordPress plugin. No comments & registrations spam, no contact spam, protects any forms. Just install and forget spam.
|
233 |
|
234 |
== Installation ==
|
278 |
= How can I test the anti-spam protection? =
|
279 |
Please use the email **stop_email@example.com** for comments, contacts or signups to see how the anti-spam protection works. Also, you can see the logs for the last 7 days in the <a href="http://cleantalk.org/my/show_requests">Dashboard</a> or look at the folder "Spam" for banned comments.
|
280 |
|
|
|
|
|
|
|
|
|
|
|
|
|
281 |
= How does the plugin stop spam? =
|
282 |
Please, note - administrator's actions are NOT being checked.
|
283 |
|
287 |
1. **Email, IP, domain spam activity list entries check.** The plugin uses spam activity database online at cleantalk.org, consisting of more than 20 billion spam activity records of IPs, Emails, Domains and ASN. If the sender's IP or Email is in the database, the sender gets some spam scores. To reduce false/positive rate the plugin not only uses the blacklist test to ban spammers, the sender will be banned when and only when multiple spam tests have been failed.
|
288 |
1. **Comment submit time.** Spam bots usually submit the info immediately after the page has been loaded, this happens because spam bots don't actually fill the web form, they just send $_POST data to the blog. The normal visitor sends the data after several seconds or minutes.
|
289 |
|
|
|
|
|
|
|
290 |
= What about pingback, trackback spam? =
|
291 |
The plugin passes pingbacks without any checks by default. All trackbacks will be blocked if the sender had spam activity.
|
292 |
|
|
|
|
|
|
|
|
|
|
|
|
|
293 |
= Can I use CleanTalk to remove pending spam comments? =
|
294 |
Yes, you can. The plugin has the option to test all pending comments via database of <a href="https://cleantalk.org/blacklists">spam active IP/Email</a>, found spam comments will be moved to Trash folder.
|
295 |
|
303 |
To check users please go here:
|
304 |
> WordPress console -> Users -> Find spam users
|
305 |
|
|
|
|
|
|
|
306 |
= Is the plugin compatible with WordPress MultiUser (WPMU or WordPress network)? =
|
307 |
Yes, the plugin is compatible with WordPress MultiUser. Each blog in multisite environment has individual anti-spam options for the protection from spam bots.
|
308 |
|
391 |
|
392 |
Now, all subsites will have this access key.
|
393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
= Does the plugin work with Varnish? =
|
395 |
CleanTalk works with Varnish, it protects WordPress against spam, but by default the plugin generates a few cookies for the protection from spam bots and it also disables Varnish cache on pages where CleanTalk's cookies have been stored. To get rid of the issue with cache turn off the option 'Set cookies' in the plugin settings.
|
396 |
|
401 |
= Does the anti-spam plugin work with Accelerated Mobile Pages (AMP)? =
|
402 |
Yes, it does. But you have to turn off the SpamFireWall and the option 'Use AJAX for JavaScript check' in Advanced settigns of the plugin to be fully compatible with Accelerated Mobile Pages.
|
403 |
|
|
|
|
|
|
|
|
|
|
|
|
|
404 |
= Should I change anything in the plugin's settings or in my CleanTalk Dashboard when I switch my website from HTTP to HTTPS or vice versa? =
|
405 |
No. You don't need to change anything in the plugin's settings or in your CleanTalk Dashboard. The plugin will work regardless of the protocol.
|
406 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
407 |
= Spam FireWall and AntiSpam - Networks Blocking =
|
408 |
|
409 |
Anti-Spam - will blocks users from selected IP or network from using contacts/messages/registrations/comments forms.
|
432 |
Please, read more here:
|
433 |
https://cleantalk.org/help/spam-comment-management
|
434 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
435 |
= Is the plugin EU GDPR compatible? =
|
436 |
Yes, it is. Please read this article,
|
437 |
<a href="https://cleantalk.org/publicoffer#cleantalk_gdpr_compliance">https://cleantalk.org/publicoffer#cleantalk_gdpr_compliance</a>
|
438 |
|
|
|
|
|
|
|
439 |
== Screenshots ==
|
440 |
+
1. AntiSpam settings are easy to use to protect any contact forms. For example - Ninja forms, Fluent forms and etc.
|
441 |
2. AntiSpam plugin rejected a spam bot at the CAPTCHA less registration form. The plugin provides explanation to visitor and websites about each rejected comment/registration or contact message.
|
442 |
3. Use AntiSpam analytics tool for each website in service Dashboard to have information about spam/legitimate stats.
|
443 |
4. Use AntiSpam log to control anti-spam plugin.
|
445 |
6. The Dashboard with a map of most spam active countries per your account.
|
446 |
7. The plugin deletes/removes the existing spam comments and users accounts.
|
447 |
8. CleanTalk's dashboard update link.
|
|
|
448 |
10. Website's options.
|
449 |
11. CleanTalk's dashboard.
|
450 |
12. SpamFireWall log.
|
451 |
|
452 |
== Changelog ==
|
453 |
|
454 |
+
= 5.186 Oct 06 2022 =
|
455 |
+
#### Several integrations added 🔥, custom logo for SFW blocking pages added 🎯, external forms into iframe protected 🎉 and some minor issues fixed 💪🏼
|
456 |
+
* New. MemberPress direct integration.
|
457 |
+
* New. SFW. Added custom logo on sfw die page.
|
458 |
+
* New. Integrations. Handle EasyDigitalDownloads plugin registration hook.
|
459 |
+
* New. External forms. External forms into an iframe has been protected.
|
460 |
+
* Fix. ct_ajax_hook. Latepoint serice AJAX requests ignored.
|
461 |
+
* Fix. apbct_settings__prepare_errors() Mismatching types fix.
|
462 |
+
* Fix. Integrations. Ignore service requests in GiveWP integration.
|
463 |
+
* Fix: Removed duplication of the hidden field in the search form
|
464 |
+
* Fix. EmailEncoding. Styles fix.
|
465 |
+
* Mod. EmailEncoding. Add a tooltip while decoding mailto: links.
|
466 |
+
* Fix. External forms. Mautic external forms integration.
|
467 |
+
* Fix. Internal forms. Modify regexp for exclusion urls of wordpress native internal forms.
|
468 |
+
* Fix. Intergrations. Correct registration flag translation to basecall due EasyDigitalDownloads handling.
|
469 |
+
* Fix. Common. Rotating m-servers fixed.
|
470 |
+
* Fix. JS. Custom ajax forms blocking answer fixed.
|
471 |
+
* Fix. JS. Headless parameter cast to boolean type.
|
472 |
+
* Fix. NoCookie.php. Remove namespace redundant declaration to keep compat with <php5.6
|
473 |
+
* Fix. Internal forms. Internal forms protection fixed.
|
474 |
+
|
475 |
= 5.185.1 Sep 28 2022 =
|
476 |
#### Fixed a security issues.
|
477 |
* Fix. Fixed a security issues.
|