WhatsApp me - Version 4.5.11

Version Description

  • CHANGED Better Joinchat script initialization for deferred or async load by optimizers.
Download this release

Release Info

Developer pacotole
Plugin Icon 128x128 WhatsApp me
Version 4.5.11
Comparing to
See all releases

Code changes from version 4.5.10 to 4.5.11

README.txt CHANGED
@@ -3,9 +3,9 @@ Contributors: creapuntome, pacotole, davidlillo, monillo
3
  Donate link: https://join.chat/donate/
4
  Tags: Chat, Click to Chat, Facebook Messenger, WhatsApp, Telegram, Whatsapp Business, button, support chat, support, contact, directly message WhatsApp, floating WhatsApp, WhatsApp chat
5
  Requires at least: 4.4.0
6
- Tested up to: 6.0
7
  Requires PHP: 5.5
8
- Stable tag: 4.5.10
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -356,6 +356,9 @@ Joinchat save two localStorage variables for proper operation:
356
 
357
  == Changelog ==
358
 
 
 
 
359
  = 4.5.10 =
360
  + **NEW:** GA4 "generate_lead" event can now be changed to a custom event.
361
  * CHANGED default z-index to `9000` for compatibility with major cookies plugins.
3
  Donate link: https://join.chat/donate/
4
  Tags: Chat, Click to Chat, Facebook Messenger, WhatsApp, Telegram, Whatsapp Business, button, support chat, support, contact, directly message WhatsApp, floating WhatsApp, WhatsApp chat
5
  Requires at least: 4.4.0
6
+ Tested up to: 6.1
7
  Requires PHP: 5.5
8
+ Stable tag: 4.5.11
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
356
 
357
  == Changelog ==
358
 
359
+ = 4.5.11 =
360
+ * CHANGED Better Joinchat script initialization for deferred or async load by optimizers.
361
+
362
  = 4.5.10 =
363
  + **NEW:** GA4 "generate_lead" event can now be changed to a custom event.
364
  * CHANGED default z-index to `9000` for compatibility with major cookies plugins.
joinchat.php CHANGED
@@ -9,7 +9,7 @@
9
  * Plugin Name: Joinchat
10
  * Plugin URI: https://join.chat
11
  * Description: Connects a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
12
- * Version: 4.5.10
13
  * Author: Creame
14
  * Author URI: https://crea.me
15
  * License: GPL-2.0+
@@ -26,7 +26,7 @@ if ( ! defined( 'WPINC' ) ) {
26
  /**
27
  * Define constants.
28
  */
29
- define( 'JOINCHAT_VERSION', '4.5.10' );
30
  define( 'JOINCHAT_FILE', __FILE__ );
31
  define( 'JOINCHAT_DIR', plugin_dir_path( JOINCHAT_FILE ) );
32
  define( 'JOINCHAT_BASENAME', plugin_basename( JOINCHAT_FILE ) );
9
  * Plugin Name: Joinchat
10
  * Plugin URI: https://join.chat
11
  * Description: Connects a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
12
+ * Version: 4.5.11
13
  * Author: Creame
14
  * Author URI: https://crea.me
15
  * License: GPL-2.0+
26
  /**
27
  * Define constants.
28
  */
29
+ define( 'JOINCHAT_VERSION', '4.5.11' );
30
  define( 'JOINCHAT_FILE', __FILE__ );
31
  define( 'JOINCHAT_DIR', plugin_dir_path( JOINCHAT_FILE ) );
32
  define( 'JOINCHAT_BASENAME', plugin_basename( JOINCHAT_FILE ) );
languages/creame-whatsapp-me.pot CHANGED
@@ -2,7 +2,7 @@
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Joinchat 4.5.10\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/creame-whatsapp-me\n"
7
  "Last-Translator: Pacotoleo <pacotole@crea.me>\n"
8
  "Language-Team: Creame <hola@crea.me>\n"
2
  # This file is distributed under the GPL-2.0+.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Joinchat 4.5.11\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/creame-whatsapp-me\n"
7
  "Last-Translator: Pacotoleo <pacotole@crea.me>\n"
8
  "Language-Team: Creame <hola@crea.me>\n"
public/css/joinchat-btn.css CHANGED
@@ -15,7 +15,6 @@
15
  bottom: var(--bottom);
16
  font: normal normal normal 16px/1.625em var(--joinchat-font);
17
  letter-spacing: 0;
18
- -webkit-animation: joinchat_show 500ms cubic-bezier(0.18, 0.89, 0.32, 1.28) 10ms both;
19
  animation: joinchat_show 500ms cubic-bezier(0.18, 0.89, 0.32, 1.28) 10ms both;
20
  transform: scale3d(0, 0, 0);
21
  transform-origin: calc(var(--s)/-2) calc(var(--s)/-4);
@@ -44,7 +43,6 @@
44
  }
45
 
46
  .joinchat--noanim {
47
- -webkit-animation: none;
48
  animation: none;
49
  }
50
 
@@ -107,13 +105,11 @@
107
  }
108
 
109
  .joinchat--show .joinchat__button__image {
110
- -webkit-animation: joinchat_image_loop 20s linear 5s infinite normal both;
111
  animation: joinchat_image_loop 20s linear 5s infinite normal both;
112
  }
113
 
114
  .joinchat--image .joinchat__button__image {
115
  opacity: 1;
116
- -webkit-animation: none;
117
  animation: none;
118
  }
119
 
@@ -153,7 +149,6 @@
153
  }
154
 
155
  .joinchat--tooltip .joinchat__tooltip {
156
- -webkit-animation: joinchat_tootlip 20s linear 5s 1 normal both;
157
  animation: joinchat_tootlip 20s linear 5s 1 normal both;
158
  }
159
 
@@ -186,7 +181,6 @@
186
  text-align: center;
187
  white-space: nowrap;
188
  filter: drop-shadow(0 1px 4px rgba(0,0,0, 0.4));
189
- -webkit-animation: joinchat_badge_in 400ms cubic-bezier(0.11, 0.84, 0.83, 1.01) 300ms both;
190
  animation: joinchat_badge_in 400ms cubic-bezier(0.11, 0.84, 0.83, 1.01) 300ms both;
191
  pointer-events: none;
192
  }
@@ -226,16 +220,6 @@
226
  margin: 0;
227
  }
228
 
229
- @-webkit-keyframes joinchat_show {
230
- from {
231
- transform: scale3d(0, 0, 0);
232
- }
233
-
234
- to {
235
- transform: scale3d(1, 1, 1);
236
- }
237
- }
238
-
239
  @keyframes joinchat_show {
240
  from {
241
  transform: scale3d(0, 0, 0);
@@ -246,18 +230,6 @@
246
  }
247
  }
248
 
249
- @-webkit-keyframes joinchat_badge_in {
250
- from {
251
- opacity: 0;
252
- transform: translate3d(0, 50px, 0);
253
- }
254
-
255
- to {
256
- opacity: 1;
257
- transform: translate3d(0, 0, 0);
258
- }
259
- }
260
-
261
  @keyframes joinchat_badge_in {
262
  from {
263
  opacity: 0;
@@ -270,22 +242,6 @@
270
  }
271
  }
272
 
273
- @-webkit-keyframes joinchat_image_loop {
274
- 0% {
275
- opacity: 0;
276
- }
277
-
278
- 3%,
279
- 20% {
280
- opacity: 1;
281
- }
282
-
283
- 25%,
284
- 100% {
285
- opacity: 0;
286
- }
287
- }
288
-
289
  @keyframes joinchat_image_loop {
290
  0% {
291
  opacity: 0;
@@ -302,25 +258,6 @@
302
  }
303
  }
304
 
305
- @-webkit-keyframes joinchat_tootlip {
306
- 0% {
307
- opacity: 0;
308
- transform: scale3d(1, 0, 1);
309
- }
310
-
311
- 1%,
312
- 20% {
313
- opacity: 1;
314
- transform: scale3d(1, 1, 1);
315
- }
316
-
317
- 25%,
318
- 100% {
319
- opacity: 0;
320
- transform: scale3d(1, 1, 1);
321
- }
322
- }
323
-
324
  @keyframes joinchat_tootlip {
325
  0% {
326
  opacity: 0;
@@ -394,7 +331,6 @@
394
  @media (hover: hover) {
395
  .joinchat__button:hover .joinchat__tooltip {
396
  opacity: 1;
397
- -webkit-animation: none;
398
  animation: none;
399
  transition: opacity 0.2s;
400
  }
@@ -405,7 +341,6 @@
405
 
406
  @media (prefers-reduced-motion) {
407
  .joinchat {
408
- -webkit-animation: none;
409
  animation: none;
410
  }
411
  }
15
  bottom: var(--bottom);
16
  font: normal normal normal 16px/1.625em var(--joinchat-font);
17
  letter-spacing: 0;
 
18
  animation: joinchat_show 500ms cubic-bezier(0.18, 0.89, 0.32, 1.28) 10ms both;
19
  transform: scale3d(0, 0, 0);
20
  transform-origin: calc(var(--s)/-2) calc(var(--s)/-4);
43
  }
44
 
45
  .joinchat--noanim {
 
46
  animation: none;
47
  }
48
 
105
  }
106
 
107
  .joinchat--show .joinchat__button__image {
 
108
  animation: joinchat_image_loop 20s linear 5s infinite normal both;
109
  }
110
 
111
  .joinchat--image .joinchat__button__image {
112
  opacity: 1;
 
113
  animation: none;
114
  }
115
 
149
  }
150
 
151
  .joinchat--tooltip .joinchat__tooltip {
 
152
  animation: joinchat_tootlip 20s linear 5s 1 normal both;
153
  }
154
 
181
  text-align: center;
182
  white-space: nowrap;
183
  filter: drop-shadow(0 1px 4px rgba(0,0,0, 0.4));
 
184
  animation: joinchat_badge_in 400ms cubic-bezier(0.11, 0.84, 0.83, 1.01) 300ms both;
185
  pointer-events: none;
186
  }
220
  margin: 0;
221
  }
222
 
 
 
 
 
 
 
 
 
 
 
223
  @keyframes joinchat_show {
224
  from {
225
  transform: scale3d(0, 0, 0);
230
  }
231
  }
232
 
 
 
 
 
 
 
 
 
 
 
 
 
233
  @keyframes joinchat_badge_in {
234
  from {
235
  opacity: 0;
242
  }
243
  }
244
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
245
  @keyframes joinchat_image_loop {
246
  0% {
247
  opacity: 0;
258
  }
259
  }
260
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  @keyframes joinchat_tootlip {
262
  0% {
263
  opacity: 0;
331
  @media (hover: hover) {
332
  .joinchat__button:hover .joinchat__tooltip {
333
  opacity: 1;
 
334
  animation: none;
335
  transition: opacity 0.2s;
336
  }
341
 
342
  @media (prefers-reduced-motion) {
343
  .joinchat {
 
344
  animation: none;
345
  }
346
  }
public/css/joinchat.css CHANGED
@@ -30,7 +30,6 @@
30
  bottom: var(--bottom);
31
  font: normal normal normal 16px/1.625em var(--joinchat-font);
32
  letter-spacing: 0;
33
- -webkit-animation: joinchat_show 500ms cubic-bezier(0.18, 0.89, 0.32, 1.28) 10ms both;
34
  animation: joinchat_show 500ms cubic-bezier(0.18, 0.89, 0.32, 1.28) 10ms both;
35
  transform: scale3d(0, 0, 0);
36
  transform-origin: calc(var(--s)/-2) calc(var(--s)/-4);
@@ -63,13 +62,11 @@
63
  }
64
 
65
  .joinchat--noanim {
66
- -webkit-animation: none;
67
  animation: none;
68
  }
69
 
70
  .joinchat--chatbox:not(.joinchat--noanim) {
71
  transform-origin: 0 0;
72
- -webkit-animation-timing-function: ease-in-out;
73
  animation-timing-function: ease-in-out;
74
  }
75
 
@@ -144,12 +141,10 @@
144
 
145
  .joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__plain {
146
  stroke-dasharray: 0;
147
- -webkit-animation: none;
148
  animation: none;
149
  }
150
 
151
  .joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__chat {
152
- -webkit-animation: none;
153
  animation: none;
154
  }
155
 
@@ -186,13 +181,11 @@
186
  }
187
 
188
  .joinchat--show .joinchat__button__image {
189
- -webkit-animation: joinchat_image_loop 20s linear 5s infinite normal both;
190
  animation: joinchat_image_loop 20s linear 5s infinite normal both;
191
  }
192
 
193
  .joinchat--image .joinchat__button__image {
194
  opacity: 1;
195
- -webkit-animation: none;
196
  animation: none;
197
  }
198
 
@@ -223,14 +216,12 @@
223
  .joinchat__button__send .joinchat_svg__plain {
224
  stroke-dasharray: 1097;
225
  stroke-dashoffset: 1097;
226
- -webkit-animation: joinchat_plain 6s 0.2s ease-in-out infinite;
227
  animation: joinchat_plain 6s 0.2s ease-in-out infinite;
228
  }
229
 
230
  .joinchat__button__send .joinchat_svg__chat {
231
  stroke-dasharray: 1020;
232
  stroke-dashoffset: 1020;
233
- -webkit-animation: joinchat_chat 6s 3.2s ease-in-out infinite;
234
  animation: joinchat_chat 6s 3.2s ease-in-out infinite;
235
  }
236
 
@@ -277,12 +268,10 @@
277
  }
278
 
279
  .joinchat__badge.joinchat__badge--in {
280
- -webkit-animation: joinchat_badge_in 500ms cubic-bezier(0.27, 0.9, 0.41, 1.28) 1 both;
281
  animation: joinchat_badge_in 500ms cubic-bezier(0.27, 0.9, 0.41, 1.28) 1 both;
282
  }
283
 
284
  .joinchat__badge.joinchat__badge--out {
285
- -webkit-animation: joinchat_badge_out 400ms cubic-bezier(0.215, 0.61, 0.355, 1) 1 both;
286
  animation: joinchat_badge_out 400ms cubic-bezier(0.215, 0.61, 0.355, 1) 1 both;
287
  }
288
 
@@ -322,7 +311,6 @@
322
  }
323
 
324
  .joinchat--tooltip .joinchat__tooltip {
325
- -webkit-animation: joinchat_tootlip 20s linear 5s 1 normal both;
326
  animation: joinchat_tootlip 20s linear 5s 1 normal both;
327
  }
328
 
@@ -359,7 +347,6 @@
359
  text-align: center;
360
  white-space: nowrap;
361
  filter: drop-shadow(0 1px 4px rgba(0,0,0, 0.4));
362
- -webkit-animation: joinchat_badge_in 400ms cubic-bezier(0.11, 0.84, 0.83, 1.01) 300ms both;
363
  animation: joinchat_badge_in 400ms cubic-bezier(0.11, 0.84, 0.83, 1.01) 300ms both;
364
  pointer-events: none;
365
  }
@@ -683,16 +670,6 @@
683
  color: #d8d8d8;
684
  }
685
 
686
- @-webkit-keyframes joinchat_show {
687
- from {
688
- transform: scale3d(0, 0, 0);
689
- }
690
-
691
- to {
692
- transform: scale3d(1, 1, 1);
693
- }
694
- }
695
-
696
  @keyframes joinchat_show {
697
  from {
698
  transform: scale3d(0, 0, 0);
@@ -703,18 +680,6 @@
703
  }
704
  }
705
 
706
- @-webkit-keyframes joinchat_badge_in {
707
- from {
708
- opacity: 0;
709
- transform: translate3d(0, 50px, 0);
710
- }
711
-
712
- to {
713
- opacity: 1;
714
- transform: translate3d(0, 0, 0);
715
- }
716
- }
717
-
718
  @keyframes joinchat_badge_in {
719
  from {
720
  opacity: 0;
@@ -727,18 +692,6 @@
727
  }
728
  }
729
 
730
- @-webkit-keyframes joinchat_badge_out {
731
- from {
732
- opacity: 1;
733
- transform: translate3d(0, 0, 0);
734
- }
735
-
736
- to {
737
- opacity: 0;
738
- transform: translate3d(0, -20px, 0);
739
- }
740
- }
741
-
742
  @keyframes joinchat_badge_out {
743
  from {
744
  opacity: 1;
@@ -751,19 +704,6 @@
751
  }
752
  }
753
 
754
- @-webkit-keyframes joinchat_plain {
755
- 0%,
756
- 50%,
757
- 100% {
758
- stroke-dashoffset: 1097;
759
- }
760
-
761
- 5%,
762
- 45% {
763
- stroke-dashoffset: 0;
764
- }
765
- }
766
-
767
  @keyframes joinchat_plain {
768
  0%,
769
  50%,
@@ -777,19 +717,6 @@
777
  }
778
  }
779
 
780
- @-webkit-keyframes joinchat_chat {
781
- 0%,
782
- 50%,
783
- 100% {
784
- stroke-dashoffset: 1020;
785
- }
786
-
787
- 5%,
788
- 45% {
789
- stroke-dashoffset: 0;
790
- }
791
- }
792
-
793
  @keyframes joinchat_chat {
794
  0%,
795
  50%,
@@ -803,22 +730,6 @@
803
  }
804
  }
805
 
806
- @-webkit-keyframes joinchat_image_loop {
807
- 0% {
808
- opacity: 0;
809
- }
810
-
811
- 3%,
812
- 20% {
813
- opacity: 1;
814
- }
815
-
816
- 25%,
817
- 100% {
818
- opacity: 0;
819
- }
820
- }
821
-
822
  @keyframes joinchat_image_loop {
823
  0% {
824
  opacity: 0;
@@ -835,25 +746,6 @@
835
  }
836
  }
837
 
838
- @-webkit-keyframes joinchat_tootlip {
839
- 0% {
840
- opacity: 0;
841
- transform: scale3d(1, 0, 1);
842
- }
843
-
844
- 1%,
845
- 20% {
846
- opacity: 1;
847
- transform: scale3d(1, 1, 1);
848
- }
849
-
850
- 25%,
851
- 100% {
852
- opacity: 0;
853
- transform: scale3d(1, 1, 1);
854
- }
855
- }
856
-
857
  @keyframes joinchat_tootlip {
858
  0% {
859
  opacity: 0;
@@ -944,7 +836,6 @@
944
  @media (hover: hover) {
945
  .joinchat__button:hover .joinchat__tooltip {
946
  opacity: 1;
947
- -webkit-animation: none;
948
  animation: none;
949
  transition: opacity 0.2s;
950
  }
@@ -976,17 +867,14 @@
976
 
977
  @media (prefers-reduced-motion) {
978
  .joinchat {
979
- -webkit-animation: none;
980
  animation: none;
981
  }
982
  .joinchat__button__send .joinchat_svg__plain {
983
  stroke-dasharray: 0;
984
- -webkit-animation: none;
985
  animation: none;
986
  }
987
 
988
  .joinchat__button__send .joinchat_svg__chat {
989
- -webkit-animation: none;
990
  animation: none;
991
  }
992
  .joinchat__button__sendtext {
30
  bottom: var(--bottom);
31
  font: normal normal normal 16px/1.625em var(--joinchat-font);
32
  letter-spacing: 0;
 
33
  animation: joinchat_show 500ms cubic-bezier(0.18, 0.89, 0.32, 1.28) 10ms both;
34
  transform: scale3d(0, 0, 0);
35
  transform-origin: calc(var(--s)/-2) calc(var(--s)/-4);
62
  }
63
 
64
  .joinchat--noanim {
 
65
  animation: none;
66
  }
67
 
68
  .joinchat--chatbox:not(.joinchat--noanim) {
69
  transform-origin: 0 0;
 
70
  animation-timing-function: ease-in-out;
71
  }
72
 
141
 
142
  .joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__plain {
143
  stroke-dasharray: 0;
 
144
  animation: none;
145
  }
146
 
147
  .joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__chat {
 
148
  animation: none;
149
  }
150
 
181
  }
182
 
183
  .joinchat--show .joinchat__button__image {
 
184
  animation: joinchat_image_loop 20s linear 5s infinite normal both;
185
  }
186
 
187
  .joinchat--image .joinchat__button__image {
188
  opacity: 1;
 
189
  animation: none;
190
  }
191
 
216
  .joinchat__button__send .joinchat_svg__plain {
217
  stroke-dasharray: 1097;
218
  stroke-dashoffset: 1097;
 
219
  animation: joinchat_plain 6s 0.2s ease-in-out infinite;
220
  }
221
 
222
  .joinchat__button__send .joinchat_svg__chat {
223
  stroke-dasharray: 1020;
224
  stroke-dashoffset: 1020;
 
225
  animation: joinchat_chat 6s 3.2s ease-in-out infinite;
226
  }
227
 
268
  }
269
 
270
  .joinchat__badge.joinchat__badge--in {
 
271
  animation: joinchat_badge_in 500ms cubic-bezier(0.27, 0.9, 0.41, 1.28) 1 both;
272
  }
273
 
274
  .joinchat__badge.joinchat__badge--out {
 
275
  animation: joinchat_badge_out 400ms cubic-bezier(0.215, 0.61, 0.355, 1) 1 both;
276
  }
277
 
311
  }
312
 
313
  .joinchat--tooltip .joinchat__tooltip {
 
314
  animation: joinchat_tootlip 20s linear 5s 1 normal both;
315
  }
316
 
347
  text-align: center;
348
  white-space: nowrap;
349
  filter: drop-shadow(0 1px 4px rgba(0,0,0, 0.4));
 
350
  animation: joinchat_badge_in 400ms cubic-bezier(0.11, 0.84, 0.83, 1.01) 300ms both;
351
  pointer-events: none;
352
  }
670
  color: #d8d8d8;
671
  }
672
 
 
 
 
 
 
 
 
 
 
 
673
  @keyframes joinchat_show {
674
  from {
675
  transform: scale3d(0, 0, 0);
680
  }
681
  }
682
 
 
 
 
 
 
 
 
 
 
 
 
 
683
  @keyframes joinchat_badge_in {
684
  from {
685
  opacity: 0;
692
  }
693
  }
694
 
 
 
 
 
 
 
 
 
 
 
 
 
695
  @keyframes joinchat_badge_out {
696
  from {
697
  opacity: 1;
704
  }
705
  }
706
 
 
 
 
 
 
 
 
 
 
 
 
 
 
707
  @keyframes joinchat_plain {
708
  0%,
709
  50%,
717
  }
718
  }
719
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  @keyframes joinchat_chat {
721
  0%,
722
  50%,
730
  }
731
  }
732
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
733
  @keyframes joinchat_image_loop {
734
  0% {
735
  opacity: 0;
746
  }
747
  }
748
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
749
  @keyframes joinchat_tootlip {
750
  0% {
751
  opacity: 0;
836
  @media (hover: hover) {
837
  .joinchat__button:hover .joinchat__tooltip {
838
  opacity: 1;
 
839
  animation: none;
840
  transition: opacity 0.2s;
841
  }
867
 
868
  @media (prefers-reduced-motion) {
869
  .joinchat {
 
870
  animation: none;
871
  }
872
  .joinchat__button__send .joinchat_svg__plain {
873
  stroke-dasharray: 0;
 
874
  animation: none;
875
  }
876
 
877
  .joinchat__button__send .joinchat_svg__chat {
 
878
  animation: none;
879
  }
880
  .joinchat__button__sendtext {
public/js/joinchat.js CHANGED
@@ -7,7 +7,9 @@
7
  store: null,
8
  chatbox: false,
9
  showed_at: 0,
 
10
  is_mobile: !!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),
 
11
  }, win.joinchat_obj || {});
12
 
13
  joinchat_obj.$ = function (sel) {
@@ -270,7 +272,7 @@
270
  // Ensure header is visible
271
  $(win).on('resize', function () {
272
  clearTimeout(timeoutResize);
273
- timeoutResize = setTimeout(function () { joinchat_obj.$div[0].style.setProperty('--vh', window.innerHeight + 'px'); }, 200);
274
  }).trigger('resize');
275
  }
276
 
@@ -308,7 +310,7 @@
308
  }
309
 
310
  // Add QR Code
311
- if (joinchat_obj.settings.qr && !joinchat_obj.is_mobile && typeof kjua == 'function') {
312
  joinchat_obj.$('.joinchat__qr').kjua({
313
  text: joinchat_obj.whatsapp_link(undefined, undefined, false),
314
  render: 'canvas',
@@ -324,6 +326,7 @@
324
  }
325
 
326
  $(doc).trigger('joinchat:start');
 
327
  }
328
 
329
  // Simple run only once wrapper
@@ -382,7 +385,7 @@
382
  }
383
 
384
  // Gutenberg buttons add QR
385
- if (typeof kjua == 'function' && !joinchat_obj.is_mobile) {
386
  $('.joinchat-button__qr').each(function () {
387
  $(this).kjua({
388
  text: joinchat_obj.whatsapp_link($(this).data('phone'), $(this).data('message'), false),
7
  store: null,
8
  chatbox: false,
9
  showed_at: 0,
10
+ is_ready: false, // Change to true when Joinchat ends initialization
11
  is_mobile: !!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),
12
+ is_qr: typeof kjua == 'function',
13
  }, win.joinchat_obj || {});
14
 
15
  joinchat_obj.$ = function (sel) {
272
  // Ensure header is visible
273
  $(win).on('resize', function () {
274
  clearTimeout(timeoutResize);
275
+ timeoutResize = setTimeout(function () { joinchat_obj.$div[0].style.setProperty('--vh', win.innerHeight + 'px'); }, 200);
276
  }).trigger('resize');
277
  }
278
 
310
  }
311
 
312
  // Add QR Code
313
+ if (joinchat_obj.settings.qr && joinchat_obj.is_qr && !joinchat_obj.is_mobile) {
314
  joinchat_obj.$('.joinchat__qr').kjua({
315
  text: joinchat_obj.whatsapp_link(undefined, undefined, false),
316
  render: 'canvas',
326
  }
327
 
328
  $(doc).trigger('joinchat:start');
329
+ joinchat_obj.is_ready = true;
330
  }
331
 
332
  // Simple run only once wrapper
385
  }
386
 
387
  // Gutenberg buttons add QR
388
+ if (joinchat_obj.is_qr && !joinchat_obj.is_mobile) {
389
  $('.joinchat-button__qr').each(function () {
390
  $(this).kjua({
391
  text: joinchat_obj.whatsapp_link($(this).data('phone'), $(this).data('message'), false),
public/js/joinchat.min.js CHANGED
@@ -1 +1 @@
1
- !function(d,p,u){"use strict";function t(){d(u).trigger("joinchat:starting");var t,e,o=1e3*joinchat_obj.settings.button_delay,n=1e3*joinchat_obj.settings.message_delay,a=!!joinchat_obj.settings.message_hash,i=!!joinchat_obj.$(".joinchat__box").length,s=parseInt(joinchat_obj.store.getItem("joinchat_views")||1)>=joinchat_obj.settings.message_views,h=-1!==(joinchat_obj.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean).indexOf(joinchat_obj.settings.message_hash||"none");function c(){clearTimeout(e),joinchat_obj.chatbox_show()}function _(){joinchat_obj.save_hash(),joinchat_obj.chatbox_hide()}var j,r,l,b="joinchat--show";function g(){var t=(u.activeElement.type||"").toLowerCase();0<=["date","datetime","email","month","number","password","search","tel","text","textarea","time","url","week"].indexOf(t)?joinchat_obj.chatbox?(joinchat_obj.chatbox_hide(),setTimeout(function(){joinchat_obj.$div.removeClass("joinchat--show")},400)):joinchat_obj.$div.removeClass("joinchat--show"):joinchat_obj.$div.addClass("joinchat--show")}h||a&&n&&!joinchat_obj.settings.message_badge&&s||(b+=" joinchat--tooltip"),setTimeout(function(){joinchat_obj.$div.addClass(b)},o),a&&!h&&n&&(joinchat_obj.settings.message_badge?e=setTimeout(function(){joinchat_obj.$(".joinchat__badge").addClass("joinchat__badge--in")},o+n):s&&(e=setTimeout(c,o+n))),i&&!joinchat_obj.is_mobile&&joinchat_obj.$(".joinchat__button").on("mouseenter",function(){t=setTimeout(c,1500)}).on("mouseleave",function(){clearTimeout(t)}),joinchat_obj.$(".joinchat__button").on("click",function(){i&&!joinchat_obj.chatbox?c():Date.now()>joinchat_obj.showed_at+600&&(_(),joinchat_obj.open_whatsapp())}),joinchat_obj.$(".joinchat__close").on("click",_),joinchat_obj.$("#joinchat_optin").on("change",function(){joinchat_obj.$div.toggleClass("joinchat--optout",!this.checked)}),joinchat_obj.$(".joinchat__box__scroll").on("mousewheel DOMMouseScroll",function(t){t.preventDefault();t=t.originalEvent.wheelDelta||-t.originalEvent.detail;this.scrollTop+=30*(t<0?1:-1)}),joinchat_obj.is_mobile&&(d(u).on("focus blur","input, textarea",function(t){d(t.target).closest(joinchat_obj.$div).length||(clearTimeout(j),j=setTimeout(g,200))}),d(p).on("resize",function(){clearTimeout(r),r=setTimeout(function(){joinchat_obj.$div[0].style.setProperty("--vh",window.innerHeight+"px")},200)}).trigger("resize")),d(u).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),i&&d(this).is('.joinchat_open, a[href="#joinchat"]')?c():joinchat_obj.open_whatsapp(d(this).data("phone"),d(this).data("message"))}),d(u).on("click",".joinchat_close",function(t){t.preventDefault(),joinchat_obj.chatbox_hide()}),i&&"IntersectionObserver"in p&&(0<(a=d(".joinchat_show, .joinchat_force_show")).length&&(l=new IntersectionObserver(function(t){d.each(t,function(){if(0<this.intersectionRatio&&(!h||d(this.target).hasClass("joinchat_force_show")))return c(),l.disconnect(),!1})}),a.each(function(){l.observe(this)}))),joinchat_obj.settings.qr&&!joinchat_obj.is_mobile&&"function"==typeof kjua?joinchat_obj.$(".joinchat__qr").kjua({text:joinchat_obj.whatsapp_link(void 0,void 0,!1),render:"canvas",rounded:80}):joinchat_obj.$(".joinchat__qr").remove(),i&&joinchat_obj.$div.css("--peak","url(#joinchat__message__peak)"),d(u).trigger("joinchat:start")}p.joinchat_obj=d.extend({$div:null,settings:null,store:null,chatbox:!1,showed_at:0,is_mobile:!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i)},p.joinchat_obj||{}),joinchat_obj.$=function(t){return d(t||this.$div,this.$div)},joinchat_obj.send_event=function(o){var t,e,n,a;(o=d.extend({event_category:"JoinChat",event_label:"",event_action:"",chat_channel:"whatsapp",chat_id:"--",is_mobile:this.is_mobile?"yes":"no",page_location:location.href,page_title:document.title||"no title"},o)).event_label=o.event_label||o.link||"",o.event_action=o.event_action||o.chat_channel+": "+o.chat_id,delete o.link,!1!==d(u).triggerHandler("joinchat:event",[o])&&(a=p[this.settings.ga_tracker]||p.ga||p.__gaTracker,t=p[this.settings.data_layer]||p[p.gtm4wp_datalayer_name]||p.dataLayer,"function"==typeof a&&"function"==typeof a.getAll&&(a("set","transport","beacon"),a.getAll().forEach(function(t){t.send("event",o.event_category,o.event_action,o.event_label)})),d.each(o,function(t,e){o[t]="string"==typeof e?e.substring(0,100):e}),"function"==typeof gtag&&"object"==typeof t&&(e=this.settings.ga_event||"generate_lead",delete(n=d.extend({transport_type:"beacon"},o)).page_location,delete n.page_title,t.forEach(function(t){"config"==t[0]&&t[1]&&"G-"==t[1].substring(0,2)&&(n.send_to=t[1],gtag("event",e,n))}),this.settings.gads&&gtag("event","conversion",{send_to:this.settings.gads})),a=o.event_category,delete o.event_category,"object"==typeof t&&t.push(d.extend({event:a},o)),"function"==typeof fbq&&fbq("trackCustom",a,o))},joinchat_obj.whatsapp_link=function(t,e,o){return e=void 0!==e?e:this.settings.message_send||"",((o=void 0!==o?o:this.settings.whatsapp_web&&!this.is_mobile)?"https://web.whatsapp.com/send?phone=":"https://wa.me/")+encodeURIComponent(t||this.settings.telephone)+(e?(o?"&text=":"?text=")+encodeURIComponent(e):"")},joinchat_obj.chatbox_show=function(){this.chatbox||(this.chatbox=!0,this.showed_at=Date.now(),this.$div.addClass("joinchat--chatbox"),this.settings.message_badge&&this.$(".joinchat__badge").hasClass("joinchat__badge--in")&&this.$(".joinchat__badge").toggleClass("joinchat__badge--in joinchat__badge--out"),d(u).trigger("joinchat:show"))},joinchat_obj.chatbox_hide=function(){this.chatbox&&(this.chatbox=!1,this.$div.removeClass("joinchat--chatbox joinchat--tooltip"),this.settings.message_badge&&this.$(".joinchat__badge").removeClass("joinchat__badge--out"),d(u).trigger("joinchat:hide"))},joinchat_obj.save_hash=function(){var t=this.settings.message_hash||"none",e=(this.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean);-1===e.indexOf(t)&&(e.push(t),this.store.setItem("joinchat_hashes",e.join(",")))},joinchat_obj.open_whatsapp=function(t,e){t=t||this.settings.telephone,e=void 0!==e?e:this.settings.message_send||"";t={link:this.whatsapp_link(t,e),chat_channel:"whatsapp",chat_id:t,chat_message:e},e=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");!1!==d(u).triggerHandler("joinchat:open",[t])&&(e.test(t.link)?(this.send_event(t),p.open(t.link,"joinchat","noopener")):console.error("Joinchat: the link doesn't seem safe, it must point to the current domain or whatsapp.com"))};function e(){o&&o.apply(this,arguments),o=null}var o;o=function(){if(joinchat_obj.$div=d(".joinchat"),joinchat_obj.$div.length){joinchat_obj.settings=joinchat_obj.$div.data("settings");try{localStorage.setItem("test",1),localStorage.removeItem("test"),joinchat_obj.store=localStorage}catch(t){joinchat_obj.store={_data:{},setItem:function(t,e){this._data[t]=String(e)},getItem:function(t){return this._data.hasOwnProperty(t)?this._data[t]:null}}}if("object"!=typeof joinchat_obj.settings)try{joinchat_obj.settings=JSON.parse(joinchat_obj.$div.attr("data-settings"))}catch(t){joinchat_obj.settings=void 0,console.error("Joinchat: can't get settings")}joinchat_obj.settings&&joinchat_obj.settings.telephone&&(joinchat_obj.is_mobile||!joinchat_obj.settings.mobile_only?t():(joinchat_obj.$div.removeClass("joinchat--show"),d(u).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),joinchat_obj.open_whatsapp(d(this).data("phone"),d(this).data("message"))})),"function"!=typeof kjua||joinchat_obj.is_mobile?d(".wp-block-joinchat-button figure").remove():d(".joinchat-button__qr").each(function(){d(this).kjua({text:joinchat_obj.whatsapp_link(d(this).data("phone"),d(this).data("message"),!1),render:"canvas",rounded:80})})),joinchat_obj.store.setItem("joinchat_views",parseInt(joinchat_obj.store.getItem("joinchat_views")||0)+1)}};d(e),d(p).on("load",e),u.addEventListener("DOMContentLoaded",e)}(jQuery,window,document);
1
+ !function(d,p,u){"use strict";function t(){d(u).trigger("joinchat:starting");var t,e,o=1e3*joinchat_obj.settings.button_delay,n=1e3*joinchat_obj.settings.message_delay,a=!!joinchat_obj.settings.message_hash,i=!!joinchat_obj.$(".joinchat__box").length,s=parseInt(joinchat_obj.store.getItem("joinchat_views")||1)>=joinchat_obj.settings.message_views,h=-1!==(joinchat_obj.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean).indexOf(joinchat_obj.settings.message_hash||"none");function c(){clearTimeout(e),joinchat_obj.chatbox_show()}function _(){joinchat_obj.save_hash(),joinchat_obj.chatbox_hide()}var j,r,l,b="joinchat--show";function g(){var t=(u.activeElement.type||"").toLowerCase();0<=["date","datetime","email","month","number","password","search","tel","text","textarea","time","url","week"].indexOf(t)?joinchat_obj.chatbox?(joinchat_obj.chatbox_hide(),setTimeout(function(){joinchat_obj.$div.removeClass("joinchat--show")},400)):joinchat_obj.$div.removeClass("joinchat--show"):joinchat_obj.$div.addClass("joinchat--show")}h||a&&n&&!joinchat_obj.settings.message_badge&&s||(b+=" joinchat--tooltip"),setTimeout(function(){joinchat_obj.$div.addClass(b)},o),a&&!h&&n&&(joinchat_obj.settings.message_badge?e=setTimeout(function(){joinchat_obj.$(".joinchat__badge").addClass("joinchat__badge--in")},o+n):s&&(e=setTimeout(c,o+n))),i&&!joinchat_obj.is_mobile&&joinchat_obj.$(".joinchat__button").on("mouseenter",function(){t=setTimeout(c,1500)}).on("mouseleave",function(){clearTimeout(t)}),joinchat_obj.$(".joinchat__button").on("click",function(){i&&!joinchat_obj.chatbox?c():Date.now()>joinchat_obj.showed_at+600&&(_(),joinchat_obj.open_whatsapp())}),joinchat_obj.$(".joinchat__close").on("click",_),joinchat_obj.$("#joinchat_optin").on("change",function(){joinchat_obj.$div.toggleClass("joinchat--optout",!this.checked)}),joinchat_obj.$(".joinchat__box__scroll").on("mousewheel DOMMouseScroll",function(t){t.preventDefault();t=t.originalEvent.wheelDelta||-t.originalEvent.detail;this.scrollTop+=30*(t<0?1:-1)}),joinchat_obj.is_mobile&&(d(u).on("focus blur","input, textarea",function(t){d(t.target).closest(joinchat_obj.$div).length||(clearTimeout(j),j=setTimeout(g,200))}),d(p).on("resize",function(){clearTimeout(r),r=setTimeout(function(){joinchat_obj.$div[0].style.setProperty("--vh",p.innerHeight+"px")},200)}).trigger("resize")),d(u).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),i&&d(this).is('.joinchat_open, a[href="#joinchat"]')?c():joinchat_obj.open_whatsapp(d(this).data("phone"),d(this).data("message"))}),d(u).on("click",".joinchat_close",function(t){t.preventDefault(),joinchat_obj.chatbox_hide()}),i&&"IntersectionObserver"in p&&(0<(a=d(".joinchat_show, .joinchat_force_show")).length&&(l=new IntersectionObserver(function(t){d.each(t,function(){if(0<this.intersectionRatio&&(!h||d(this.target).hasClass("joinchat_force_show")))return c(),l.disconnect(),!1})}),a.each(function(){l.observe(this)}))),joinchat_obj.settings.qr&&joinchat_obj.is_qr&&!joinchat_obj.is_mobile?joinchat_obj.$(".joinchat__qr").kjua({text:joinchat_obj.whatsapp_link(void 0,void 0,!1),render:"canvas",rounded:80}):joinchat_obj.$(".joinchat__qr").remove(),i&&joinchat_obj.$div.css("--peak","url(#joinchat__message__peak)"),d(u).trigger("joinchat:start"),joinchat_obj.is_ready=!0}p.joinchat_obj=d.extend({$div:null,settings:null,store:null,chatbox:!1,showed_at:0,is_ready:!1,is_mobile:!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),is_qr:"function"==typeof kjua},p.joinchat_obj||{}),joinchat_obj.$=function(t){return d(t||this.$div,this.$div)},joinchat_obj.send_event=function(o){var t,e,n,a;(o=d.extend({event_category:"JoinChat",event_label:"",event_action:"",chat_channel:"whatsapp",chat_id:"--",is_mobile:this.is_mobile?"yes":"no",page_location:location.href,page_title:document.title||"no title"},o)).event_label=o.event_label||o.link||"",o.event_action=o.event_action||o.chat_channel+": "+o.chat_id,delete o.link,!1!==d(u).triggerHandler("joinchat:event",[o])&&(a=p[this.settings.ga_tracker]||p.ga||p.__gaTracker,t=p[this.settings.data_layer]||p[p.gtm4wp_datalayer_name]||p.dataLayer,"function"==typeof a&&"function"==typeof a.getAll&&(a("set","transport","beacon"),a.getAll().forEach(function(t){t.send("event",o.event_category,o.event_action,o.event_label)})),d.each(o,function(t,e){o[t]="string"==typeof e?e.substring(0,100):e}),"function"==typeof gtag&&"object"==typeof t&&(e=this.settings.ga_event||"generate_lead",delete(n=d.extend({transport_type:"beacon"},o)).page_location,delete n.page_title,t.forEach(function(t){"config"==t[0]&&t[1]&&"G-"==t[1].substring(0,2)&&(n.send_to=t[1],gtag("event",e,n))}),this.settings.gads&&gtag("event","conversion",{send_to:this.settings.gads})),a=o.event_category,delete o.event_category,"object"==typeof t&&t.push(d.extend({event:a},o)),"function"==typeof fbq&&fbq("trackCustom",a,o))},joinchat_obj.whatsapp_link=function(t,e,o){return e=void 0!==e?e:this.settings.message_send||"",((o=void 0!==o?o:this.settings.whatsapp_web&&!this.is_mobile)?"https://web.whatsapp.com/send?phone=":"https://wa.me/")+encodeURIComponent(t||this.settings.telephone)+(e?(o?"&text=":"?text=")+encodeURIComponent(e):"")},joinchat_obj.chatbox_show=function(){this.chatbox||(this.chatbox=!0,this.showed_at=Date.now(),this.$div.addClass("joinchat--chatbox"),this.settings.message_badge&&this.$(".joinchat__badge").hasClass("joinchat__badge--in")&&this.$(".joinchat__badge").toggleClass("joinchat__badge--in joinchat__badge--out"),d(u).trigger("joinchat:show"))},joinchat_obj.chatbox_hide=function(){this.chatbox&&(this.chatbox=!1,this.$div.removeClass("joinchat--chatbox joinchat--tooltip"),this.settings.message_badge&&this.$(".joinchat__badge").removeClass("joinchat__badge--out"),d(u).trigger("joinchat:hide"))},joinchat_obj.save_hash=function(){var t=this.settings.message_hash||"none",e=(this.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean);-1===e.indexOf(t)&&(e.push(t),this.store.setItem("joinchat_hashes",e.join(",")))},joinchat_obj.open_whatsapp=function(t,e){t=t||this.settings.telephone,e=void 0!==e?e:this.settings.message_send||"";t={link:this.whatsapp_link(t,e),chat_channel:"whatsapp",chat_id:t,chat_message:e},e=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");!1!==d(u).triggerHandler("joinchat:open",[t])&&(e.test(t.link)?(this.send_event(t),p.open(t.link,"joinchat","noopener")):console.error("Joinchat: the link doesn't seem safe, it must point to the current domain or whatsapp.com"))};function e(){o&&o.apply(this,arguments),o=null}var o;o=function(){if(joinchat_obj.$div=d(".joinchat"),joinchat_obj.$div.length){joinchat_obj.settings=joinchat_obj.$div.data("settings");try{localStorage.setItem("test",1),localStorage.removeItem("test"),joinchat_obj.store=localStorage}catch(t){joinchat_obj.store={_data:{},setItem:function(t,e){this._data[t]=String(e)},getItem:function(t){return this._data.hasOwnProperty(t)?this._data[t]:null}}}if("object"!=typeof joinchat_obj.settings)try{joinchat_obj.settings=JSON.parse(joinchat_obj.$div.attr("data-settings"))}catch(t){joinchat_obj.settings=void 0,console.error("Joinchat: can't get settings")}joinchat_obj.settings&&joinchat_obj.settings.telephone&&(joinchat_obj.is_mobile||!joinchat_obj.settings.mobile_only?t():(joinchat_obj.$div.removeClass("joinchat--show"),d(u).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),joinchat_obj.open_whatsapp(d(this).data("phone"),d(this).data("message"))})),joinchat_obj.is_qr&&!joinchat_obj.is_mobile?d(".joinchat-button__qr").each(function(){d(this).kjua({text:joinchat_obj.whatsapp_link(d(this).data("phone"),d(this).data("message"),!1),render:"canvas",rounded:80})}):d(".wp-block-joinchat-button figure").remove()),joinchat_obj.store.setItem("joinchat_views",parseInt(joinchat_obj.store.getItem("joinchat_views")||0)+1)}};d(e),d(p).on("load",e),u.addEventListener("DOMContentLoaded",e)}(jQuery,window,document);