Click to Chat for WhatsApp Chat - Version 3.9.9

Version Description

  • Enchantment: opt-in, greetings features
Download this release

Release Info

Developer bhvreddy
Plugin Icon 128x128 Click to Chat for WhatsApp Chat
Version 3.9.9
Comparing to
See all releases

Code changes from version 3.9.8 to 3.9.9

click-to-chat.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Click to Chat
4
  Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
5
  Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
6
- Version: 3.9.8
7
  Author: HoliThemes
8
  Author URI: https://holithemes.com/plugins/click-to-chat/
9
  License: GPL2
@@ -17,7 +17,7 @@ if ( ! defined( 'WPINC' ) ) {
17
 
18
  // ctc - Version - update version at readme 'Stable tag'
19
  if ( ! defined( 'HT_CTC_VERSION' ) ) {
20
- define( 'HT_CTC_VERSION', '3.9.8' );
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
3
  Plugin Name: Click to Chat
4
  Plugin URI: https://wordpress.org/plugins/click-to-chat-for-whatsapp/
5
  Description: Lets make your Web page visitors contact you through WhatsApp with a single click/tap
6
+ Version: 3.9.9
7
  Author: HoliThemes
8
  Author URI: https://holithemes.com/plugins/click-to-chat/
9
  License: GPL2
17
 
18
  // ctc - Version - update version at readme 'Stable tag'
19
  if ( ! defined( 'HT_CTC_VERSION' ) ) {
20
+ define( 'HT_CTC_VERSION', '3.9.9' );
21
  }
22
 
23
  // define HT_CTC_PLUGIN_FILE
new/admin/admin_assets/js/331.admin.js DELETED
@@ -1,554 +0,0 @@
1
- // Click to Chat
2
- document.addEventListener('DOMContentLoaded', function () {
3
-
4
- // M.AutoInit();
5
-
6
- var elems = document.querySelectorAll('select');
7
- M.FormSelect.init(elems, {});
8
-
9
- var elems = document.querySelectorAll('.collapsible');
10
- M.Collapsible.init(elems, {});
11
-
12
- var elems = document.querySelectorAll('.modal');
13
- M.Modal.init(elems, {});
14
-
15
- var elems = document.querySelectorAll('.tooltipped');
16
- M.Tooltip.init(elems, {});
17
-
18
- });
19
-
20
- (function ($) {
21
-
22
- // ready
23
- $(function () {
24
-
25
- $('select').formSelect();
26
- $('.collapsible').collapsible();
27
- $('.modal').modal();
28
- $('.tooltipped').tooltip();
29
- $('.ht-ctc-color').wpColorPicker();
30
-
31
-
32
- // functions
33
- show_hide_options();
34
- styles();
35
- call_to_action();
36
- ht_ctc_admin_animations();
37
- desktop_mobile();
38
- wn();
39
- hook();
40
- ss();
41
- other();
42
-
43
- try {
44
- woo_page();
45
- collapsible();
46
- } catch (e) { }
47
-
48
-
49
-
50
- // show/hide settings
51
- function show_hide_options() {
52
-
53
- // default display
54
- var val = $('.global_display:checked').val();
55
-
56
- if (val == 'show') {
57
- $('.global_show_or_hide_icon').addClass('dashicons dashicons-visibility');
58
- $(".hide_settings").show();
59
- $(".show_hide_types .show_btn").attr('disabled', 'disabled');
60
- $(".show_hide_types .show_box").hide();
61
- } else if (val == 'hide') {
62
- $('.global_show_or_hide_icon').addClass('dashicons dashicons-hidden');
63
- $(".show_settings").show();
64
- $(".show_hide_types .hide_btn").attr('disabled', 'disabled');
65
- $(".show_hide_types .hide_box").hide();
66
- }
67
- $('.global_show_or_hide_label').html('(' + val + ')');
68
-
69
- // on change
70
- $(".global_display").on("change", function (e) {
71
-
72
- var change_val = e.target.value;
73
- var add_class = '';
74
- var remove_class = '';
75
-
76
- $(".hide_settings").hide();
77
- $(".show_settings").hide();
78
- $(".show_hide_types .show_btn").removeAttr('disabled');
79
- $(".show_hide_types .hide_btn").removeAttr('disabled');
80
- $(".show_hide_types .show_box").hide();
81
- $(".show_hide_types .hide_box").hide();
82
-
83
- if (change_val == 'show') {
84
- add_class = 'dashicons dashicons-visibility';
85
- remove_class = 'dashicons-hidden';
86
- $(".hide_settings").show(500);
87
- $(".show_hide_types .show_btn").attr('disabled', 'disabled');
88
- $(".show_hide_types .hide_box").show();
89
- } else if (change_val == 'hide') {
90
- add_class = 'dashicons dashicons-hidden';
91
- remove_class = 'dashicons-visibility';
92
- $(".show_settings").show(500);
93
- $(".show_hide_types .hide_btn").attr('disabled', 'disabled');
94
- $(".show_hide_types .show_box").show();
95
- }
96
- $('.global_show_or_hide_label').html('(' + change_val + ')');
97
- $('.global_show_or_hide_icon').removeClass(remove_class);
98
- $('.global_show_or_hide_icon').addClass(add_class);
99
-
100
- });
101
-
102
- }
103
-
104
-
105
- // styles
106
- function styles() {
107
-
108
- // on change - styles
109
- $(".chat_select_style").on("change", function (e) {
110
- $(".customize_styles_link").animate({ fontSize: '1.2em' }, "slow");
111
- });
112
-
113
- // style-1 - add icon
114
- if ($('.s1_add_icon').is(':checked')) {
115
- $(".s1_icon_settings").show();
116
- } else {
117
- $(".s1_icon_settings").hide();
118
- }
119
-
120
- $(".s1_add_icon").on("change", function (e) {
121
- console.log('change');
122
-
123
- if ($('.s1_add_icon').is(':checked')) {
124
- $(".s1_icon_settings").show(200);
125
- } else {
126
- $(".s1_icon_settings").hide(200);
127
- }
128
-
129
- });
130
-
131
- }
132
-
133
-
134
-
135
- // call to actions
136
- function call_to_action() {
137
- var cta_styles = ['.ht_ctc_s2', '.ht_ctc_s3', '.ht_ctc_s3_1', '.ht_ctc_s7'];
138
- cta_styles.forEach(ht_ctc_admin_cta);
139
-
140
- function ht_ctc_admin_cta(style) {
141
- // default display
142
- var val = $(style + ' .select_cta_type').find(":selected").val();
143
- if (val == 'hide') {
144
- $(style + " .cta_stick").hide();
145
- }
146
-
147
- // on change
148
- $(style + " .select_cta_type").on("change", function (e) {
149
- var change_val = e.target.value;
150
- if (change_val == 'hide') {
151
- $(style + " .cta_stick").hide(100);
152
- } else {
153
- $(style + " .cta_stick").show(200);
154
- }
155
- });
156
- }
157
-
158
- }
159
-
160
-
161
-
162
- function ht_ctc_admin_animations() {
163
- // default display
164
- var val = $('.select_an_type').find(":selected").val();
165
- if (val == 'no-animation') {
166
- $(".an_delay").hide();
167
- $(".an_itr").hide();
168
- }
169
-
170
- // on change
171
- $(".select_an_type").on("change", function (e) {
172
-
173
- var change_val = e.target.value;
174
-
175
- if (change_val == 'no-animation') {
176
- $(".an_delay").hide();
177
- $(".an_itr").hide();
178
- } else {
179
- $(".an_delay").show(500);
180
- $(".an_itr").show(500);
181
- }
182
- });
183
- }
184
-
185
-
186
- // Deskop, Mobile - same settings
187
- function desktop_mobile() {
188
-
189
- // same setting
190
- if ($('.same_settings').is(':checked')) {
191
- $(".not_samesettings").hide();
192
- } else {
193
- $(".not_samesettings").show();
194
- }
195
-
196
- $(".same_settings").on("change", function (e) {
197
-
198
- if ($('.same_settings').is(':checked')) {
199
- $(".not_samesettings").hide(900);
200
- $(".select_styles_issue_checkbox").hide();
201
- } else {
202
- $(".not_samesettings").show(900);
203
- }
204
-
205
- });
206
-
207
- }
208
-
209
-
210
- // WhatsApp number
211
- function wn() {
212
-
213
- var cc = $("#whatsapp_cc").val();
214
- var num = $("#whatsapp_number").val();
215
-
216
- $("#whatsapp_cc").on("change paste keyup", function (e) {
217
- cc = $("#whatsapp_cc").val();
218
- call();
219
- });
220
-
221
- $("#whatsapp_number").on("change paste keyup", function (e) {
222
- num = $("#whatsapp_number").val();
223
- call();
224
-
225
- if (num && 0 == num.charAt(0)) {
226
- $('.ctc_wn_initial_zero').show(500);
227
- } else {
228
- $('.ctc_wn_initial_zero').hide(500);
229
- }
230
- });
231
-
232
- function call() {
233
- $(".ht_ctc_wn").html(cc + '' + num);
234
- $("#ctc_whatsapp_number").val(cc + '' + num);
235
- }
236
-
237
- }
238
-
239
- // woo page..
240
- function woo_page() {
241
-
242
- // Woo single product page - woo position
243
- var position_val = $('.woo_single_position_select').find(":selected").val();
244
- // woo add to cart layout
245
- var style_val = $('.woo_single_style_select').find(":selected").val();
246
-
247
- if (position_val && '' !== position_val && 'select' !== position_val) {
248
- $('.woo_single_position_settings').show();
249
- }
250
- if (position_val && 'select' == position_val) {
251
- hide_cart_layout();
252
- } else if (style_val && style_val == '1' || style_val == '8') {
253
- // if position_val is not 'select'
254
- show_cart_layout();
255
- }
256
-
257
- // on change - select position
258
- $('.woo_single_position_select').on("change", function (e) {
259
- var position_change_val = e.target.value;
260
- var style_val = $('.woo_single_style_select').find(":selected").val();
261
-
262
- if (position_change_val == 'select') {
263
- $('.woo_single_position_settings').hide(200);
264
- hide_cart_layout();
265
- } else {
266
- $('.woo_single_position_settings').show(200);
267
- if (style_val == '1' || style_val == '8') {
268
- show_cart_layout();
269
- }
270
- }
271
- });
272
-
273
- // on change - style - for cart layout
274
- $('.woo_single_style_select').on("change", function (e) {
275
- var style_change_val = e.target.value;
276
-
277
- if (style_change_val == '1' || style_change_val == '8') {
278
- show_cart_layout();
279
- } else {
280
- hide_cart_layout();
281
- }
282
- });
283
-
284
- // position center is checked
285
- if ($('#woo_single_position_center').is(':checked')) {
286
- $(".woo_single_position_center_checked_content").show();
287
- }
288
-
289
- $("#woo_single_position_center").on("change", function (e) {
290
- if ($('#woo_single_position_center').is(':checked')) {
291
- $(".woo_single_position_center_checked_content").show(200);
292
- } else {
293
- $(".woo_single_position_center_checked_content").hide(100);
294
- }
295
- });
296
-
297
-
298
-
299
- // woo shop page ..
300
- if ($('#woo_shop_add_whatsapp').is(':checked')) {
301
- $(".woo_shop_add_whatsapp_settings").show();
302
-
303
- var shop_style_val = $('.woo_shop_style').find(":selected").val();
304
- if (shop_style_val == '1' || shop_style_val == '8') {
305
- shop_show_cart_layout();
306
- }
307
- }
308
-
309
-
310
-
311
-
312
- $("#woo_shop_add_whatsapp").on("change", function (e) {
313
- if ($('#woo_shop_add_whatsapp').is(':checked')) {
314
- $(".woo_shop_add_whatsapp_settings").show(200);
315
-
316
- var shop_style_val = $('.woo_shop_style').find(":selected").val();
317
-
318
- if (shop_style_val == '1' || shop_style_val == '8') {
319
- shop_show_cart_layout();
320
- }
321
-
322
- } else {
323
- $(".woo_shop_add_whatsapp_settings").hide(100);
324
- shop_hide_cart_layout(100);
325
- }
326
- });
327
-
328
-
329
- // on change - style - for cart layout
330
- $('.woo_shop_style').on("change", function (e) {
331
- var shop_style_change_val = e.target.value;
332
-
333
- if (shop_style_change_val == '1' || shop_style_change_val == '8') {
334
- shop_show_cart_layout();
335
- } else {
336
- shop_hide_cart_layout();
337
- }
338
- });
339
-
340
-
341
- function show_cart_layout() {
342
- $(".woo_single_position_settings_cart_layout").show(200);
343
- }
344
- function hide_cart_layout() {
345
- $(".woo_single_position_settings_cart_layout").hide(200);
346
- }
347
-
348
- function shop_show_cart_layout() {
349
- $(".woo_shop_cart_layout").show(200);
350
- }
351
- function shop_hide_cart_layout() {
352
- $(".woo_shop_cart_layout").hide(200);
353
- }
354
-
355
- }
356
-
357
-
358
- // webhook
359
- function hook() {
360
-
361
- // webhook value - html
362
- var hook_value_html = $('.add_hook_value').attr('data-html');
363
-
364
- // add value
365
- $(document).on('click', '.add_hook_value', function () {
366
-
367
- $('.ctc_hook_value').append(hook_value_html);
368
- });
369
-
370
- // Remove value
371
- $('.ctc_hook_value').on('click', '.hook_remove_value', function (e) {
372
- e.preventDefault();
373
- $(this).closest('.additional-value').remove();
374
- });
375
-
376
- }
377
-
378
-
379
- // things based on screen size
380
- function ss() {
381
-
382
- var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
383
-
384
- if ('yes' == is_mobile) {
385
-
386
- // WhatsApp number tooltip position for mobile
387
- // $("#whatsapp_cc").data('position', 'bottom');
388
- $("#whatsapp_cc").attr('data-position', 'bottom');
389
- $("#whatsapp_number").attr('data-position', 'bottom');
390
- }
391
- }
392
-
393
-
394
- function other() {
395
-
396
- // google ads - checkbox
397
- $('.ga_ads_display').on('click', function (e) {
398
- $('.ga_ads_checkbox').toggle(500);
399
- });
400
-
401
- // display - call gtag_report_conversion by default if checked.
402
- if ($('#ga_ads').is(':checked')) {
403
- $(".ga_ads_checkbox").show();
404
- }
405
-
406
- // hover text on save_changes button
407
- var text = $('#ctc_save_changes_hover_text').text();
408
- $("#submit").attr('title', text);
409
-
410
- // analytics - ga4 display only if ga is enabled.
411
- $("#google_analytics").on("change", function (e) {
412
- if ($('#google_analytics').is(':checked')) {
413
- $(".ctc_ga4").show();
414
- } else {
415
- $(".ctc_ga4").hide();
416
- }
417
- });
418
-
419
- if ($('#google_analytics').is(':checked')) {
420
- $(".ctc_ga4").show();
421
- } else {
422
- $(".ctc_ga4").hide();
423
- }
424
-
425
- // select styles issue
426
-
427
- if ($('#select_styles_issue').is(':checked')) {
428
- $(".select_styles_issue_checkbox").show();
429
- }
430
- $('.select_styles_issue_description').on('click', function (e) {
431
- $('.select_styles_issue_checkbox').toggle(500);
432
- });
433
-
434
-
435
- // s3e - shadow on hover
436
- if (!$('#s3_box_shadow').is(':checked')) {
437
- $(".s3_box_shadow_hover").show();
438
- }
439
-
440
- $('#s3_box_shadow').on('change', function (e) {
441
- if ($('#s3_box_shadow').is(':checked')) {
442
- $(".s3_box_shadow_hover").hide(400);
443
- } else {
444
- $(".s3_box_shadow_hover").show(500);
445
- }
446
- });
447
-
448
- }
449
-
450
- // collapsible..
451
- function collapsible() {
452
-
453
- var ht_ctc_admin = {};
454
-
455
- if (localStorage.getItem('ht_ctc_admin')) {
456
- ht_ctc_admin = localStorage.getItem('ht_ctc_admin');
457
- ht_ctc_admin = JSON.parse(ht_ctc_admin);
458
- }
459
- // else {
460
- // ht_ctc_admin = demo;
461
- // demo = JSON.stringify(demo);
462
- // localStorage.setItem('ht_ctc_admin', demo);
463
- // }
464
-
465
- // get items from ht_ctc_admin
466
- function ctc_getItem(item) {
467
- if (ht_ctc_admin[item]) {
468
- return ht_ctc_admin[item];
469
- } else {
470
- return false;
471
- }
472
- }
473
-
474
- // set items to ht_ctc_admin storage
475
- function ctc_setItem(name, value) {
476
- ht_ctc_admin[name] = value;
477
- var newValues = JSON.stringify(ht_ctc_admin);
478
- localStorage.setItem('ht_ctc_admin', newValues);
479
- }
480
-
481
- /**
482
- * ht_ctc_sidebar_contat - not added, as it may cause view distraction..
483
- */
484
- var styles_list = [
485
- 'ht_ctc_s1',
486
- 'ht_ctc_s2',
487
- 'ht_ctc_s3',
488
- 'ht_ctc_s3_1',
489
- 'ht_ctc_s4',
490
- 'ht_ctc_s5',
491
- 'ht_ctc_s6',
492
- 'ht_ctc_s7',
493
- 'ht_ctc_s7_1',
494
- 'ht_ctc_s8',
495
- 'ht_ctc_s99',
496
- 'ht_ctc_webhooks',
497
- 'ht_ctc_analytics',
498
- 'ht_ctc_animations',
499
- 'ht_ctc_other_settings',
500
- 'ht_ctc_enable_share_group',
501
- 'ht_ctc_debug',
502
- 'ht_ctc_device_settings',
503
- 'ht_ctc_show_hide_settings',
504
- 'ht_ctc_woo_1',
505
- 'ht_ctc_woo_shop',
506
- 'ht_ctc_woo_cart',
507
- 'ht_ctc_woo_checkout',
508
- 'ht_ctc_woo_myaccount',
509
- ];
510
-
511
- var default_active = [
512
- 'ht_ctc_device_settings',
513
- 'ht_ctc_show_hide_settings',
514
- 'ht_ctc_woo_1',
515
- 'ht_ctc_webhooks',
516
- 'ht_ctc_analytics',
517
- 'ht_ctc_animations',
518
- 'ht_ctc_other_settings',
519
- ];
520
-
521
-
522
- styles_list.forEach(e => {
523
-
524
- // one known issue.. is already active its not working as expected.
525
- var is_col = (ctc_getItem('col_' + e)) ? ctc_getItem('col_' + e) : '';
526
- if ('open' == is_col) {
527
- $('.' + e + ' li').addClass('active');
528
- } else if ('close' == is_col) {
529
- $('.' + e + ' li').removeClass('active');
530
- } else if (default_active.includes(e)) {
531
- // if not changed then for default_active list add active..
532
- $('.' + e + ' li').addClass('active');
533
- }
534
-
535
-
536
- $('.' + e).collapsible({
537
- onOpenEnd() {
538
- ctc_setItem('col_' + e, 'open');
539
- },
540
- onCloseEnd() {
541
- ctc_setItem('col_' + e, 'close');
542
- }
543
- });
544
-
545
- });
546
-
547
- }
548
-
549
-
550
-
551
- });
552
-
553
-
554
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/admin/admin_assets/js/333.admin.js DELETED
@@ -1,577 +0,0 @@
1
- // Click to Chat
2
- document.addEventListener('DOMContentLoaded', function () {
3
-
4
- try {
5
- // M.AutoInit();
6
-
7
- var elems = document.querySelectorAll('select');
8
- M.FormSelect.init(elems, {});
9
-
10
- var elems = document.querySelectorAll('.collapsible');
11
- M.Collapsible.init(elems, {});
12
-
13
- var elems = document.querySelectorAll('.modal');
14
- M.Modal.init(elems, {});
15
-
16
- var elems = document.querySelectorAll('.tooltipped');
17
- M.Tooltip.init(elems, {});
18
- } catch (e) { }
19
-
20
-
21
- });
22
-
23
- (function ($) {
24
-
25
- // ready
26
- $(function () {
27
-
28
- try {
29
- $('select').formSelect();
30
- $('.collapsible').collapsible();
31
- $('.modal').modal();
32
- $('.tooltipped').tooltip();
33
- } catch (e) { }
34
-
35
- var color_picker = {
36
- palettes: [
37
- '#000000',
38
- '#FFFFFF',
39
- '#075e54',
40
- '#128C7E',
41
- '#25d366',
42
- '#DCF8C6',
43
- '#34B7F1',
44
- '#ECE5DD',
45
- ],
46
- }
47
-
48
- $('.ht-ctc-color').wpColorPicker(color_picker);
49
-
50
-
51
- // functions
52
- show_hide_options();
53
- styles();
54
- call_to_action();
55
- ht_ctc_admin_animations();
56
- desktop_mobile();
57
- wn();
58
- hook();
59
- ss();
60
- other();
61
-
62
- try {
63
- woo_page();
64
- collapsible();
65
- } catch (e) { }
66
-
67
- try {
68
- greetings();
69
- } catch (e) { }
70
-
71
-
72
-
73
- // show/hide settings
74
- function show_hide_options() {
75
-
76
- // default display
77
- var val = $('.global_display:checked').val();
78
-
79
- if (val == 'show') {
80
- $('.global_show_or_hide_icon').addClass('dashicons dashicons-visibility');
81
- $(".hide_settings").show();
82
- $(".show_hide_types .show_btn").attr('disabled', 'disabled');
83
- $(".show_hide_types .show_box").hide();
84
- } else if (val == 'hide') {
85
- $('.global_show_or_hide_icon').addClass('dashicons dashicons-hidden');
86
- $(".show_settings").show();
87
- $(".show_hide_types .hide_btn").attr('disabled', 'disabled');
88
- $(".show_hide_types .hide_box").hide();
89
- }
90
- $('.global_show_or_hide_label').html('(' + val + ')');
91
-
92
- // on change
93
- $(".global_display").on("change", function (e) {
94
-
95
- var change_val = e.target.value;
96
- var add_class = '';
97
- var remove_class = '';
98
-
99
- $(".hide_settings").hide();
100
- $(".show_settings").hide();
101
- $(".show_hide_types .show_btn").removeAttr('disabled');
102
- $(".show_hide_types .hide_btn").removeAttr('disabled');
103
- $(".show_hide_types .show_box").hide();
104
- $(".show_hide_types .hide_box").hide();
105
-
106
- if (change_val == 'show') {
107
- add_class = 'dashicons dashicons-visibility';
108
- remove_class = 'dashicons-hidden';
109
- $(".hide_settings").show(500);
110
- $(".show_hide_types .show_btn").attr('disabled', 'disabled');
111
- $(".show_hide_types .hide_box").show();
112
- } else if (change_val == 'hide') {
113
- add_class = 'dashicons dashicons-hidden';
114
- remove_class = 'dashicons-visibility';
115
- $(".show_settings").show(500);
116
- $(".show_hide_types .hide_btn").attr('disabled', 'disabled');
117
- $(".show_hide_types .show_box").show();
118
- }
119
- $('.global_show_or_hide_label').html('(' + change_val + ')');
120
- $('.global_show_or_hide_icon').removeClass(remove_class);
121
- $('.global_show_or_hide_icon').addClass(add_class);
122
-
123
- });
124
-
125
- }
126
-
127
-
128
- // styles
129
- function styles() {
130
-
131
- // on change - styles
132
- $(".chat_select_style").on("change", function (e) {
133
- $(".customize_styles_link").animate({ fontSize: '1.2em' }, "slow");
134
- });
135
-
136
- // style-1 - add icon
137
- if ($('.s1_add_icon').is(':checked')) {
138
- $(".s1_icon_settings").show();
139
- } else {
140
- $(".s1_icon_settings").hide();
141
- }
142
-
143
- $(".s1_add_icon").on("change", function (e) {
144
- console.log('change');
145
-
146
- if ($('.s1_add_icon').is(':checked')) {
147
- $(".s1_icon_settings").show(200);
148
- } else {
149
- $(".s1_icon_settings").hide(200);
150
- }
151
-
152
- });
153
-
154
- }
155
-
156
-
157
-
158
- // call to actions
159
- function call_to_action() {
160
- var cta_styles = ['.ht_ctc_s2', '.ht_ctc_s3', '.ht_ctc_s3_1', '.ht_ctc_s7'];
161
- cta_styles.forEach(ht_ctc_admin_cta);
162
-
163
- function ht_ctc_admin_cta(style) {
164
- // default display
165
- var val = $(style + ' .select_cta_type').find(":selected").val();
166
- if (val == 'hide') {
167
- $(style + " .cta_stick").hide();
168
- }
169
-
170
- // on change
171
- $(style + " .select_cta_type").on("change", function (e) {
172
- var change_val = e.target.value;
173
- if (change_val == 'hide') {
174
- $(style + " .cta_stick").hide(100);
175
- } else {
176
- $(style + " .cta_stick").show(200);
177
- }
178
- });
179
- }
180
-
181
- }
182
-
183
-
184
-
185
- function ht_ctc_admin_animations() {
186
- // default display
187
- var val = $('.select_an_type').find(":selected").val();
188
- if (val == 'no-animation') {
189
- $(".an_delay").hide();
190
- $(".an_itr").hide();
191
- }
192
-
193
- // on change
194
- $(".select_an_type").on("change", function (e) {
195
-
196
- var change_val = e.target.value;
197
-
198
- if (change_val == 'no-animation') {
199
- $(".an_delay").hide();
200
- $(".an_itr").hide();
201
- } else {
202
- $(".an_delay").show(500);
203
- $(".an_itr").show(500);
204
- }
205
- });
206
- }
207
-
208
-
209
- // Deskop, Mobile - same settings
210
- function desktop_mobile() {
211
-
212
- // same setting
213
- if ($('.same_settings').is(':checked')) {
214
- $(".not_samesettings").hide();
215
- } else {
216
- $(".not_samesettings").show();
217
- }
218
-
219
- $(".same_settings").on("change", function (e) {
220
-
221
- if ($('.same_settings').is(':checked')) {
222
- $(".not_samesettings").hide(900);
223
- $(".select_styles_issue_checkbox").hide();
224
- } else {
225
- $(".not_samesettings").show(900);
226
- }
227
-
228
- });
229
-
230
- }
231
-
232
-
233
- // WhatsApp number
234
- function wn() {
235
-
236
- var cc = $("#whatsapp_cc").val();
237
- var num = $("#whatsapp_number").val();
238
-
239
- $("#whatsapp_cc").on("change paste keyup", function (e) {
240
- cc = $("#whatsapp_cc").val();
241
- call();
242
- });
243
-
244
- $("#whatsapp_number").on("change paste keyup", function (e) {
245
- num = $("#whatsapp_number").val();
246
- call();
247
-
248
- if (num && 0 == num.charAt(0)) {
249
- $('.ctc_wn_initial_zero').show(500);
250
- } else {
251
- $('.ctc_wn_initial_zero').hide(500);
252
- }
253
- });
254
-
255
- function call() {
256
- $(".ht_ctc_wn").html(cc + '' + num);
257
- $("#ctc_whatsapp_number").val(cc + '' + num);
258
- }
259
-
260
- }
261
-
262
- // woo page..
263
- function woo_page() {
264
-
265
- // Woo single product page - woo position
266
- var position_val = $('.woo_single_position_select').find(":selected").val();
267
- // woo add to cart layout
268
- var style_val = $('.woo_single_style_select').find(":selected").val();
269
-
270
- if (position_val && '' !== position_val && 'select' !== position_val) {
271
- $('.woo_single_position_settings').show();
272
- }
273
- if (position_val && 'select' == position_val) {
274
- hide_cart_layout();
275
- } else if (style_val && style_val == '1' || style_val == '8') {
276
- // if position_val is not 'select'
277
- show_cart_layout();
278
- }
279
-
280
- // on change - select position
281
- $('.woo_single_position_select').on("change", function (e) {
282
- var position_change_val = e.target.value;
283
- var style_val = $('.woo_single_style_select').find(":selected").val();
284
-
285
- if (position_change_val == 'select') {
286
- $('.woo_single_position_settings').hide(200);
287
- hide_cart_layout();
288
- } else {
289
- $('.woo_single_position_settings').show(200);
290
- if (style_val == '1' || style_val == '8') {
291
- show_cart_layout();
292
- }
293
- }
294
- });
295
-
296
- // on change - style - for cart layout
297
- $('.woo_single_style_select').on("change", function (e) {
298
- var style_change_val = e.target.value;
299
-
300
- if (style_change_val == '1' || style_change_val == '8') {
301
- show_cart_layout();
302
- } else {
303
- hide_cart_layout();
304
- }
305
- });
306
-
307
- // position center is checked
308
- if ($('#woo_single_position_center').is(':checked')) {
309
- $(".woo_single_position_center_checked_content").show();
310
- }
311
-
312
- $("#woo_single_position_center").on("change", function (e) {
313
- if ($('#woo_single_position_center').is(':checked')) {
314
- $(".woo_single_position_center_checked_content").show(200);
315
- } else {
316
- $(".woo_single_position_center_checked_content").hide(100);
317
- }
318
- });
319
-
320
-
321
-
322
- // woo shop page ..
323
- if ($('#woo_shop_add_whatsapp').is(':checked')) {
324
- $(".woo_shop_add_whatsapp_settings").show();
325
-
326
- var shop_style_val = $('.woo_shop_style').find(":selected").val();
327
- if (shop_style_val == '1' || shop_style_val == '8') {
328
- shop_show_cart_layout();
329
- }
330
- }
331
-
332
-
333
-
334
-
335
- $("#woo_shop_add_whatsapp").on("change", function (e) {
336
- if ($('#woo_shop_add_whatsapp').is(':checked')) {
337
- $(".woo_shop_add_whatsapp_settings").show(200);
338
-
339
- var shop_style_val = $('.woo_shop_style').find(":selected").val();
340
-
341
- if (shop_style_val == '1' || shop_style_val == '8') {
342
- shop_show_cart_layout();
343
- }
344
-
345
- } else {
346
- $(".woo_shop_add_whatsapp_settings").hide(100);
347
- shop_hide_cart_layout(100);
348
- }
349
- });
350
-
351
-
352
- // on change - style - for cart layout
353
- $('.woo_shop_style').on("change", function (e) {
354
- var shop_style_change_val = e.target.value;
355
-
356
- if (shop_style_change_val == '1' || shop_style_change_val == '8') {
357
- shop_show_cart_layout();
358
- } else {
359
- shop_hide_cart_layout();
360
- }
361
- });
362
-
363
-
364
- function show_cart_layout() {
365
- $(".woo_single_position_settings_cart_layout").show(200);
366
- }
367
- function hide_cart_layout() {
368
- $(".woo_single_position_settings_cart_layout").hide(200);
369
- }
370
-
371
- function shop_show_cart_layout() {
372
- $(".woo_shop_cart_layout").show(200);
373
- }
374
- function shop_hide_cart_layout() {
375
- $(".woo_shop_cart_layout").hide(200);
376
- }
377
-
378
- }
379
-
380
-
381
- // webhook
382
- function hook() {
383
-
384
- // webhook value - html
385
- var hook_value_html = $('.add_hook_value').attr('data-html');
386
-
387
- // add value
388
- $(document).on('click', '.add_hook_value', function () {
389
-
390
- $('.ctc_hook_value').append(hook_value_html);
391
- });
392
-
393
- // Remove value
394
- $('.ctc_hook_value').on('click', '.hook_remove_value', function (e) {
395
- e.preventDefault();
396
- $(this).closest('.additional-value').remove();
397
- });
398
-
399
- }
400
-
401
-
402
- // things based on screen size
403
- function ss() {
404
-
405
- var is_mobile = (typeof screen.width !== "undefined" && screen.width > 1024) ? "no" : "yes";
406
-
407
- if ('yes' == is_mobile) {
408
-
409
- // WhatsApp number tooltip position for mobile
410
- // $("#whatsapp_cc").data('position', 'bottom');
411
- $("#whatsapp_cc").attr('data-position', 'bottom');
412
- $("#whatsapp_number").attr('data-position', 'bottom');
413
- }
414
- }
415
-
416
-
417
- function other() {
418
-
419
- // google ads - checkbox
420
- $('.ga_ads_display').on('click', function (e) {
421
- $('.ga_ads_checkbox').toggle(500);
422
- });
423
-
424
- // display - call gtag_report_conversion by default if checked.
425
- if ($('#ga_ads').is(':checked')) {
426
- $(".ga_ads_checkbox").show();
427
- }
428
-
429
- // hover text on save_changes button
430
- var text = $('#ctc_save_changes_hover_text').text();
431
- $("#submit").attr('title', text);
432
-
433
- // analytics - ga4 display only if ga is enabled.
434
- $("#google_analytics").on("change", function (e) {
435
- if ($('#google_analytics').is(':checked')) {
436
- $(".ctc_ga4").show();
437
- } else {
438
- $(".ctc_ga4").hide();
439
- }
440
- });
441
-
442
- if ($('#google_analytics').is(':checked')) {
443
- $(".ctc_ga4").show();
444
- } else {
445
- $(".ctc_ga4").hide();
446
- }
447
-
448
- // select styles issue
449
-
450
- if ($('#select_styles_issue').is(':checked')) {
451
- $(".select_styles_issue_checkbox").show();
452
- }
453
- $('.select_styles_issue_description').on('click', function (e) {
454
- $('.select_styles_issue_checkbox').toggle(500);
455
- });
456
-
457
-
458
- // s3e - shadow on hover
459
- if (!$('#s3_box_shadow').is(':checked')) {
460
- $(".s3_box_shadow_hover").show();
461
- }
462
-
463
- $('#s3_box_shadow').on('change', function (e) {
464
- if ($('#s3_box_shadow').is(':checked')) {
465
- $(".s3_box_shadow_hover").hide(400);
466
- } else {
467
- $(".s3_box_shadow_hover").show(500);
468
- }
469
- });
470
-
471
- }
472
-
473
- // collapsible..
474
- function collapsible() {
475
-
476
- var ht_ctc_admin = {};
477
-
478
- if (localStorage.getItem('ht_ctc_admin')) {
479
- ht_ctc_admin = localStorage.getItem('ht_ctc_admin');
480
- ht_ctc_admin = JSON.parse(ht_ctc_admin);
481
- }
482
- // else {
483
- // ht_ctc_admin = demo;
484
- // demo = JSON.stringify(demo);
485
- // localStorage.setItem('ht_ctc_admin', demo);
486
- // }
487
-
488
- // get items from ht_ctc_admin
489
- function ctc_getItem(item) {
490
- if (ht_ctc_admin[item]) {
491
- return ht_ctc_admin[item];
492
- } else {
493
- return false;
494
- }
495
- }
496
-
497
- // set items to ht_ctc_admin storage
498
- function ctc_setItem(name, value) {
499
- ht_ctc_admin[name] = value;
500
- var newValues = JSON.stringify(ht_ctc_admin);
501
- localStorage.setItem('ht_ctc_admin', newValues);
502
- }
503
-
504
- /**
505
- * ht_ctc_sidebar_contat - not added, as it may cause view distraction..
506
- */
507
- var styles_list = [
508
- 'ht_ctc_s1',
509
- 'ht_ctc_s2',
510
- 'ht_ctc_s3',
511
- 'ht_ctc_s3_1',
512
- 'ht_ctc_s4',
513
- 'ht_ctc_s5',
514
- 'ht_ctc_s6',
515
- 'ht_ctc_s7',
516
- 'ht_ctc_s7_1',
517
- 'ht_ctc_s8',
518
- 'ht_ctc_s99',
519
- 'ht_ctc_webhooks',
520
- 'ht_ctc_analytics',
521
- 'ht_ctc_animations',
522
- 'ht_ctc_other_settings',
523
- 'ht_ctc_enable_share_group',
524
- 'ht_ctc_debug',
525
- 'ht_ctc_device_settings',
526
- 'ht_ctc_show_hide_settings',
527
- 'ht_ctc_woo_1',
528
- 'ht_ctc_woo_shop',
529
- 'ht_ctc_woo_cart',
530
- 'ht_ctc_woo_checkout',
531
- 'ht_ctc_woo_myaccount',
532
- ];
533
-
534
- var default_active = [
535
- 'ht_ctc_device_settings',
536
- 'ht_ctc_show_hide_settings',
537
- 'ht_ctc_woo_1',
538
- 'ht_ctc_webhooks',
539
- 'ht_ctc_analytics',
540
- 'ht_ctc_animations',
541
- 'ht_ctc_other_settings',
542
- ];
543
-
544
-
545
- styles_list.forEach(e => {
546
-
547
- // one known issue.. is already active its not working as expected.
548
- var is_col = (ctc_getItem('col_' + e)) ? ctc_getItem('col_' + e) : '';
549
- if ('open' == is_col) {
550
- $('.' + e + ' li').addClass('active');
551
- } else if ('close' == is_col) {
552
- $('.' + e + ' li').removeClass('active');
553
- } else if (default_active.includes(e)) {
554
- // if not changed then for default_active list add active..
555
- $('.' + e + ' li').addClass('active');
556
- }
557
-
558
-
559
- $('.' + e).collapsible({
560
- onOpenEnd() {
561
- ctc_setItem('col_' + e, 'open');
562
- },
563
- onCloseEnd() {
564
- ctc_setItem('col_' + e, 'close');
565
- }
566
- });
567
-
568
- });
569
-
570
- }
571
-
572
-
573
-
574
- });
575
-
576
-
577
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
new/admin/admin_assets/js/admin.js CHANGED
@@ -550,9 +550,7 @@ document.addEventListener('DOMContentLoaded', function () {
550
  'ht_ctc_show_hide_settings',
551
  'ht_ctc_woo_1',
552
  'ht_ctc_woo_shop',
553
- 'ht_ctc_woo_cart',
554
- 'ht_ctc_woo_checkout',
555
- 'ht_ctc_woo_myaccount',
556
  ];
557
 
558
  var default_active = [
550
  'ht_ctc_show_hide_settings',
551
  'ht_ctc_woo_1',
552
  'ht_ctc_woo_shop',
553
+ 'ctc_g_opt_in',
 
 
554
  ];
555
 
556
  var default_active = [
new/admin/admin_assets/js/greetings.js CHANGED
@@ -3,24 +3,35 @@
3
  // ready
4
  $(function () {
5
 
 
 
6
  if (document.querySelector('.pr_greetings_template')) {
 
7
  try {
8
  greetings_template();
9
- } catch (e) { }
10
-
11
- // md - reinstall
12
- try {
13
- $('select').formSelect();
14
- // $('.collapsible').collapsible();
15
- // $('.modal').modal();
16
- } catch (e) { }
17
  }
 
18
  if (document.querySelector('.ctc-admin-greetings-page') || document.querySelector('.ctc-admin-woo-page')) {
 
19
  try {
20
  editor();
21
- } catch (e) { }
 
 
22
  }
23
 
 
 
 
 
 
 
 
 
 
24
  /**
25
  * display settings based on Greetings template selection
26
  */
@@ -98,10 +109,11 @@
98
 
99
 
100
  /**
 
101
  * only on greetings, woo pages
 
102
  */
103
  function editor() {
104
- // tinymce editor - bg color
105
  var check = 1;
106
  var check_interval = 1000;
107
  var check_times = 28; // ( check_times * check_interval = total milliseconds )
@@ -110,7 +122,9 @@
110
  if (document.getElementById("header_content_ifr")) {
111
  try {
112
  tiny_bg_color();
113
- } catch (e) { }
 
 
114
  } else {
115
  check++;
116
  if (check < check_times) {
3
  // ready
4
  $(function () {
5
 
6
+ console.log('greetings.js');
7
+
8
  if (document.querySelector('.pr_greetings_template')) {
9
+ console.log('-- pr_greetings_template --');
10
  try {
11
  greetings_template();
12
+ } catch (e) {
13
+ console.log('catch greetings_template');
14
+ }
 
 
 
 
 
15
  }
16
+
17
  if (document.querySelector('.ctc-admin-greetings-page') || document.querySelector('.ctc-admin-woo-page')) {
18
+ console.log('-- ctc-admin-greetings-page or ctc-admin-woo-page --');
19
  try {
20
  editor();
21
+ } catch (e) {
22
+ console.log('catch editor');
23
+ }
24
  }
25
 
26
+ // md - reinstall
27
+ setTimeout(() => {
28
+ try {
29
+ $('select').formSelect();
30
+ } catch (e) {
31
+ console.log('catch select formSelect');
32
+ }
33
+ }, 500);
34
+
35
  /**
36
  * display settings based on Greetings template selection
37
  */
109
 
110
 
111
  /**
112
+ * tinymce editor
113
  * only on greetings, woo pages
114
+ * bg color
115
  */
116
  function editor() {
 
117
  var check = 1;
118
  var check_interval = 1000;
119
  var check_times = 28; // ( check_times * check_interval = total milliseconds )
122
  if (document.getElementById("header_content_ifr")) {
123
  try {
124
  tiny_bg_color();
125
+ } catch (e) {
126
+ console.log('catch tiny_bg_color');
127
+ }
128
  } else {
129
  check++;
130
  if (check < check_times) {
new/admin/class-ht-ctc-admin-greetings-page.php CHANGED
@@ -256,6 +256,8 @@ class HT_CTC_Admin_Greetings {
256
  ],
257
  [
258
  'template' => 'collapsible_start',
 
 
259
  'title' => __( 'Opt-in', 'click-to-chat-for-whatsapp'),
260
  ],
261
  [
256
  ],
257
  [
258
  'template' => 'collapsible_start',
259
+ 'collapsible' => 'no',
260
+ 'ul_class' => 'ctc_g_opt_in',
261
  'title' => __( 'Opt-in', 'click-to-chat-for-whatsapp'),
262
  ],
263
  [
new/admin/components/collapsible_start.php CHANGED
@@ -9,10 +9,19 @@ if ( ! defined( 'ABSPATH' ) ) exit;
9
  $title = (isset($input['title'])) ? esc_attr($input['title']) : '';
10
 
11
  $description = (isset($input['description'])) ? $input['description'] : '';
 
 
 
 
 
 
 
 
 
12
  ?>
13
 
14
- <ul class="collapsible">
15
- <li class="active">
16
  <div class="collapsible-header" id="showhide_settings"><?= $title ?></div>
17
  <div class="collapsible-body">
18
 
9
  $title = (isset($input['title'])) ? esc_attr($input['title']) : '';
10
 
11
  $description = (isset($input['description'])) ? $input['description'] : '';
12
+
13
+ $active = 'active';
14
+ $collapsible = (isset($input['collapsible'])) ? $input['collapsible'] : '';
15
+ if ('no' == $collapsible) {
16
+ $active = '';
17
+ }
18
+
19
+ $ul_class = (isset($input['ul_class'])) ? $input['ul_class'] : '';
20
+
21
  ?>
22
 
23
+ <ul class="collapsible <?= $ul_class ?>">
24
+ <li class="<?= $active ?>">
25
  <div class="collapsible-header" id="showhide_settings"><?= $title ?></div>
26
  <div class="collapsible-body">
27
 
new/inc/assets/js/325.app.js DELETED
@@ -1 +0,0 @@
1
- !function(l){l(function(){var t,o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",h="",i="";if("undefined"!=typeof ht_ctc_chat_var)i=ht_ctc_chat_var,e(),c();else{try{document.querySelector(".ht_ctc_chat_data")&&(t=l(".ht_ctc_chat_data").attr("data-settings"),i=JSON.parse(t))}catch(t){i={}}e(),c()}function e(){var t=document.querySelector(".ht_ctc_chat_data");t&&(h=l(".ht_ctc_chat_data").attr("data-no_number"),t.remove())}function c(){var t;l(document).trigger("ht_ctc_ce_settings",[i]),document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:i}})),(t=document.querySelector(".ht-ctc-chat"))&&(l(document).trigger("ht_ctc_ce_chat"),document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){"yes"==i.schedule?(l(document).trigger("ht_ctc_ce_display",[i,r,t]),document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:i,display_chat:r,ht_ctc_chat:t}}))):r(t)}(t),t.addEventListener("click",function(){d(t)})),l(document).on("click",".ht-ctc-sc-chat",function(){var t=this.getAttribute("data-number"),e=(e=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,o);e=encodeURIComponent(e),i.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+t+"&text="+e,"_blank","noopener"):window.open("https://wa.me/"+t+"?text="+e,"_blank","noopener"),s(this),u(t)}),l(document).on("click",".ctc_chat, #ctc_chat",function(){d(this)}),l(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),d(this)})}function r(t){var e;"yes"==n?"show"==i.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=i.pos_m+i.css,_(t)):"show"==i.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=i.pos_d+i.css,_(t))}function _(e){try{l(e).show(parseInt(i.se))}catch(t){e.style.display="block"}var t,c;c=l(t=e).hasClass("ht_ctc_entry_animation")?1200:120,setTimeout(function(){t.classList.add("ht_ctc_animation",i.ani)},c),l(".ht-ctc-chat").hover(function(){l(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){l(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function s(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var e=i.number;t.classList.contains("ht-ctc-sc")&&(e=t.getAttribute("data-number"));var c="Click to Chat for WhatsApp",n="chat: "+e,t=a+", "+o;(i.ga||i.ga4)&&("undefined"!=typeof gtag?i.ga4?gtag("event","click to chat",{number:e,title:a,url:o}):gtag("event",n,{event_category:c,event_label:t}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",c,n,t):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",c,n,t)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",type:"chat",number:e,title:a,url:o,event_category:c,event_label:t,event_action:n}),i.ads&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),i.fb&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:a,URL:o})}function d(t){l(document).trigger("ht_ctc_ce_number",[i]),document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:i}}));var e=i.number,c=(c=i.pre_filled).replace(/\[url]/gi,o);c=encodeURIComponent(c),""!=e?(i.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+e+"&text="+c,"_blank","noopener"):window.open("https://wa.me/"+e+"?text="+c,"_blank","noopener"),s(t),u(e)):l(".ht-ctc-chat").html(h)}function u(t){var e,c;i.hook_url&&(e=i.hook_url,c={},i.hook_v&&(c=i.hook_v),l(document).trigger("ht_ctc_ce_hook",[i,t]),document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:i,number:t}})),e=i.hook_url,c=i.hook_v,data=JSON.stringify(c),l.ajax({url:e,type:"POST",mode:"no-cors",data:data,success:function(t){}}))}})}(jQuery);
 
new/inc/assets/js/331.app.js DELETED
@@ -1 +0,0 @@
1
- !function(f){f(function(){var o=window.location.href,a=void 0!==document.title?document.title:"",n=void 0!==screen.width&&1024<screen.width?"no":"yes",_="",c={};function e(t,e){c[t]=e;e=JSON.stringify(c);localStorage.setItem("ht_ctc_storage",e)}localStorage.getItem("ht_ctc_storage")&&(c=localStorage.getItem("ht_ctc_storage"),c=JSON.parse(c));var t,i="";if("undefined"!=typeof ht_ctc_chat_var)i=ht_ctc_chat_var,s(),r();else{try{document.querySelector(".ht_ctc_chat_data")&&(t=f(".ht_ctc_chat_data").attr("data-settings"),i=JSON.parse(t))}catch(t){i={}}s(),r()}function s(){var t=document.querySelector(".ht_ctc_chat_data");t&&(_=f(".ht_ctc_chat_data").attr("data-no_number"),t.remove())}function r(){var e;document.dispatchEvent(new CustomEvent("ht_ctc_event_settings",{detail:{ctc:i}})),(e=document.querySelector(".ht-ctc-chat"))&&(document.dispatchEvent(new CustomEvent("ht_ctc_event_chat")),function(t){"yes"==i.schedule?document.dispatchEvent(new CustomEvent("ht_ctc_event_display",{detail:{ctc:i,display_chat:l,ht_ctc_chat:t}})):l(t)}(e),e.addEventListener("click",function(){f(".ht_ctc_chat_greetings_box").length||p(e)}),f(".ht_ctc_chat_greetings_box").length&&f(document).on("click",".ht_ctc_chat_style",function(t){(f(".ht_ctc_chat_greetings_box").hasClass("ctc_greetings_opened")?u:d)()}),f(document).on("click",".ctc_greetings_close_btn",function(t){u()}),f(document).on("click",".ht_ctc_chat_greetings_box_link",function(t){t.preventDefault(),p(e),document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings"))})),f(document).on("click",".ht-ctc-sc-chat",function(){var t=this.getAttribute("data-number"),e=(e=this.getAttribute("data-pre_filled")).replace(/\[url]/gi,o);e=encodeURIComponent(e),i.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+t+"&text="+e,"_blank","noopener"):window.open("https://wa.me/"+t+"?text="+e,"_blank","noopener"),v(this),m(t)}),f(document).on("click",".ctc_chat, #ctc_chat",function(t){p(this),f(this).hasClass("ctc_woo_place")&&t.preventDefault()}),f(document).on("click",'[href="#ctc_chat"]',function(t){t.preventDefault(),p(this)})}function h(){if(f(".ht_ctc_chat_greetings_box").length){if(i.g_device){if("yes"!==n&&"mobile"==i.g_device)return void f(".ht_ctc_chat_greetings_box").remove();if("yes"==n&&"desktop"==i.g_device)return void f(".ht_ctc_chat_greetings_box").remove()}document.dispatchEvent(new CustomEvent("ht_ctc_event_after_chat_displayed",{detail:{ctc:i,greetings_open:d,greetings_close:u}})),i.g_init&&"open"==i.g_init&&"user_closed"!==(c["g_user_action"]||!1)&&d("init")}}function d(t){f(".ctc_cta_stick").remove(),f(".ht_ctc_chat_greetings_box").show(70),f(".ht_ctc_chat_greetings_box").addClass("ctc_greetings_opened").removeClass("ctc_greetings_closed"),e("g_action",t),"user_opened"==t&&e("g_user_action",t)}function u(t="user_closed"){f(".ht_ctc_chat_greetings_box").hide(70),f(".ht_ctc_chat_greetings_box").addClass("ctc_greetings_closed").removeClass("ctc_greetings_opened"),e("g_action",t),"user_closed"==t&&e("g_user_action",t)}function l(t){var e;"yes"==n?"show"==i.dis_m&&((e=document.querySelector(".ht_ctc_desktop_chat"))&&e.remove(),t.style.cssText=i.pos_m+i.css,g(t)):"show"==i.dis_d&&((e=document.querySelector(".ht_ctc_mobile_chat"))&&e.remove(),t.style.cssText=i.pos_d+i.css,g(t))}function g(e){try{f(e).show(parseInt(i.se))}catch(t){e.style.display="block"}var t,c;h(),c=f(t=e).hasClass("ht_ctc_entry_animation")?1200:120,setTimeout(function(){t.classList.add("ht_ctc_animation",i.ani)},c),f(".ht-ctc-chat").hover(function(){f(".ht-ctc-chat .ht-ctc-cta-hover").show(120)},function(){f(".ht-ctc-chat .ht-ctc-cta-hover").hide(100)})}function v(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_analytics"));var e=i.number;t.classList.contains("ht-ctc-sc")&&(e=t.getAttribute("data-number"));var c="Click to Chat for WhatsApp",n="chat: "+e,t=a+", "+o;(i.ga||i.ga4)&&("undefined"!=typeof gtag?i.ga4?gtag("event","click to chat",{number:e,title:a,url:o}):gtag("event",n,{event_category:c,event_label:t}):"undefined"!=typeof ga&&void 0!==ga.getAll?ga.getAll()[0].send("event",c,n,t):"undefined"!=typeof __gaTracker&&__gaTracker("send","event",c,n,t)),"undefined"!=typeof dataLayer&&dataLayer.push({event:"Click to Chat",type:"chat",number:e,title:a,url:o,event_category:c,event_label:t,event_action:n}),i.ads&&"undefined"!=typeof gtag_report_conversion&&gtag_report_conversion(),i.fb&&"undefined"!=typeof fbq&&fbq("trackCustom","Click to Chat by HoliThemes",{Category:"Click to Chat for WhatsApp",return_type:"chat",ID:e,Title:a,URL:o})}function p(t){document.dispatchEvent(new CustomEvent("ht_ctc_event_number",{detail:{ctc:i}}));var e=i.number,c=i.pre_filled;t.hasAttribute("data-number")&&(e=t.getAttribute("data-number")),t.hasAttribute("data-pre_filled")&&(c=t.getAttribute("data-pre_filled")),c=c.replace(/\[url]/gi,o),c=encodeURIComponent(c),""!=e?(i.web&&"yes"!==n?window.open("https://web.whatsapp.com/send?phone="+e+"&text="+c,"_blank","noopener"):window.open("https://wa.me/"+e+"?text="+c,"_blank","noopener"),v(t),m(e)):f(".ht-ctc-chat").html(_)}function m(t){var e,c;i.hook_url&&(e=i.hook_url,c={},i.hook_v&&(c=i.hook_v),document.dispatchEvent(new CustomEvent("ht_ctc_event_hook",{detail:{ctc:i,number:t}})),e=i.hook_url,c=i.hook_v,data=JSON.stringify(c),f.ajax({url:e,type:"POST",mode:"no-cors",data:data,success:function(t){}}))}})}(jQuery);
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Requires at least: 4.6
3
  Tested up to: 6.0
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
- Stable tag: 3.9.8
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, WhatsApp WooCommerce, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -503,6 +503,9 @@ After Activate the plugin, add WhatsApp Number at plugin settings.
503
 
504
  == Changelog ==
505
 
 
 
 
506
  = 3.9.8 =
507
  * Enchantment: Admin Greetings page
508
 
3
  Tested up to: 6.0
4
  Requires PHP: 5.6
5
  Contributors: holithemes
6
+ Stable tag: 3.9.9
7
  Tags: whatsapp, whatsapp business, click to chat, whatsapp chat, whatsapp support, whatsapp group, whatsapp message, WhatsApp WooCommerce, whatsapp wordpress, whatsapp floating button, whatsapp icon, holithemes
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
503
 
504
  == Changelog ==
505
 
506
+ = 3.9.9 =
507
+ * Enchantment: opt-in, greetings features
508
+
509
  = 3.9.8 =
510
  * Enchantment: Admin Greetings page
511