Version Description
- NEW: GA4 "generate_lead" event can now be changed to a custom event.
- CHANGED default z-index to
9000
for compatibility with major cookies plugins.
Download this release
Release Info
Developer | pacotole |
Plugin | WhatsApp me |
Version | 4.5.10 |
Comparing to | |
See all releases |
Code changes from version 4.5.9 to 4.5.10
- README.txt +8 -3
- admin/class-joinchat-admin-page.php +2 -2
- admin/class-joinchat-admin.php +11 -9
- admin/partials/post-meta-box.php +40 -0
- admin/partials/post_meta_box.php +0 -41
- admin/partials/term-meta-box.php +48 -0
- admin/partials/term_meta_box.php +0 -49
- includes/class-joinchat-common.php +22 -16
- includes/class-joinchat.php +4 -3
- joinchat.php +2 -2
- languages/creame-whatsapp-me.pot +1 -1
- public/class-joinchat-woo-public.php +4 -13
- public/css/joinchat-btn.css +1 -1
- public/css/joinchat-btn.min.css +1 -1
- public/css/joinchat.css +1 -1
- public/css/joinchat.min.css +1 -1
- public/js/joinchat-lite.js +16 -8
- public/js/joinchat-lite.min.js +1 -1
- public/js/joinchat.js +15 -7
- public/js/joinchat.min.js +1 -1
- public/partials/html.php +6 -6
README.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: Chat, Click to Chat, Facebook Messenger, WhatsApp, Telegram, Whatsapp Busi
|
|
5 |
Requires at least: 4.4.0
|
6 |
Tested up to: 6.0
|
7 |
Requires PHP: 5.5
|
8 |
-
Stable tag: 4.5.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -179,7 +179,7 @@ You can change the position of the button so that nothing covers it by adding th
|
|
179 |
|
180 |
`.joinchat { z-index:999999; }`
|
181 |
|
182 |
-
Higher values of z-index are above, the default value is
|
183 |
|
184 |
If you need to move up:
|
185 |
|
@@ -272,10 +272,11 @@ If Universal Analtics (analytics.js) is detected:
|
|
272 |
|
273 |
`ga('send', 'event', 'JoinChat', 'whatsapp: 99999999999', destination_url);`
|
274 |
|
275 |
-
If your site don't have standard names for UA tracker ('ga') or data layer ('dataLayer') you can set your custom names with this filter:
|
276 |
|
277 |
`add_filter( 'joinchat_get_settings', function( $settings ){
|
278 |
$settings['ga_tracker'] = 'gaCustom';
|
|
|
279 |
$settings['data_layer'] = 'dataLayerCustom';
|
280 |
return $settings;
|
281 |
} );`
|
@@ -355,6 +356,10 @@ Joinchat save two localStorage variables for proper operation:
|
|
355 |
|
356 |
== Changelog ==
|
357 |
|
|
|
|
|
|
|
|
|
358 |
= 4.5.9 =
|
359 |
* FIX Product Button should not appear on related products.
|
360 |
|
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 |
|
179 |
|
180 |
`.joinchat { z-index:999999; }`
|
181 |
|
182 |
+
Higher values of z-index are above, the default value is 9000.
|
183 |
|
184 |
If you need to move up:
|
185 |
|
272 |
|
273 |
`ga('send', 'event', 'JoinChat', 'whatsapp: 99999999999', destination_url);`
|
274 |
|
275 |
+
If your site don't have standard names for UA tracker ('ga') or data layer ('dataLayer') you can set your custom names with this PHP filter. Also can set a different event name for GA4:
|
276 |
|
277 |
`add_filter( 'joinchat_get_settings', function( $settings ){
|
278 |
$settings['ga_tracker'] = 'gaCustom';
|
279 |
+
$settings['ga_event'] = 'myGA4Event';
|
280 |
$settings['data_layer'] = 'dataLayerCustom';
|
281 |
return $settings;
|
282 |
} );`
|
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.
|
362 |
+
|
363 |
= 4.5.9 =
|
364 |
* FIX Product Button should not appear on related products.
|
365 |
|
admin/class-joinchat-admin-page.php
CHANGED
@@ -442,7 +442,7 @@ class JoinChatAdminPage {
|
|
442 |
|
443 |
switch ( $field_id ) {
|
444 |
case 'telephone':
|
445 |
-
$output = '<input id="joinchat_phone" ' . ( $this->common->
|
446 |
'<input id="joinchat_phone_test" type="button" value="' . esc_attr__( 'Test Number', 'creame-whatsapp-me' ) . '" class="button" ' . ( empty( $value ) ? 'disabled' : '' ) . '>' .
|
447 |
'<p class="description">' . __( "Contact phone number <strong>(the button will not be shown if it's empty)</strong>", 'creame-whatsapp-me' ) . '</p>' .
|
448 |
'<p class="joinchat-addon">' . sprintf(
|
@@ -760,7 +760,7 @@ class JoinChatAdminPage {
|
|
760 |
wp_enqueue_script( 'joinchat-admin' );
|
761 |
wp_enqueue_style( 'joinchat-admin' );
|
762 |
|
763 |
-
if ( $this->common->
|
764 |
wp_enqueue_style( 'intl-tel-input' );
|
765 |
}
|
766 |
|
442 |
|
443 |
switch ( $field_id ) {
|
444 |
case 'telephone':
|
445 |
+
$output = '<input id="joinchat_phone" ' . ( $this->common->get_intltel() ? 'data-' : '' ) . 'name="joinchat[telephone]" value="' . esc_attr( $value ) . '" type="text" style="width:15em;display:inline-block"> ' .
|
446 |
'<input id="joinchat_phone_test" type="button" value="' . esc_attr__( 'Test Number', 'creame-whatsapp-me' ) . '" class="button" ' . ( empty( $value ) ? 'disabled' : '' ) . '>' .
|
447 |
'<p class="description">' . __( "Contact phone number <strong>(the button will not be shown if it's empty)</strong>", 'creame-whatsapp-me' ) . '</p>' .
|
448 |
'<p class="joinchat-addon">' . sprintf(
|
760 |
wp_enqueue_script( 'joinchat-admin' );
|
761 |
wp_enqueue_style( 'joinchat-admin' );
|
762 |
|
763 |
+
if ( $this->common->get_intltel() ) {
|
764 |
wp_enqueue_style( 'intl-tel-input' );
|
765 |
}
|
766 |
|
admin/class-joinchat-admin.php
CHANGED
@@ -69,8 +69,9 @@ class JoinChatAdmin {
|
|
69 |
|
70 |
wp_register_style( 'joinchat-admin', plugins_url( "css/joinchat{$min}.css", __FILE__ ), array( 'wp-color-picker' ), $this->version, 'all' );
|
71 |
|
72 |
-
|
73 |
-
|
|
|
74 |
}
|
75 |
|
76 |
}
|
@@ -88,15 +89,16 @@ class JoinChatAdmin {
|
|
88 |
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
89 |
$deps = array( 'jquery', 'wp-color-picker' );
|
90 |
|
91 |
-
|
|
|
92 |
$deps[] = 'intl-tel-input';
|
93 |
$localize = array(
|
94 |
'placeholder' => __( 'e.g.', 'creame-whatsapp-me' ),
|
95 |
-
'version' => $
|
96 |
'utils_js' => plugins_url( 'js/utils.js', __FILE__ ),
|
97 |
);
|
98 |
|
99 |
-
wp_register_script( 'intl-tel-input', plugins_url( "js/intlTelInput{$min}.js", __FILE__ ), array(), $
|
100 |
wp_localize_script( 'intl-tel-input', 'intlTelConf', $localize );
|
101 |
}
|
102 |
|
@@ -252,7 +254,7 @@ class JoinChatAdmin {
|
|
252 |
wp_enqueue_script( 'joinchat-admin' );
|
253 |
wp_enqueue_style( 'joinchat-admin' );
|
254 |
|
255 |
-
if ( $this->common->
|
256 |
wp_enqueue_style( 'intl-tel-input' );
|
257 |
}
|
258 |
|
@@ -271,7 +273,7 @@ class JoinChatAdmin {
|
|
271 |
$metabox_vars = $this->common->get_obj_vars( $post );
|
272 |
|
273 |
ob_start();
|
274 |
-
include __DIR__ . '/partials/
|
275 |
$metabox_output = ob_get_clean();
|
276 |
|
277 |
echo apply_filters( 'joinchat_metabox_output', $metabox_output, $post, $metadata ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
@@ -354,7 +356,7 @@ class JoinChatAdmin {
|
|
354 |
wp_enqueue_script( 'joinchat-admin' );
|
355 |
wp_enqueue_style( 'joinchat-admin' );
|
356 |
|
357 |
-
if ( $this->common->
|
358 |
wp_enqueue_style( 'intl-tel-input' );
|
359 |
}
|
360 |
|
@@ -373,7 +375,7 @@ class JoinChatAdmin {
|
|
373 |
$metabox_vars = $this->common->get_obj_vars( $term );
|
374 |
|
375 |
ob_start();
|
376 |
-
include __DIR__ . '/partials/
|
377 |
$metabox_output = ob_get_clean();
|
378 |
|
379 |
echo apply_filters( 'joinchat_term_metabox_output', $metabox_output, $term, $metadata, $taxonomy ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
69 |
|
70 |
wp_register_style( 'joinchat-admin', plugins_url( "css/joinchat{$min}.css", __FILE__ ), array( 'wp-color-picker' ), $this->version, 'all' );
|
71 |
|
72 |
+
$intltel = $this->common->get_intltel();
|
73 |
+
if ( $intltel ) {
|
74 |
+
wp_register_style( 'intl-tel-input', plugins_url( "css/intlTelInput{$min}.css", __FILE__ ), array(), $intltel, 'all' );
|
75 |
}
|
76 |
|
77 |
}
|
89 |
$min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
|
90 |
$deps = array( 'jquery', 'wp-color-picker' );
|
91 |
|
92 |
+
$intltel = $this->common->get_intltel();
|
93 |
+
if ( $intltel ) {
|
94 |
$deps[] = 'intl-tel-input';
|
95 |
$localize = array(
|
96 |
'placeholder' => __( 'e.g.', 'creame-whatsapp-me' ),
|
97 |
+
'version' => $intltel,
|
98 |
'utils_js' => plugins_url( 'js/utils.js', __FILE__ ),
|
99 |
);
|
100 |
|
101 |
+
wp_register_script( 'intl-tel-input', plugins_url( "js/intlTelInput{$min}.js", __FILE__ ), array(), $intltel, true );
|
102 |
wp_localize_script( 'intl-tel-input', 'intlTelConf', $localize );
|
103 |
}
|
104 |
|
254 |
wp_enqueue_script( 'joinchat-admin' );
|
255 |
wp_enqueue_style( 'joinchat-admin' );
|
256 |
|
257 |
+
if ( $this->common->get_intltel() ) {
|
258 |
wp_enqueue_style( 'intl-tel-input' );
|
259 |
}
|
260 |
|
273 |
$metabox_vars = $this->common->get_obj_vars( $post );
|
274 |
|
275 |
ob_start();
|
276 |
+
include __DIR__ . '/partials/post-meta-box.php';
|
277 |
$metabox_output = ob_get_clean();
|
278 |
|
279 |
echo apply_filters( 'joinchat_metabox_output', $metabox_output, $post, $metadata ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
356 |
wp_enqueue_script( 'joinchat-admin' );
|
357 |
wp_enqueue_style( 'joinchat-admin' );
|
358 |
|
359 |
+
if ( $this->common->get_intltel() ) {
|
360 |
wp_enqueue_style( 'intl-tel-input' );
|
361 |
}
|
362 |
|
375 |
$metabox_vars = $this->common->get_obj_vars( $term );
|
376 |
|
377 |
ob_start();
|
378 |
+
include __DIR__ . '/partials/term-meta-box.php';
|
379 |
$metabox_output = ob_get_clean();
|
380 |
|
381 |
echo apply_filters( 'joinchat_term_metabox_output', $metabox_output, $term, $metadata, $taxonomy ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
admin/partials/post-meta-box.php
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Joinchat admin post meta box
|
4 |
+
*
|
5 |
+
* @since 4.3.0
|
6 |
+
* @package JoinChat
|
7 |
+
* @subpackage JoinChat/admin
|
8 |
+
* @author Creame <hola@crea.me>
|
9 |
+
*/
|
10 |
+
|
11 |
+
defined( 'WPINC' ) || exit;
|
12 |
+
?>
|
13 |
+
|
14 |
+
<div class="joinchat-metabox">
|
15 |
+
<?php wp_nonce_field( 'joinchat_data', 'joinchat_nonce' ); ?>
|
16 |
+
<p>
|
17 |
+
<label for="joinchat_phone"><?php esc_html_e( 'Telephone', 'creame-whatsapp-me' ); ?></label><br>
|
18 |
+
<input id="joinchat_phone" <?php echo $this->common->get_intltel() ? 'data-' : ''; ?>name="joinchat_telephone" value="<?php echo esc_attr( $metadata['telephone'] ); ?>" type="text" placeholder="<?php echo esc_attr( $placeholders['telephone'] ); ?>">
|
19 |
+
</p>
|
20 |
+
<p>
|
21 |
+
<label for="joinchat_message"><?php esc_html_e( 'Call to Action', 'creame-whatsapp-me' ); ?></label><br>
|
22 |
+
<textarea id="joinchat_message" name="joinchat_message" rows="2" placeholder="<?php echo esc_attr( $placeholders['message_text'] ); ?>" class="large-text"><?php echo esc_textarea( $metadata['message_text'] ); ?></textarea>
|
23 |
+
</p>
|
24 |
+
<p>
|
25 |
+
<label for="joinchat_message_send"><?php esc_html_e( 'Message', 'creame-whatsapp-me' ); ?></label><br>
|
26 |
+
<textarea id="joinchat_message_send" name="joinchat_message_send" rows="2" placeholder="<?php echo esc_attr( $placeholders['message_send'] ); ?>" class="large-text"><?php echo esc_textarea( $metadata['message_send'] ); ?></textarea>
|
27 |
+
<?php if ( count( $metabox_vars ) ) : ?>
|
28 |
+
<small><?php esc_html_e( 'Can use vars', 'creame-whatsapp-me' ); ?> <code>{<?php echo esc_html( join( '}</code> <code>{', $metabox_vars ) ); ?>}</code></small>
|
29 |
+
<?php endif; ?>
|
30 |
+
<small><?php esc_html_e( 'to leave it blank use', 'creame-whatsapp-me' ); ?> <code>{}</code></small>
|
31 |
+
</p>
|
32 |
+
<p>
|
33 |
+
<label><input type="radio" name="joinchat_view" value="yes" <?php checked( 'yes', $metadata['view'] ); ?>>
|
34 |
+
<span class="dashicons dashicons-visibility" title="<?php esc_attr_e( 'Show', 'creame-whatsapp-me' ); ?>"></span></label>
|
35 |
+
<label><input type="radio" name="joinchat_view" value="no" <?php checked( 'no', $metadata['view'] ); ?>>
|
36 |
+
<span class="dashicons dashicons-hidden" title="<?php esc_attr_e( 'Hide', 'creame-whatsapp-me' ); ?>"></span></label>
|
37 |
+
<label><input type="radio" name="joinchat_view" value="" <?php checked( '', $metadata['view'] ); ?>>
|
38 |
+
<?php esc_html_e( 'Default visibility', 'creame-whatsapp-me' ); ?></label>
|
39 |
+
</p>
|
40 |
+
</div>
|
admin/partials/post_meta_box.php
DELETED
@@ -1,41 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Joinchat admin post meta box
|
5 |
-
*
|
6 |
-
* @since 4.3.0
|
7 |
-
* @package JoinChat
|
8 |
-
* @subpackage JoinChat/admin
|
9 |
-
* @author Creame <hola@crea.me>
|
10 |
-
*/
|
11 |
-
|
12 |
-
defined( 'WPINC' ) || exit;
|
13 |
-
?>
|
14 |
-
|
15 |
-
<div class="joinchat-metabox">
|
16 |
-
<?php wp_nonce_field( 'joinchat_data', 'joinchat_nonce' ); ?>
|
17 |
-
<p>
|
18 |
-
<label for="joinchat_phone"><?php _e( 'Telephone', 'creame-whatsapp-me' ); ?></label><br>
|
19 |
-
<input id="joinchat_phone" <?php echo $this->common->intltel ? 'data-' : ''; ?>name="joinchat_telephone" value="<?php echo esc_attr( $metadata['telephone'] ); ?>" type="text" placeholder="<?php echo $placeholders['telephone']; ?>">
|
20 |
-
</p>
|
21 |
-
<p>
|
22 |
-
<label for="joinchat_message"><?php _e( 'Call to Action', 'creame-whatsapp-me' ); ?></label><br>
|
23 |
-
<textarea id="joinchat_message" name="joinchat_message" rows="2" placeholder="<?php echo $placeholders['message_text']; ?>" class="large-text"><?php echo esc_textarea( $metadata['message_text'] ); ?></textarea>
|
24 |
-
</p>
|
25 |
-
<p>
|
26 |
-
<label for="joinchat_message_send"><?php _e( 'Message', 'creame-whatsapp-me' ); ?></label><br>
|
27 |
-
<textarea id="joinchat_message_send" name="joinchat_message_send" rows="2" placeholder="<?php echo $placeholders['message_send']; ?>" class="large-text"><?php echo esc_textarea( $metadata['message_send'] ); ?></textarea>
|
28 |
-
<?php if ( count( $metabox_vars ) ) : ?>
|
29 |
-
<small><?php _e( 'Can use vars', 'creame-whatsapp-me' ); ?> <code>{<?php echo join( '}</code> <code>{', $metabox_vars ); ?>}</code></small>
|
30 |
-
<?php endif; ?>
|
31 |
-
<small><?php _e( 'to leave it blank use', 'creame-whatsapp-me' ); ?> <code>{}</code></small>
|
32 |
-
</p>
|
33 |
-
<p>
|
34 |
-
<label><input type="radio" name="joinchat_view" value="yes" <?php checked( 'yes', $metadata['view'] ); ?>>
|
35 |
-
<span class="dashicons dashicons-visibility" title="<?php echo __( 'Show', 'creame-whatsapp-me' ); ?>"></span></label>
|
36 |
-
<label><input type="radio" name="joinchat_view" value="no" <?php checked( 'no', $metadata['view'] ); ?>>
|
37 |
-
<span class="dashicons dashicons-hidden" title="<?php echo __( 'Hide', 'creame-whatsapp-me' ); ?>"></span></label>
|
38 |
-
<label><input type="radio" name="joinchat_view" value="" <?php checked( '', $metadata['view'] ); ?>>
|
39 |
-
<?php echo __( 'Default visibility', 'creame-whatsapp-me' ); ?></label>
|
40 |
-
</p>
|
41 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
admin/partials/term-meta-box.php
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Joinchat admin term edit from fields
|
4 |
+
*
|
5 |
+
* @since 4.3.0
|
6 |
+
* @package JoinChat
|
7 |
+
* @subpackage JoinChat/admin
|
8 |
+
* @author Creame <hola@crea.me>
|
9 |
+
*/
|
10 |
+
|
11 |
+
defined( 'WPINC' ) || exit;
|
12 |
+
?>
|
13 |
+
|
14 |
+
<tr class="form-field">
|
15 |
+
<th><h2 style="margin:0"><?php esc_html_e( 'Joinchat', 'creame-whatsapp-me' ); ?></h2></th>
|
16 |
+
<td><?php wp_nonce_field( 'joinchat_data', 'joinchat_nonce' ); ?></td>
|
17 |
+
</tr>
|
18 |
+
<tr class="form-field joinchat-metabox">
|
19 |
+
<th scope="row"><label for="joinchat_phone"><?php esc_html_e( 'Telephone', 'creame-whatsapp-me' ); ?></label></th>
|
20 |
+
<td><input id="joinchat_phone" <?php echo $this->common->get_intltel() ? 'data-' : ''; ?>name="joinchat_telephone" value="<?php echo esc_attr( $metadata['telephone'] ); ?>" type="text" placeholder="<?php echo esc_attr( $placeholders['telephone'] ); ?>"></td>
|
21 |
+
</tr>
|
22 |
+
<tr class="form-field joinchat-metabox">
|
23 |
+
<th scope="row"><label for="joinchat_message"><?php esc_html_e( 'Call to Action', 'creame-whatsapp-me' ); ?></label></th>
|
24 |
+
<td><textarea id="joinchat_message" name="joinchat_message" rows="2" placeholder="<?php echo esc_attr( $placeholders['message_text'] ); ?>" class="large-text"><?php echo esc_textarea( $metadata['message_text'] ); ?></textarea></td>
|
25 |
+
</tr>
|
26 |
+
<tr class="form-field joinchat-metabox">
|
27 |
+
<th scope="row"><label for="joinchat_message_send"><?php esc_html_e( 'Message', 'creame-whatsapp-me' ); ?></label></th>
|
28 |
+
<td>
|
29 |
+
<textarea id="joinchat_message_send" name="joinchat_message_send" rows="2" placeholder="<?php echo esc_attr( $placeholders['message_send'] ); ?>" class="large-text"><?php echo esc_textarea( $metadata['message_send'] ); ?></textarea>
|
30 |
+
<p class="description">
|
31 |
+
<?php if ( count( $metabox_vars ) ) : ?>
|
32 |
+
<?php esc_html_e( 'Can use vars', 'creame-whatsapp-me' ); ?> <code>{<?php echo esc_html( join( '}</code> <code>{', $metabox_vars ) ); ?>}</code>
|
33 |
+
<?php endif; ?>
|
34 |
+
<?php esc_html_e( 'to leave it blank use', 'creame-whatsapp-me' ); ?> <code>{}</code>
|
35 |
+
</p>
|
36 |
+
</td>
|
37 |
+
</tr>
|
38 |
+
<tr class="form-field joinchat-metabox">
|
39 |
+
<th scope="row"><label for="joinchat_message"><?php esc_html_e( 'Visibility', 'creame-whatsapp-me' ); ?></label></th>
|
40 |
+
<td>
|
41 |
+
<label><input type="radio" name="joinchat_view" value="yes" <?php checked( 'yes', $metadata['view'] ); ?>>
|
42 |
+
<span class="dashicons dashicons-visibility" title="<?php esc_attr_e( 'Show', 'creame-whatsapp-me' ); ?>"></span></label>
|
43 |
+
<label><input type="radio" name="joinchat_view" value="no" <?php checked( 'no', $metadata['view'] ); ?>>
|
44 |
+
<span class="dashicons dashicons-hidden" title="<?php esc_attr_e( 'Hide', 'creame-whatsapp-me' ); ?>"></span></label>
|
45 |
+
<label><input type="radio" name="joinchat_view" value="" <?php checked( '', $metadata['view'] ); ?>>
|
46 |
+
<?php esc_html_e( 'Default visibility', 'creame-whatsapp-me' ); ?></label>
|
47 |
+
</td>
|
48 |
+
</tr>
|
admin/partials/term_meta_box.php
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**
|
4 |
-
* Joinchat admin term edit from fields
|
5 |
-
*
|
6 |
-
* @since 4.3.0
|
7 |
-
* @package JoinChat
|
8 |
-
* @subpackage JoinChat/admin
|
9 |
-
* @author Creame <hola@crea.me>
|
10 |
-
*/
|
11 |
-
|
12 |
-
defined( 'WPINC' ) || exit;
|
13 |
-
?>
|
14 |
-
|
15 |
-
<tr class="form-field">
|
16 |
-
<th><h2 style="margin:0"><?php _e( 'Joinchat', 'creame-whatsapp-me' ); ?></h2></th>
|
17 |
-
<td><?php wp_nonce_field( 'joinchat_data', 'joinchat_nonce' ); ?></td>
|
18 |
-
</tr>
|
19 |
-
<tr class="form-field joinchat-metabox">
|
20 |
-
<th scope="row"><label for="joinchat_phone"><?php _e( 'Telephone', 'creame-whatsapp-me' ); ?></label></th>
|
21 |
-
<td><input id="joinchat_phone" <?php echo $this->common->intltel ? 'data-' : ''; ?>name="joinchat_telephone" value="<?php echo esc_attr( $metadata['telephone'] ); ?>" type="text" placeholder="<?php echo $placeholders['telephone']; ?>"></td>
|
22 |
-
</tr>
|
23 |
-
<tr class="form-field joinchat-metabox">
|
24 |
-
<th scope="row"><label for="joinchat_message"><?php _e( 'Call to Action', 'creame-whatsapp-me' ); ?></label></th>
|
25 |
-
<td><textarea id="joinchat_message" name="joinchat_message" rows="2" placeholder="<?php echo $placeholders['message_text']; ?>" class="large-text"><?php echo esc_textarea( $metadata['message_text'] ); ?></textarea></td>
|
26 |
-
</tr>
|
27 |
-
<tr class="form-field joinchat-metabox">
|
28 |
-
<th scope="row"><label for="joinchat_message_send"><?php _e( 'Message', 'creame-whatsapp-me' ); ?></label></th>
|
29 |
-
<td>
|
30 |
-
<textarea id="joinchat_message_send" name="joinchat_message_send" rows="2" placeholder="<?php echo $placeholders['message_send']; ?>" class="large-text"><?php echo esc_textarea( $metadata['message_send'] ); ?></textarea>
|
31 |
-
<p class="description">
|
32 |
-
<?php if ( count( $metabox_vars ) ) : ?>
|
33 |
-
<?php _e( 'Can use vars', 'creame-whatsapp-me' ); ?> <code>{<?php echo join( '}</code> <code>{', $metabox_vars ); ?>}</code>
|
34 |
-
<?php endif; ?>
|
35 |
-
<?php _e( 'to leave it blank use', 'creame-whatsapp-me' ); ?> <code>{}</code>
|
36 |
-
</p>
|
37 |
-
</td>
|
38 |
-
</tr>
|
39 |
-
<tr class="form-field joinchat-metabox">
|
40 |
-
<th scope="row"><label for="joinchat_message"><?php _e( 'Visibility', 'creame-whatsapp-me' ); ?></label></th>
|
41 |
-
<td>
|
42 |
-
<label><input type="radio" name="joinchat_view" value="yes" <?php checked( 'yes', $metadata['view'] ); ?>>
|
43 |
-
<span class="dashicons dashicons-visibility" title="<?php echo __( 'Show', 'creame-whatsapp-me' ); ?>"></span></label>
|
44 |
-
<label><input type="radio" name="joinchat_view" value="no" <?php checked( 'no', $metadata['view'] ); ?>>
|
45 |
-
<span class="dashicons dashicons-hidden" title="<?php echo __( 'Hide', 'creame-whatsapp-me' ); ?>"></span></label>
|
46 |
-
<label><input type="radio" name="joinchat_view" value="" <?php checked( '', $metadata['view'] ); ?>>
|
47 |
-
<?php echo __( 'Default visibility', 'creame-whatsapp-me' ); ?></label>
|
48 |
-
</td>
|
49 |
-
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-joinchat-common.php
CHANGED
@@ -10,6 +10,13 @@
|
|
10 |
*/
|
11 |
class JoinChatCommon {
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* Singleton instance.
|
15 |
*
|
@@ -26,14 +33,6 @@ class JoinChatCommon {
|
|
26 |
*/
|
27 |
public $settings = null;
|
28 |
|
29 |
-
/**
|
30 |
-
* Intl-tel-input version.
|
31 |
-
*
|
32 |
-
* @since 4.5.0
|
33 |
-
* @var string|false
|
34 |
-
*/
|
35 |
-
public $intltel = null;
|
36 |
-
|
37 |
/**
|
38 |
* Require QR Script on front.
|
39 |
*
|
@@ -63,11 +62,7 @@ class JoinChatCommon {
|
|
63 |
*
|
64 |
* @since 4.2.0
|
65 |
*/
|
66 |
-
|
67 |
-
|
68 |
-
$this->intltel = '17.0.17';
|
69 |
-
|
70 |
-
}
|
71 |
|
72 |
/**
|
73 |
* Return the default settings.
|
@@ -114,9 +109,6 @@ class JoinChatCommon {
|
|
114 |
*/
|
115 |
public function load_settings() {
|
116 |
|
117 |
-
// Use International Telephone Input library version or false to disable.
|
118 |
-
$this->intltel = apply_filters( 'joinchat_enhanced_phone', $this->intltel );
|
119 |
-
|
120 |
$default_settings = $this->default_settings();
|
121 |
|
122 |
// Can hook 'option_joinchat' and 'default_option_joinchat' filters.
|
@@ -135,6 +127,20 @@ class JoinChatCommon {
|
|
135 |
|
136 |
}
|
137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
/**
|
139 |
* Get public post_types
|
140 |
*
|
10 |
*/
|
11 |
class JoinChatCommon {
|
12 |
|
13 |
+
/**
|
14 |
+
* International Telephone Input library version.
|
15 |
+
*
|
16 |
+
* @since 4.5.10
|
17 |
+
*/
|
18 |
+
const INTL_TEL_INPUT_VERSION = '17.0.17';
|
19 |
+
|
20 |
/**
|
21 |
* Singleton instance.
|
22 |
*
|
33 |
*/
|
34 |
public $settings = null;
|
35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
/**
|
37 |
* Require QR Script on front.
|
38 |
*
|
62 |
*
|
63 |
* @since 4.2.0
|
64 |
*/
|
65 |
+
private function __construct() {}
|
|
|
|
|
|
|
|
|
66 |
|
67 |
/**
|
68 |
* Return the default settings.
|
109 |
*/
|
110 |
public function load_settings() {
|
111 |
|
|
|
|
|
|
|
112 |
$default_settings = $this->default_settings();
|
113 |
|
114 |
// Can hook 'option_joinchat' and 'default_option_joinchat' filters.
|
127 |
|
128 |
}
|
129 |
|
130 |
+
/**
|
131 |
+
* Get International Telephone Input library version
|
132 |
+
*
|
133 |
+
* Return IntlTelInput library version or false to disable.
|
134 |
+
*
|
135 |
+
* @since 4.5.10
|
136 |
+
* @return string|false
|
137 |
+
*/
|
138 |
+
public function get_intltel() {
|
139 |
+
|
140 |
+
return apply_filters( 'joinchat_enhanced_phone', self::INTL_TEL_INPUT_VERSION );
|
141 |
+
|
142 |
+
}
|
143 |
+
|
144 |
/**
|
145 |
* Get public post_types
|
146 |
*
|
includes/class-joinchat.php
CHANGED
@@ -179,12 +179,11 @@ class JoinChat {
|
|
179 |
require_once JOINCHAT_DIR . 'admin/class-joinchat-admin.php';
|
180 |
require_once JOINCHAT_DIR . 'admin/class-joinchat-admin-page.php';
|
181 |
|
182 |
-
$plugin_admin = new JoinChatAdmin( $this->get_plugin_name(), $this->get_version() );
|
183 |
-
$plugin_page = new JoinChatAdminPage( $this->get_plugin_name(), $this->get_version() );
|
184 |
-
|
185 |
$this->loader->add_action( 'admin_init', JoinChatCommon::instance(), 'load_settings', 5 );
|
186 |
$this->loader->add_filter( 'option_page_capability_joinchat', 'JoinChatUtil', 'capability' );
|
187 |
|
|
|
|
|
188 |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'register_styles' );
|
189 |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'register_scripts' );
|
190 |
$this->loader->add_action( 'admin_notices', $plugin_admin, 'notices' );
|
@@ -196,6 +195,8 @@ class JoinChat {
|
|
196 |
$this->loader->add_filter( 'plugin_action_links_' . JOINCHAT_BASENAME, $plugin_admin, 'settings_link' );
|
197 |
$this->loader->add_filter( 'plugin_row_meta', $plugin_admin, 'plugin_links', 10, 2 );
|
198 |
|
|
|
|
|
199 |
$this->loader->add_action( 'admin_init', $plugin_page, 'settings_init' );
|
200 |
$this->loader->add_action( 'admin_menu', $plugin_page, 'add_menu' );
|
201 |
$this->loader->add_action( 'load-settings_page_joinchat', $plugin_page, 'help_tab' );
|
179 |
require_once JOINCHAT_DIR . 'admin/class-joinchat-admin.php';
|
180 |
require_once JOINCHAT_DIR . 'admin/class-joinchat-admin-page.php';
|
181 |
|
|
|
|
|
|
|
182 |
$this->loader->add_action( 'admin_init', JoinChatCommon::instance(), 'load_settings', 5 );
|
183 |
$this->loader->add_filter( 'option_page_capability_joinchat', 'JoinChatUtil', 'capability' );
|
184 |
|
185 |
+
$plugin_admin = new JoinChatAdmin( $this->get_plugin_name(), $this->get_version() );
|
186 |
+
|
187 |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'register_styles' );
|
188 |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'register_scripts' );
|
189 |
$this->loader->add_action( 'admin_notices', $plugin_admin, 'notices' );
|
195 |
$this->loader->add_filter( 'plugin_action_links_' . JOINCHAT_BASENAME, $plugin_admin, 'settings_link' );
|
196 |
$this->loader->add_filter( 'plugin_row_meta', $plugin_admin, 'plugin_links', 10, 2 );
|
197 |
|
198 |
+
$plugin_page = new JoinChatAdminPage( $this->get_plugin_name(), $this->get_version() );
|
199 |
+
|
200 |
$this->loader->add_action( 'admin_init', $plugin_page, 'settings_init' );
|
201 |
$this->loader->add_action( 'admin_menu', $plugin_page, 'add_menu' );
|
202 |
$this->loader->add_action( 'load-settings_page_joinchat', $plugin_page, 'help_tab' );
|
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.
|
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.
|
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.10
|
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.10' );
|
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.
|
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.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"
|
public/class-joinchat-woo-public.php
CHANGED
@@ -10,15 +10,6 @@
|
|
10 |
*/
|
11 |
class JoinChatWooPublic {
|
12 |
|
13 |
-
/**
|
14 |
-
* Product Button Text
|
15 |
-
*
|
16 |
-
* @since 4.4.0
|
17 |
-
* @access private
|
18 |
-
* @var string $btn_text Product Button text.
|
19 |
-
*/
|
20 |
-
private $btn_text;
|
21 |
-
|
22 |
/**
|
23 |
* Product Button Show
|
24 |
*
|
@@ -123,9 +114,6 @@ class JoinChatWooPublic {
|
|
123 |
|
124 |
// Add Product Button.
|
125 |
if ( is_product() && 'none' !== $settings['woo_btn_position'] ) {
|
126 |
-
|
127 |
-
$this->btn_text = $settings['woo_btn_text'];
|
128 |
-
|
129 |
add_action( $settings['woo_btn_position'], array( $this, 'product_button' ), apply_filters( 'joinchat_woo_btn_priority', 10 ) );
|
130 |
}
|
131 |
|
@@ -332,7 +320,10 @@ class JoinChatWooPublic {
|
|
332 |
|
333 |
$this->btn_show = true;
|
334 |
|
335 |
-
|
|
|
|
|
|
|
336 |
|
337 |
}
|
338 |
|
10 |
*/
|
11 |
class JoinChatWooPublic {
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* Product Button Show
|
15 |
*
|
114 |
|
115 |
// Add Product Button.
|
116 |
if ( is_product() && 'none' !== $settings['woo_btn_position'] ) {
|
|
|
|
|
|
|
117 |
add_action( $settings['woo_btn_position'], array( $this, 'product_button' ), apply_filters( 'joinchat_woo_btn_priority', 10 ) );
|
118 |
}
|
119 |
|
320 |
|
321 |
$this->btn_show = true;
|
322 |
|
323 |
+
printf(
|
324 |
+
'<div class="joinchat__woo-btn__wrapper"><div class="joinchat__woo-btn joinchat_app">%s</div></div>',
|
325 |
+
esc_html( JoinChatCommon::instance()->settings['woo_btn_text'] )
|
326 |
+
);
|
327 |
|
328 |
}
|
329 |
|
public/css/joinchat-btn.css
CHANGED
@@ -10,7 +10,7 @@
|
|
10 |
|
11 |
display: none;
|
12 |
position: fixed;
|
13 |
-
z-index:
|
14 |
right: var(--sep);
|
15 |
bottom: var(--bottom);
|
16 |
font: normal normal normal 16px/1.625em var(--joinchat-font);
|
10 |
|
11 |
display: none;
|
12 |
position: fixed;
|
13 |
+
z-index: 9000;
|
14 |
right: var(--sep);
|
15 |
bottom: var(--bottom);
|
16 |
font: normal normal normal 16px/1.625em var(--joinchat-font);
|
public/css/joinchat-btn.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
:root{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");--joinchat-font:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif}.joinchat{--bottom:20px;--sep:20px;--s:60px;display:none;position:fixed;z-index:
|
1 |
+
:root{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");--joinchat-font:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif}.joinchat{--bottom:20px;--sep:20px;--s:60px;display:none;position:fixed;z-index:9000;right:var(--sep);bottom:var(--bottom);font:normal normal normal 16px/1.625em var(--joinchat-font);letter-spacing:0;animation:joinchat_show .5s cubic-bezier(.18,.89,.32,1.28) 10ms both;transform:scale3d(0,0,0);transform-origin:calc(var(--s)/-2) calc(var(--s)/-4);-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgb(0 0 0/0)}.joinchat *,.joinchat :after,.joinchat :before{box-sizing:border-box}.joinchat--show{display:block;transform:scaleX(1)}.joinchat--left{right:auto;left:var(--sep)}.joinchat--noanim{animation:none}.joinchat__button{position:absolute;z-index:2;bottom:8px;right:8px;height:var(--s);min-width:var(--s);max-width:95vw;background:#25d366;color:inherit;border-radius:calc(var(--s)/2);box-shadow:1px 6px 24px 0 rgba(7,94,84,.24);cursor:pointer;transition:background-color .2s linear}.joinchat__button:hover{background:#128c7e}.joinchat__button:active{background:#128c7e;transition:none}.joinchat--left .joinchat__button{right:auto;left:8px}.joinchat__button__open{width:var(--s);height:var(--s);border-radius:50%;background:rgb(0 0 0/0) var(--joinchat-ico) 50% no-repeat;background-size:60%;overflow:hidden}.joinchat__button__image{position:absolute;top:1px;right:1px;width:calc(var(--s) - 2px);height:calc(var(--s) - 2px);border-radius:50%;overflow:hidden;opacity:0}.joinchat__button__image img{display:block;width:100%;height:100%;object-fit:cover}.joinchat--show .joinchat__button__image{animation:joinchat_image_loop 20s linear 5s infinite normal both}.joinchat--image .joinchat__button__image{opacity:1;animation:none}.joinchat__tooltip{position:absolute;top:calc(var(--s)/2 - 16px);right:calc(var(--s) + 16px);max-width:calc(100vw - 105px);height:32px;padding:0 14px;border:none;border-radius:16px;background:#fff;color:rgba(0,0,0,.8);line-height:31px;white-space:nowrap;opacity:0;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgba(0,0,0,.4));pointer-events:none}.joinchat__tooltip:after{content:"";display:block;position:absolute;top:10px;right:-6px;border:8px solid transparent;border-width:6px 0 6px 8px;border-left-color:#fff}.joinchat__tooltip div{overflow:hidden;text-overflow:ellipsis}.joinchat--tooltip .joinchat__tooltip{animation:joinchat_tootlip 20s linear 5s 1 normal both}.joinchat--left .joinchat__tooltip{right:auto;left:calc(var(--s) + 16px)}.joinchat--left .joinchat__tooltip:after{left:-6px;right:auto;border-color:transparent;border-width:6px 8px 6px 0;border-right-color:#fff}.joinchat__qr{position:absolute;bottom:calc(var(--s) + 16px);right:0;display:none;flex-direction:column-reverse;width:228px;min-height:200px;padding:14px 14px 10px;border:none;border-radius:16px;background:#fff;color:rgba(0,0,0,.8);text-align:center;white-space:nowrap;filter:drop-shadow(0 1px 4px rgba(0,0,0,.4));animation:joinchat_badge_in .4s cubic-bezier(.11,.84,.83,1.01) .3s both;pointer-events:none}.joinchat__qr:after{content:"";display:block;position:absolute;bottom:-6px;right:calc(var(--s)/2 - 6px);border:8px solid transparent;border-width:8px 6px 0;border-top-color:#fff}.joinchat--left .joinchat__qr{left:0;right:auto}.joinchat--left .joinchat__qr:after{left:calc(var(--s)/2 - 6px);right:auto}.joinchat__qr div{font-size:14px;color:#4a4a4a;overflow:hidden;text-overflow:ellipsis}.joinchat__qr canvas{display:block;width:200px;height:200px;margin:0}@keyframes joinchat_show{0%{transform:scale3d(0,0,0)}to{transform:scaleX(1)}}@keyframes joinchat_badge_in{0%{opacity:0;transform:translate3d(0,50px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes joinchat_image_loop{0%{opacity:0}3%,20%{opacity:1}25%,to{opacity:0}}@keyframes joinchat_tootlip{0%{opacity:0;transform:scaleY(0)}1%,20%{opacity:1;transform:scaleX(1)}25%,to{opacity:0;transform:scaleX(1)}}.joinchat__woo-btn__wrapper{clear:both}.joinchat__woo-btn{--s:40px;display:inline-block;box-sizing:border-box;height:var(--s);max-width:100%;padding:0 calc(var(--s)/2) 0 var(--s);background:#25d366 var(--joinchat-ico) calc(var(--s)*0.2) 50% no-repeat;background-size:calc(var(--s)*0.6);color:#fff;border-radius:calc(var(--s)/2);font:700 normal calc(var(--s)*0.35)/var(--s) var(--joinchat-font);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;transition:background-color .2s}.joinchat__woo-btn:empty{padding-right:0}.joinchat__woo-btn:hover{background-color:#128c7e}@media (orientation:landscape) and (min-height:481px),(orientation:portrait) and (min-width:481px){.joinchat--mobile{display:none!important}}@media (max-width:767px){.joinchat--footer-bar{--bottom:76px!important}}@media (max-width:480px),(orientation:landscape) and (max-height:480px){.joinchat{--bottom:6px;--sep:6px}}@media (hover:hover){.joinchat__button:hover .joinchat__tooltip{opacity:1;animation:none;transition:opacity .2s}.joinchat--btn .joinchat__button:hover .joinchat__qr{display:flex}}@media (prefers-reduced-motion){.joinchat{animation:none}}
|
public/css/joinchat.css
CHANGED
@@ -25,7 +25,7 @@
|
|
25 |
color: var(--text);
|
26 |
display: none;
|
27 |
position: fixed;
|
28 |
-
z-index:
|
29 |
right: var(--sep);
|
30 |
bottom: var(--bottom);
|
31 |
font: normal normal normal 16px/1.625em var(--joinchat-font);
|
25 |
color: var(--text);
|
26 |
display: none;
|
27 |
position: fixed;
|
28 |
+
z-index: 9000;
|
29 |
right: var(--sep);
|
30 |
bottom: var(--bottom);
|
31 |
font: normal normal normal 16px/1.625em var(--joinchat-font);
|
public/css/joinchat.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
:root{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");--joinchat-font:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif}.joinchat{--bottom:20px;--sep:20px;--s:60px;--header:calc(var(--s)*1.16667);--vh:100vh;--red:37;--green:211;--blue:102;--rgb:var(--red) var(--green) var(--blue);--color:rgb(var(--rgb));--dark:rgb(calc(var(--red) - 75) calc(var(--green) - 75) calc(var(--blue) - 75));--hover:rgb(calc(var(--red) + 50) calc(var(--green) + 50) calc(var(--blue) + 50));--bg:rgb(var(--rgb)/4%);--tolerance:210;--bw:calc((var(--red)*0.2126 + var(--green)*0.7152 + var(--blue)*0.0722 - var(--tolerance))*-10000000);--text:hsl(0deg 0% calc(var(--bw)*1%)/clamp(70%,calc(var(--bw)*1%),100%));--msg:var(--color);color:var(--text);display:none;position:fixed;z-index:9999;right:var(--sep);bottom:var(--bottom);font:normal normal normal 16px/1.625em var(--joinchat-font);letter-spacing:0;animation:joinchat_show .5s cubic-bezier(.18,.89,.32,1.28) 10ms both;transform:scale3d(0,0,0);transform-origin:calc(var(--s)/-2) calc(var(--s)/-4);-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgb(0 0 0/0)}.joinchat *,.joinchat :after,.joinchat :before{box-sizing:border-box}.joinchat--show{display:block;transform:scaleX(1)}.joinchat--left{right:auto;left:var(--sep)}.joinchat--dark{--msg:var(--dark)}.joinchat--noanim{animation:none}.joinchat--chatbox:not(.joinchat--noanim){transform-origin:0 0;animation-timing-function:ease-in-out}.joinchat--hidden{display:none!important}@supports not (width:clamp(1px,1%,10px)){.joinchat{--text:hsl(0deg 0% calc(var(--bw)*1%)/90%)}}.joinchat__button{display:flex;flex-direction:row;position:absolute;z-index:2;bottom:8px;right:8px;height:var(--s);min-width:var(--s);max-width:95vw;background:#25d366;color:inherit;border-radius:calc(var(--s)/2);box-shadow:1px 6px 24px 0 rgba(7,94,84,.24);cursor:pointer;transition:background-color .2s linear}[dir=rtl] .joinchat__button{flex-direction:row-reverse}.joinchat__button:hover{background:#128c7e;transition-duration:1.5s}.joinchat__button:active{background:#128c7e;transition:none}.joinchat--left .joinchat__button{right:auto;left:8px;flex-direction:row-reverse}[dir=rtl] .joinchat--left .joinchat__button{flex-direction:row}.joinchat--chatbox .joinchat__button{background:var(--color);transition-duration:.2s;box-shadow:0 1px 2px 0 rgba(0,0,0,.3)}.joinchat--chatbox .joinchat__button:active,.joinchat--chatbox .joinchat__button:hover{background:var(--hover)}.joinchat--optout.joinchat--chatbox .joinchat__button{background-color:#999;opacity:.5;pointer-events:none}.joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__plain{stroke-dasharray:0;animation:none}.joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__chat{animation:none}.joinchat__button__open{width:var(--s);height:var(--s);border-radius:50%;background:rgb(0 0 0/0) var(--joinchat-ico) 50% no-repeat;background-size:60%;overflow:hidden}.joinchat--chatbox .joinchat__button__open{display:none}.joinchat__button__image{position:absolute;top:1px;right:1px;width:calc(var(--s) - 2px);height:calc(var(--s) - 2px);border-radius:50%;overflow:hidden;opacity:0}.joinchat__button__image img{display:block;width:100%;height:100%;object-fit:cover}.joinchat--show .joinchat__button__image{animation:joinchat_image_loop 20s linear 5s infinite normal both}.joinchat--image .joinchat__button__image{opacity:1;animation:none}.joinchat--chatbox .joinchat__button__image{display:none}.joinchat__button__send{display:none;flex-shrink:0;width:var(--s);height:var(--s);max-width:var(--s);padding:calc(var(--s)*0.18);margin:0;overflow:hidden}.joinchat--chatbox .joinchat__button__send{display:block}.joinchat__button__send path{fill:none!important;stroke:var(--text)!important}.joinchat__button__send .joinchat_svg__plain{stroke-dasharray:1097;stroke-dashoffset:1097;animation:joinchat_plain 6s .2s ease-in-out infinite}.joinchat__button__send .joinchat_svg__chat{stroke-dasharray:1020;stroke-dashoffset:1020;animation:joinchat_chat 6s 3.2s ease-in-out infinite}.joinchat__button__sendtext{padding:0;max-width:0;border-radius:var(--s);font-weight:600;line-height:var(--s);white-space:nowrap;opacity:0;overflow:hidden;transition:none}.joinchat--chatbox .joinchat__button__sendtext{padding:0 4px 0 24px;max-width:200px;opacity:1;transition:max-width .2s linear,opacity .4s ease-out .2s}.joinchat--chatbox.joinchat--left .joinchat__button__sendtext{padding:0 24px 0 4px}.joinchat__badge{position:absolute;top:-4px;right:-4px;width:20px;height:20px;border:none;border-radius:50%;background:#e82c0c;color:#fff;font-size:12px;font-weight:600;line-height:20px;text-align:center;box-shadow:none;opacity:0;pointer-events:none}.joinchat__badge.joinchat__badge--in{animation:joinchat_badge_in .5s cubic-bezier(.27,.9,.41,1.28) 1 both}.joinchat__badge.joinchat__badge--out{animation:joinchat_badge_out .4s cubic-bezier(.215,.61,.355,1) 1 both}.joinchat__tooltip{position:absolute;top:calc(var(--s)/2 - 16px);right:calc(var(--s) + 16px);max-width:calc(100vw - 105px);height:32px;padding:0 14px;border:none;border-radius:16px;background:#fff;color:rgba(0,0,0,.8);line-height:31px;white-space:nowrap;opacity:0;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgba(0,0,0,.4));pointer-events:none}.joinchat__tooltip:after{content:"";display:block;position:absolute;top:10px;right:-6px;border:8px solid transparent;border-width:6px 0 6px 8px;border-left-color:#fff}.joinchat__tooltip div{overflow:hidden;text-overflow:ellipsis}.joinchat--tooltip .joinchat__tooltip{animation:joinchat_tootlip 20s linear 5s 1 normal both}.joinchat--chatbox .joinchat__tooltip{display:none}.joinchat--left .joinchat__tooltip{right:auto;left:calc(var(--s) + 16px)}.joinchat--left .joinchat__tooltip:after{left:-6px;right:auto;border-color:transparent;border-width:6px 8px 6px 0;border-right-color:#fff}.joinchat__qr{position:absolute;bottom:calc(var(--s) + 16px);right:0;display:none;flex-direction:column-reverse;width:228px;min-height:200px;padding:14px 14px 10px;border:none;border-radius:16px;background:#fff;color:rgba(0,0,0,.8);text-align:center;white-space:nowrap;filter:drop-shadow(0 1px 4px rgba(0,0,0,.4));animation:joinchat_badge_in .4s cubic-bezier(.11,.84,.83,1.01) .3s both;pointer-events:none}.joinchat__qr:after{content:"";display:block;position:absolute;bottom:-6px;right:calc(var(--s)/2 - 6px);border:8px solid transparent;border-width:8px 6px 0;border-top-color:#fff}.joinchat--left .joinchat__qr{left:0;right:auto}.joinchat--left .joinchat__qr:after{left:calc(var(--s)/2 - 6px);right:auto}.joinchat__qr div{font-size:14px;color:#4a4a4a;overflow:hidden;text-overflow:ellipsis}.joinchat__qr canvas{display:block;width:200px;height:200px;margin:0}.joinchat__box{display:flex;flex-direction:column;position:absolute;bottom:0;right:0;z-index:1;width:calc(100vw - var(--sep)*2);max-width:400px;min-height:170px;max-height:calc(var(--vh) - var(--bottom) - var(--sep));border-radius:calc(var(--s)/2 + 2px);background:transparent;box-shadow:0 2px 6px 0 rgba(0,0,0,.5);text-align:left;overflow:hidden;transform:scale3d(0,0,0);opacity:0;transition:max-height .2s ease-out,opacity .4s ease-out,transform 0s linear .3s}[dir=rtl] .joinchat__box{text-align:right}.joinchat--chatbox .joinchat__box{opacity:1;transform:scaleX(1);transition:max-height .2s ease-out,opacity .2s ease-out,transform 0s linear}.joinchat--left .joinchat__box{right:auto;left:0}.joinchat__header{display:flex;flex-flow:row;align-items:center;position:relative;flex-shrink:0;height:var(--header);min-height:50px;padding:0 70px 0 26px;margin:0;background:var(--color)}[dir=rtl] .joinchat__header{padding:0 26px 0 70px}.joinchat--dark .joinchat__header{background:var(--dark)}.joinchat__header__text{font-size:19px;font-weight:600;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.8}.joinchat__powered{font-size:11px;line-height:18px;color:inherit!important;text-decoration:none!important;fill:currentcolor;opacity:.8}.joinchat__powered svg{display:inline-block;width:auto;height:18px;vertical-align:-30%}.joinchat__powered:active,.joinchat__powered:hover{color:inherit!important;text-decoration:none!important;opacity:.9;filter:drop-shadow(0 1px 3px rgba(0,0,0,.3))}.joinchat__wa{height:28px;width:auto;fill:currentcolor;opacity:.8}.joinchat__close{--size:34px;position:absolute;top:calc(50% - var(--size)/2);right:24px;width:var(--size);height:var(--size);border-radius:50%;background:rgba(0,0,0,.4) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M24 2.4 21.6 0 12 9.6 2.4 0 0 2.4 9.6 12 0 21.6 2.4 24l9.6-9.6 9.6 9.6 2.4-2.4-9.6-9.6L24 2.4z'/%3E%3C/svg%3E") 50% no-repeat;background-size:12px;cursor:pointer;transition:background-color .3s ease-out}.joinchat__close:hover{background-color:rgba(0,0,0,.6)}.joinchat__close:active{background-color:rgba(0,0,0,.7)}[dir=rtl] .joinchat__close{right:auto;left:24px}.joinchat__box__scroll{padding:20px 0 70px;padding-bottom:calc(var(--s) + 10px);background:#fff linear-gradient(0deg,var(--bg),var(--bg));overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain}.joinchat__box__scroll::-webkit-scrollbar{width:5px;background:rgb(0 0 0/0)}.joinchat__box__scroll::-webkit-scrollbar-thumb{border-radius:3px;background:rgb(0 0 0/0)}.joinchat--blur .joinchat__box__scroll{background:rgba(var(--rgb)/2%);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.joinchat--dark .joinchat__box__scroll{background:#1a1a1a}.joinchat__box__scroll:hover::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2)}@supports (-webkit-overflow-scrolling:touch){.joinchat__box__scroll{overflow-y:scroll;-webkit-overflow-scrolling:touch}}.joinchat__optin{padding:0 16px;margin-bottom:16px;color:#4a4a4a;font-size:13px;line-height:1.33}.joinchat__optin a{display:inline;padding:0;color:inherit!important;text-decoration:underline}.joinchat__optin a:hover{text-decoration-thickness:2px}.joinchat__optin input{position:absolute;visibility:hidden}.joinchat__optin label{position:relative;display:block;margin:0;padding:0 0 0 30px;color:inherit;font:inherit;cursor:pointer}.joinchat__optin label:before{content:"";display:block;position:absolute;top:calc(50% - 11px);left:0;width:22px;height:22px;border:3px solid var(--color);border-radius:4px;box-shadow:0 0 0 1px var(--text);transition:box-shadow .3s ease-in-out}.joinchat__optin label:after{content:"";display:none;position:absolute;top:calc(50% - 8px);left:8px;width:6px;height:14px;border:solid var(--text);border-width:0 3px 3px 0;transform:rotate(45deg)}[dir=rtl] .joinchat__optin label{padding:0 30px 0 0}[dir=rtl] .joinchat__optin label:before{left:auto;right:0}[dir=rtl] .joinchat__optin label:after{left:auto;right:8px}.joinchat__optin input:checked+label:before{box-shadow:0 0 0 1px var(--text),inset 0 0 0 10px var(--color)}.joinchat__optin input:checked+label:after{display:block}.joinchat--dark .joinchat__optin{color:#d8d8d8}.joinchat__message{position:relative;min-height:60px;padding:17px 20px;margin:0 26px 26px;border-radius:32px;background:#fff;color:#4a4a4a;word-break:break-word;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3));transform:translateZ(0)}.joinchat__message:before{content:"";display:block;position:absolute;bottom:20px;left:-15px;width:17px;height:25px;background:inherit;-webkit-clip-path:var(--peak,url(#joinchat__message__peak));clip-path:var(--peak,url(#joinchat__message__peak))}.joinchat--dark .joinchat__message{background:#505050;color:#d8d8d8}@keyframes joinchat_show{0%{transform:scale3d(0,0,0)}to{transform:scaleX(1)}}@keyframes joinchat_badge_in{0%{opacity:0;transform:translate3d(0,50px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes joinchat_badge_out{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,-20px,0)}}@keyframes joinchat_plain{0%,50%,to{stroke-dashoffset:1097}5%,45%{stroke-dashoffset:0}}@keyframes joinchat_chat{0%,50%,to{stroke-dashoffset:1020}5%,45%{stroke-dashoffset:0}}@keyframes joinchat_image_loop{0%{opacity:0}3%,20%{opacity:1}25%,to{opacity:0}}@keyframes joinchat_tootlip{0%{opacity:0;transform:scaleY(0)}1%,20%{opacity:1;transform:scaleX(1)}25%,to{opacity:0;transform:scaleX(1)}}.joinchat__woo-btn__wrapper{clear:both}.joinchat__woo-btn{--s:40px;display:inline-block;box-sizing:border-box;height:var(--s);max-width:100%;padding:0 calc(var(--s)/2) 0 var(--s);background:#25d366 var(--joinchat-ico) calc(var(--s)*0.2) 50% no-repeat;background-size:calc(var(--s)*0.6);color:#fff;border-radius:calc(var(--s)/2);font:700 normal calc(var(--s)*0.35)/var(--s) var(--joinchat-font);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;transition:background-color .2s}.joinchat__woo-btn:empty{padding-right:0}.joinchat__woo-btn:hover{background-color:#128c7e}@media (orientation:landscape) and (min-height:481px),(orientation:portrait) and (min-width:481px){.joinchat--mobile{display:none!important}}@media (max-width:767px){.joinchat--footer-bar{--bottom:76px!important}}@media (max-width:480px),(orientation:landscape) and (max-height:480px){.joinchat{--bottom:6px;--sep:6px;--header:calc(var(--s)*0.91667)}.joinchat__header__text{font-size:17px}.joinchat__close{--size:28px}.joinchat__box__scroll{padding-top:15px}.joinchat__message{padding:18px 16px;line-height:24px;margin:0 20px 20px}}@media (hover:hover){.joinchat__button:hover .joinchat__tooltip{opacity:1;animation:none;transition:opacity .2s}.joinchat--btn .joinchat__button:hover .joinchat__qr,.joinchat--chatbox .joinchat__button:hover .joinchat__qr{display:flex}}@media (prefers-color-scheme:dark){.joinchat--dark-auto{--msg:var(--dark)}.joinchat--dark-auto .joinchat__box__scroll{background:#1a1a1a}.joinchat--dark-auto .joinchat__header{background:var(--dark)}.joinchat--dark-auto .joinchat__optin{color:#d8d8d8}.joinchat--dark-auto .joinchat__message{background:#505050;color:#d8d8d8}}@media (prefers-reduced-motion){.joinchat{animation:none}.joinchat__button__send .joinchat_svg__plain{stroke-dasharray:0;animation:none}.joinchat__button__send .joinchat_svg__chat{animation:none}.joinchat__button__sendtext{transition:none!important}}
|
1 |
+
:root{--joinchat-ico:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M3.516 3.516c4.686-4.686 12.284-4.686 16.97 0 4.686 4.686 4.686 12.283 0 16.97a12.004 12.004 0 0 1-13.754 2.299l-5.814.735a.392.392 0 0 1-.438-.44l.748-5.788A12.002 12.002 0 0 1 3.517 3.517zm3.61 17.043.3.158a9.846 9.846 0 0 0 11.534-1.758c3.843-3.843 3.843-10.074 0-13.918-3.843-3.843-10.075-3.843-13.918 0a9.846 9.846 0 0 0-1.747 11.554l.16.303-.51 3.942a.196.196 0 0 0 .219.22l3.961-.501zm6.534-7.003-.933 1.164a9.843 9.843 0 0 1-3.497-3.495l1.166-.933a.792.792 0 0 0 .23-.94L9.561 6.96a.793.793 0 0 0-.924-.445 1291.6 1291.6 0 0 0-2.023.524.797.797 0 0 0-.588.88 11.754 11.754 0 0 0 10.005 10.005.797.797 0 0 0 .88-.587l.525-2.023a.793.793 0 0 0-.445-.923L14.6 13.327a.792.792 0 0 0-.94.23z'/%3E%3C/svg%3E");--joinchat-font:-apple-system,blinkmacsystemfont,"Segoe UI",roboto,oxygen-sans,ubuntu,cantarell,"Helvetica Neue",sans-serif}.joinchat{--bottom:20px;--sep:20px;--s:60px;--header:calc(var(--s)*1.16667);--vh:100vh;--red:37;--green:211;--blue:102;--rgb:var(--red) var(--green) var(--blue);--color:rgb(var(--rgb));--dark:rgb(calc(var(--red) - 75) calc(var(--green) - 75) calc(var(--blue) - 75));--hover:rgb(calc(var(--red) + 50) calc(var(--green) + 50) calc(var(--blue) + 50));--bg:rgb(var(--rgb)/4%);--tolerance:210;--bw:calc((var(--red)*0.2126 + var(--green)*0.7152 + var(--blue)*0.0722 - var(--tolerance))*-10000000);--text:hsl(0deg 0% calc(var(--bw)*1%)/clamp(70%,calc(var(--bw)*1%),100%));--msg:var(--color);color:var(--text);display:none;position:fixed;z-index:9000;right:var(--sep);bottom:var(--bottom);font:normal normal normal 16px/1.625em var(--joinchat-font);letter-spacing:0;animation:joinchat_show .5s cubic-bezier(.18,.89,.32,1.28) 10ms both;transform:scale3d(0,0,0);transform-origin:calc(var(--s)/-2) calc(var(--s)/-4);-webkit-user-select:none;-moz-user-select:none;user-select:none;touch-action:manipulation;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:rgb(0 0 0/0)}.joinchat *,.joinchat :after,.joinchat :before{box-sizing:border-box}.joinchat--show{display:block;transform:scaleX(1)}.joinchat--left{right:auto;left:var(--sep)}.joinchat--dark{--msg:var(--dark)}.joinchat--noanim{animation:none}.joinchat--chatbox:not(.joinchat--noanim){transform-origin:0 0;animation-timing-function:ease-in-out}.joinchat--hidden{display:none!important}@supports not (width:clamp(1px,1%,10px)){.joinchat{--text:hsl(0deg 0% calc(var(--bw)*1%)/90%)}}.joinchat__button{display:flex;flex-direction:row;position:absolute;z-index:2;bottom:8px;right:8px;height:var(--s);min-width:var(--s);max-width:95vw;background:#25d366;color:inherit;border-radius:calc(var(--s)/2);box-shadow:1px 6px 24px 0 rgba(7,94,84,.24);cursor:pointer;transition:background-color .2s linear}[dir=rtl] .joinchat__button{flex-direction:row-reverse}.joinchat__button:hover{background:#128c7e;transition-duration:1.5s}.joinchat__button:active{background:#128c7e;transition:none}.joinchat--left .joinchat__button{right:auto;left:8px;flex-direction:row-reverse}[dir=rtl] .joinchat--left .joinchat__button{flex-direction:row}.joinchat--chatbox .joinchat__button{background:var(--color);transition-duration:.2s;box-shadow:0 1px 2px 0 rgba(0,0,0,.3)}.joinchat--chatbox .joinchat__button:active,.joinchat--chatbox .joinchat__button:hover{background:var(--hover)}.joinchat--optout.joinchat--chatbox .joinchat__button{background-color:#999;opacity:.5;pointer-events:none}.joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__plain{stroke-dasharray:0;animation:none}.joinchat--optout.joinchat--chatbox .joinchat__button .joinchat_svg__chat{animation:none}.joinchat__button__open{width:var(--s);height:var(--s);border-radius:50%;background:rgb(0 0 0/0) var(--joinchat-ico) 50% no-repeat;background-size:60%;overflow:hidden}.joinchat--chatbox .joinchat__button__open{display:none}.joinchat__button__image{position:absolute;top:1px;right:1px;width:calc(var(--s) - 2px);height:calc(var(--s) - 2px);border-radius:50%;overflow:hidden;opacity:0}.joinchat__button__image img{display:block;width:100%;height:100%;object-fit:cover}.joinchat--show .joinchat__button__image{animation:joinchat_image_loop 20s linear 5s infinite normal both}.joinchat--image .joinchat__button__image{opacity:1;animation:none}.joinchat--chatbox .joinchat__button__image{display:none}.joinchat__button__send{display:none;flex-shrink:0;width:var(--s);height:var(--s);max-width:var(--s);padding:calc(var(--s)*0.18);margin:0;overflow:hidden}.joinchat--chatbox .joinchat__button__send{display:block}.joinchat__button__send path{fill:none!important;stroke:var(--text)!important}.joinchat__button__send .joinchat_svg__plain{stroke-dasharray:1097;stroke-dashoffset:1097;animation:joinchat_plain 6s .2s ease-in-out infinite}.joinchat__button__send .joinchat_svg__chat{stroke-dasharray:1020;stroke-dashoffset:1020;animation:joinchat_chat 6s 3.2s ease-in-out infinite}.joinchat__button__sendtext{padding:0;max-width:0;border-radius:var(--s);font-weight:600;line-height:var(--s);white-space:nowrap;opacity:0;overflow:hidden;transition:none}.joinchat--chatbox .joinchat__button__sendtext{padding:0 4px 0 24px;max-width:200px;opacity:1;transition:max-width .2s linear,opacity .4s ease-out .2s}.joinchat--chatbox.joinchat--left .joinchat__button__sendtext{padding:0 24px 0 4px}.joinchat__badge{position:absolute;top:-4px;right:-4px;width:20px;height:20px;border:none;border-radius:50%;background:#e82c0c;color:#fff;font-size:12px;font-weight:600;line-height:20px;text-align:center;box-shadow:none;opacity:0;pointer-events:none}.joinchat__badge.joinchat__badge--in{animation:joinchat_badge_in .5s cubic-bezier(.27,.9,.41,1.28) 1 both}.joinchat__badge.joinchat__badge--out{animation:joinchat_badge_out .4s cubic-bezier(.215,.61,.355,1) 1 both}.joinchat__tooltip{position:absolute;top:calc(var(--s)/2 - 16px);right:calc(var(--s) + 16px);max-width:calc(100vw - 105px);height:32px;padding:0 14px;border:none;border-radius:16px;background:#fff;color:rgba(0,0,0,.8);line-height:31px;white-space:nowrap;opacity:0;transition:opacity .3s ease-out .4s;filter:drop-shadow(0 1px 4px rgba(0,0,0,.4));pointer-events:none}.joinchat__tooltip:after{content:"";display:block;position:absolute;top:10px;right:-6px;border:8px solid transparent;border-width:6px 0 6px 8px;border-left-color:#fff}.joinchat__tooltip div{overflow:hidden;text-overflow:ellipsis}.joinchat--tooltip .joinchat__tooltip{animation:joinchat_tootlip 20s linear 5s 1 normal both}.joinchat--chatbox .joinchat__tooltip{display:none}.joinchat--left .joinchat__tooltip{right:auto;left:calc(var(--s) + 16px)}.joinchat--left .joinchat__tooltip:after{left:-6px;right:auto;border-color:transparent;border-width:6px 8px 6px 0;border-right-color:#fff}.joinchat__qr{position:absolute;bottom:calc(var(--s) + 16px);right:0;display:none;flex-direction:column-reverse;width:228px;min-height:200px;padding:14px 14px 10px;border:none;border-radius:16px;background:#fff;color:rgba(0,0,0,.8);text-align:center;white-space:nowrap;filter:drop-shadow(0 1px 4px rgba(0,0,0,.4));animation:joinchat_badge_in .4s cubic-bezier(.11,.84,.83,1.01) .3s both;pointer-events:none}.joinchat__qr:after{content:"";display:block;position:absolute;bottom:-6px;right:calc(var(--s)/2 - 6px);border:8px solid transparent;border-width:8px 6px 0;border-top-color:#fff}.joinchat--left .joinchat__qr{left:0;right:auto}.joinchat--left .joinchat__qr:after{left:calc(var(--s)/2 - 6px);right:auto}.joinchat__qr div{font-size:14px;color:#4a4a4a;overflow:hidden;text-overflow:ellipsis}.joinchat__qr canvas{display:block;width:200px;height:200px;margin:0}.joinchat__box{display:flex;flex-direction:column;position:absolute;bottom:0;right:0;z-index:1;width:calc(100vw - var(--sep)*2);max-width:400px;min-height:170px;max-height:calc(var(--vh) - var(--bottom) - var(--sep));border-radius:calc(var(--s)/2 + 2px);background:transparent;box-shadow:0 2px 6px 0 rgba(0,0,0,.5);text-align:left;overflow:hidden;transform:scale3d(0,0,0);opacity:0;transition:max-height .2s ease-out,opacity .4s ease-out,transform 0s linear .3s}[dir=rtl] .joinchat__box{text-align:right}.joinchat--chatbox .joinchat__box{opacity:1;transform:scaleX(1);transition:max-height .2s ease-out,opacity .2s ease-out,transform 0s linear}.joinchat--left .joinchat__box{right:auto;left:0}.joinchat__header{display:flex;flex-flow:row;align-items:center;position:relative;flex-shrink:0;height:var(--header);min-height:50px;padding:0 70px 0 26px;margin:0;background:var(--color)}[dir=rtl] .joinchat__header{padding:0 26px 0 70px}.joinchat--dark .joinchat__header{background:var(--dark)}.joinchat__header__text{font-size:19px;font-weight:600;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;opacity:.8}.joinchat__powered{font-size:11px;line-height:18px;color:inherit!important;text-decoration:none!important;fill:currentcolor;opacity:.8}.joinchat__powered svg{display:inline-block;width:auto;height:18px;vertical-align:-30%}.joinchat__powered:active,.joinchat__powered:hover{color:inherit!important;text-decoration:none!important;opacity:.9;filter:drop-shadow(0 1px 3px rgba(0,0,0,.3))}.joinchat__wa{height:28px;width:auto;fill:currentcolor;opacity:.8}.joinchat__close{--size:34px;position:absolute;top:calc(50% - var(--size)/2);right:24px;width:var(--size);height:var(--size);border-radius:50%;background:rgba(0,0,0,.4) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M24 2.4 21.6 0 12 9.6 2.4 0 0 2.4 9.6 12 0 21.6 2.4 24l9.6-9.6 9.6 9.6 2.4-2.4-9.6-9.6L24 2.4z'/%3E%3C/svg%3E") 50% no-repeat;background-size:12px;cursor:pointer;transition:background-color .3s ease-out}.joinchat__close:hover{background-color:rgba(0,0,0,.6)}.joinchat__close:active{background-color:rgba(0,0,0,.7)}[dir=rtl] .joinchat__close{right:auto;left:24px}.joinchat__box__scroll{padding:20px 0 70px;padding-bottom:calc(var(--s) + 10px);background:#fff linear-gradient(0deg,var(--bg),var(--bg));overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain}.joinchat__box__scroll::-webkit-scrollbar{width:5px;background:rgb(0 0 0/0)}.joinchat__box__scroll::-webkit-scrollbar-thumb{border-radius:3px;background:rgb(0 0 0/0)}.joinchat--blur .joinchat__box__scroll{background:rgba(var(--rgb)/2%);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.joinchat--dark .joinchat__box__scroll{background:#1a1a1a}.joinchat__box__scroll:hover::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2)}@supports (-webkit-overflow-scrolling:touch){.joinchat__box__scroll{overflow-y:scroll;-webkit-overflow-scrolling:touch}}.joinchat__optin{padding:0 16px;margin-bottom:16px;color:#4a4a4a;font-size:13px;line-height:1.33}.joinchat__optin a{display:inline;padding:0;color:inherit!important;text-decoration:underline}.joinchat__optin a:hover{text-decoration-thickness:2px}.joinchat__optin input{position:absolute;visibility:hidden}.joinchat__optin label{position:relative;display:block;margin:0;padding:0 0 0 30px;color:inherit;font:inherit;cursor:pointer}.joinchat__optin label:before{content:"";display:block;position:absolute;top:calc(50% - 11px);left:0;width:22px;height:22px;border:3px solid var(--color);border-radius:4px;box-shadow:0 0 0 1px var(--text);transition:box-shadow .3s ease-in-out}.joinchat__optin label:after{content:"";display:none;position:absolute;top:calc(50% - 8px);left:8px;width:6px;height:14px;border:solid var(--text);border-width:0 3px 3px 0;transform:rotate(45deg)}[dir=rtl] .joinchat__optin label{padding:0 30px 0 0}[dir=rtl] .joinchat__optin label:before{left:auto;right:0}[dir=rtl] .joinchat__optin label:after{left:auto;right:8px}.joinchat__optin input:checked+label:before{box-shadow:0 0 0 1px var(--text),inset 0 0 0 10px var(--color)}.joinchat__optin input:checked+label:after{display:block}.joinchat--dark .joinchat__optin{color:#d8d8d8}.joinchat__message{position:relative;min-height:60px;padding:17px 20px;margin:0 26px 26px;border-radius:32px;background:#fff;color:#4a4a4a;word-break:break-word;filter:drop-shadow(0 1px 2px rgba(0,0,0,.3));transform:translateZ(0)}.joinchat__message:before{content:"";display:block;position:absolute;bottom:20px;left:-15px;width:17px;height:25px;background:inherit;-webkit-clip-path:var(--peak,url(#joinchat__message__peak));clip-path:var(--peak,url(#joinchat__message__peak))}.joinchat--dark .joinchat__message{background:#505050;color:#d8d8d8}@keyframes joinchat_show{0%{transform:scale3d(0,0,0)}to{transform:scaleX(1)}}@keyframes joinchat_badge_in{0%{opacity:0;transform:translate3d(0,50px,0)}to{opacity:1;transform:translateZ(0)}}@keyframes joinchat_badge_out{0%{opacity:1;transform:translateZ(0)}to{opacity:0;transform:translate3d(0,-20px,0)}}@keyframes joinchat_plain{0%,50%,to{stroke-dashoffset:1097}5%,45%{stroke-dashoffset:0}}@keyframes joinchat_chat{0%,50%,to{stroke-dashoffset:1020}5%,45%{stroke-dashoffset:0}}@keyframes joinchat_image_loop{0%{opacity:0}3%,20%{opacity:1}25%,to{opacity:0}}@keyframes joinchat_tootlip{0%{opacity:0;transform:scaleY(0)}1%,20%{opacity:1;transform:scaleX(1)}25%,to{opacity:0;transform:scaleX(1)}}.joinchat__woo-btn__wrapper{clear:both}.joinchat__woo-btn{--s:40px;display:inline-block;box-sizing:border-box;height:var(--s);max-width:100%;padding:0 calc(var(--s)/2) 0 var(--s);background:#25d366 var(--joinchat-ico) calc(var(--s)*0.2) 50% no-repeat;background-size:calc(var(--s)*0.6);color:#fff;border-radius:calc(var(--s)/2);font:700 normal calc(var(--s)*0.35)/var(--s) var(--joinchat-font);white-space:nowrap;text-overflow:ellipsis;overflow:hidden;cursor:pointer;transition:background-color .2s}.joinchat__woo-btn:empty{padding-right:0}.joinchat__woo-btn:hover{background-color:#128c7e}@media (orientation:landscape) and (min-height:481px),(orientation:portrait) and (min-width:481px){.joinchat--mobile{display:none!important}}@media (max-width:767px){.joinchat--footer-bar{--bottom:76px!important}}@media (max-width:480px),(orientation:landscape) and (max-height:480px){.joinchat{--bottom:6px;--sep:6px;--header:calc(var(--s)*0.91667)}.joinchat__header__text{font-size:17px}.joinchat__close{--size:28px}.joinchat__box__scroll{padding-top:15px}.joinchat__message{padding:18px 16px;line-height:24px;margin:0 20px 20px}}@media (hover:hover){.joinchat__button:hover .joinchat__tooltip{opacity:1;animation:none;transition:opacity .2s}.joinchat--btn .joinchat__button:hover .joinchat__qr,.joinchat--chatbox .joinchat__button:hover .joinchat__qr{display:flex}}@media (prefers-color-scheme:dark){.joinchat--dark-auto{--msg:var(--dark)}.joinchat--dark-auto .joinchat__box__scroll{background:#1a1a1a}.joinchat--dark-auto .joinchat__header{background:var(--dark)}.joinchat--dark-auto .joinchat__optin{color:#d8d8d8}.joinchat--dark-auto .joinchat__message{background:#505050;color:#d8d8d8}}@media (prefers-reduced-motion){.joinchat{animation:none}.joinchat__button__send .joinchat_svg__plain{stroke-dasharray:0;animation:none}.joinchat__button__send .joinchat_svg__chat{animation:none}.joinchat__button__sendtext{transition:none!important}}
|
public/js/joinchat-lite.js
CHANGED
@@ -6,8 +6,19 @@
|
|
6 |
is_mobile: !!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),
|
7 |
}, win.joinchat_obj || {});
|
8 |
|
9 |
-
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
params = $.extend({
|
12 |
event_category: 'JoinChat', // Name
|
13 |
event_label: '', // Destination url
|
@@ -25,11 +36,7 @@
|
|
25 |
// Trigger event (params can be edited by third party scripts or cancel if return false)
|
26 |
if (false === $(doc).triggerHandler('joinchat:event', [params])) return;
|
27 |
|
28 |
-
// Can pass setting 'ga_tracker' for custom UA tracker name
|
29 |
-
// Compatible with GADP for WordPress by MonsterInsights tracker name
|
30 |
var ga_tracker = win[this.settings.ga_tracker] || win['ga'] || win['__gaTracker'];
|
31 |
-
// Can pass setting 'data_layer' for custom data layer name
|
32 |
-
// Compatible with GTM4WP custom DataLayer name
|
33 |
var data_layer = win[this.settings.data_layer] || win[win.gtm4wp_datalayer_name] || win['dataLayer'];
|
34 |
|
35 |
// Send Google Analytics custom event (Universal Analytics - analytics.js)
|
@@ -47,15 +54,16 @@
|
|
47 |
// gtag.js
|
48 |
if (typeof gtag == 'function' && typeof data_layer == 'object') {
|
49 |
// Google Analytics 4 send recomended event "generate_lead"
|
|
|
50 |
var ga4_params = $.extend({ transport_type: 'beacon' }, params);
|
51 |
// Already defined in GA4
|
52 |
delete ga4_params.page_location;
|
53 |
delete ga4_params.page_title;
|
54 |
|
55 |
data_layer.forEach(function (item) {
|
56 |
-
if (item[0] == 'config' && item[1].substring(0, 2) == 'G-') {
|
57 |
ga4_params.send_to = item[1];
|
58 |
-
gtag('event',
|
59 |
}
|
60 |
});
|
61 |
|
6 |
is_mobile: !!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i),
|
7 |
}, win.joinchat_obj || {});
|
8 |
|
9 |
+
/**
|
10 |
+
* Trigger Analytics events
|
11 |
+
*
|
12 |
+
* Available customizations via joinchat_obj.settings:
|
13 |
+
* - 'ga_tracker' for custom UA tracker name (default 'ga' or GADP by MonsterInsights '__gaTracker')
|
14 |
+
* - 'data_layer' for custom data layer name (default 'dataLayer' or GTM4WP custom DataLayer name)
|
15 |
+
* - 'ga_event' for GA4 custom event (default 'generate_lead' recommended event)
|
16 |
+
*
|
17 |
+
* All params can be edited with document event 'joinchat:event' or cancel if returns false.
|
18 |
+
* e.g.: $(document).on('joinchat:event', function(){ return false; });
|
19 |
+
*
|
20 |
+
*/
|
21 |
+
joinchat_obj.send_event = function (params) {
|
22 |
params = $.extend({
|
23 |
event_category: 'JoinChat', // Name
|
24 |
event_label: '', // Destination url
|
36 |
// Trigger event (params can be edited by third party scripts or cancel if return false)
|
37 |
if (false === $(doc).triggerHandler('joinchat:event', [params])) return;
|
38 |
|
|
|
|
|
39 |
var ga_tracker = win[this.settings.ga_tracker] || win['ga'] || win['__gaTracker'];
|
|
|
|
|
40 |
var data_layer = win[this.settings.data_layer] || win[win.gtm4wp_datalayer_name] || win['dataLayer'];
|
41 |
|
42 |
// Send Google Analytics custom event (Universal Analytics - analytics.js)
|
54 |
// gtag.js
|
55 |
if (typeof gtag == 'function' && typeof data_layer == 'object') {
|
56 |
// Google Analytics 4 send recomended event "generate_lead"
|
57 |
+
var ga4_event = this.settings.ga_event || 'generate_lead';
|
58 |
var ga4_params = $.extend({ transport_type: 'beacon' }, params);
|
59 |
// Already defined in GA4
|
60 |
delete ga4_params.page_location;
|
61 |
delete ga4_params.page_title;
|
62 |
|
63 |
data_layer.forEach(function (item) {
|
64 |
+
if (item[0] == 'config' && item[1] && item[1].substring(0, 2) == 'G-') {
|
65 |
ga4_params.send_to = item[1];
|
66 |
+
gtag('event', ga4_event, ga4_params);
|
67 |
}
|
68 |
});
|
69 |
|
public/js/joinchat-lite.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(i,s,c){"use strict";s.joinchat_obj=i.extend({settings:null,is_mobile:!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i)},s.joinchat_obj||{}),joinchat_obj.send_event=function(n){var t,e,a,o;(n=i.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"},n)).event_label=n.event_label||n.link||"",n.event_action=n.event_action||n.chat_channel+": "+n.chat_id,delete n.link,!1!==i(c).triggerHandler("joinchat:event",[n])&&(o=s[this.settings.ga_tracker]||s.ga||s.__gaTracker,t=s[this.settings.data_layer]||s[s.gtm4wp_datalayer_name]||s.dataLayer,"function"==typeof o&&"function"==typeof o.getAll&&(o("set","transport","beacon"),o.getAll().forEach(function(t){t.send("event",n.event_category,n.event_action,n.event_label)})),i.each(n,function(t,e){n[t]="string"==typeof e?e.substring(0,100):e}),"function"==typeof gtag&&"object"==typeof t&&(e=this.settings.ga_event||"generate_lead",delete(a=i.extend({transport_type:"beacon"},n)).page_location,delete a.page_title,t.forEach(function(t){"config"==t[0]&&t[1]&&"G-"==t[1].substring(0,2)&&(a.send_to=t[1],gtag("event",e,a))}),this.settings.gads&>ag("event","conversion",{send_to:this.settings.gads})),o=n.event_category,delete n.event_category,"object"==typeof t&&t.push(i.extend({event:o},n)),"function"==typeof fbq&&fbq("trackCustom",o,n))},joinchat_obj.whatsapp_link=function(t,e,n){return e=void 0!==e?e:this.settings.message_send||"",((n=void 0!==n?n:this.settings.whatsapp_web&&!this.is_mobile)?"https://web.whatsapp.com/send?phone=":"https://wa.me/")+encodeURIComponent(t||this.settings.telephone)+(e?(n?"&text=":"?text=")+encodeURIComponent(e):"")},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!==i(c).triggerHandler("joinchat:open",[t])&&(e.test(t.link)?(this.send_event(t),s.open(t.link,"joinchat","noopener")):console.error("Joinchat: the link doesn't seem safe, it must point to the current domain or whatsapp.com"))},i(c).on("click",'.joinchat_open, .joinchat_app, a[href="#joinchat"], a[href="#whatsapp"]',function(t){t.preventDefault(),joinchat_obj.open_whatsapp(i(this).data("phone"),i(this).data("message"))}),"function"!=typeof kjua||joinchat_obj.is_mobile?i(".wp-block-joinchat-button figure").remove():i(".joinchat-button__qr").each(function(){i(this).kjua({text:joinchat_obj.whatsapp_link(i(this).data("phone"),i(this).data("message"),!1),render:"canvas",rounded:80})})}(jQuery,window,document);
|
public/js/joinchat.js
CHANGED
@@ -14,7 +14,18 @@
|
|
14 |
return $(sel || this.$div, this.$div);
|
15 |
};
|
16 |
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
joinchat_obj.send_event = function (params) {
|
19 |
params = $.extend({
|
20 |
event_category: 'JoinChat', // Name
|
@@ -33,11 +44,7 @@
|
|
33 |
// Trigger event (params can be edited by third party scripts or cancel if return false)
|
34 |
if (false === $(doc).triggerHandler('joinchat:event', [params])) return;
|
35 |
|
36 |
-
// Can pass setting 'ga_tracker' for custom UA tracker name
|
37 |
-
// Compatible with GADP for WordPress by MonsterInsights tracker name
|
38 |
var ga_tracker = win[this.settings.ga_tracker] || win['ga'] || win['__gaTracker'];
|
39 |
-
// Can pass setting 'data_layer' for custom data layer name
|
40 |
-
// Compatible with GTM4WP custom DataLayer name
|
41 |
var data_layer = win[this.settings.data_layer] || win[win.gtm4wp_datalayer_name] || win['dataLayer'];
|
42 |
|
43 |
// Send Google Analytics custom event (Universal Analytics - analytics.js)
|
@@ -55,15 +62,16 @@
|
|
55 |
// gtag.js
|
56 |
if (typeof gtag == 'function' && typeof data_layer == 'object') {
|
57 |
// Google Analytics 4 send recomended event "generate_lead"
|
|
|
58 |
var ga4_params = $.extend({ transport_type: 'beacon' }, params);
|
59 |
// Already defined in GA4
|
60 |
delete ga4_params.page_location;
|
61 |
delete ga4_params.page_title;
|
62 |
|
63 |
data_layer.forEach(function (item) {
|
64 |
-
if (item[0] == 'config' && item[1].substring(0, 2) == 'G-') {
|
65 |
ga4_params.send_to = item[1];
|
66 |
-
gtag('event',
|
67 |
}
|
68 |
});
|
69 |
|
14 |
return $(sel || this.$div, this.$div);
|
15 |
};
|
16 |
|
17 |
+
/**
|
18 |
+
* Trigger Analytics events
|
19 |
+
*
|
20 |
+
* Available customizations via joinchat_obj.settings:
|
21 |
+
* - 'ga_tracker' for custom UA tracker name (default 'ga' or GADP by MonsterInsights '__gaTracker')
|
22 |
+
* - 'data_layer' for custom data layer name (default 'dataLayer' or GTM4WP custom DataLayer name)
|
23 |
+
* - 'ga_event' for GA4 custom event (default 'generate_lead' recommended event)
|
24 |
+
*
|
25 |
+
* All params can be edited with document event 'joinchat:event' or cancel if returns false.
|
26 |
+
* e.g.: $(document).on('joinchat:event', function(){ return false; });
|
27 |
+
*
|
28 |
+
*/
|
29 |
joinchat_obj.send_event = function (params) {
|
30 |
params = $.extend({
|
31 |
event_category: 'JoinChat', // Name
|
44 |
// Trigger event (params can be edited by third party scripts or cancel if return false)
|
45 |
if (false === $(doc).triggerHandler('joinchat:event', [params])) return;
|
46 |
|
|
|
|
|
47 |
var ga_tracker = win[this.settings.ga_tracker] || win['ga'] || win['__gaTracker'];
|
|
|
|
|
48 |
var data_layer = win[this.settings.data_layer] || win[win.gtm4wp_datalayer_name] || win['dataLayer'];
|
49 |
|
50 |
// Send Google Analytics custom event (Universal Analytics - analytics.js)
|
62 |
// gtag.js
|
63 |
if (typeof gtag == 'function' && typeof data_layer == 'object') {
|
64 |
// Google Analytics 4 send recomended event "generate_lead"
|
65 |
+
var ga4_event = this.settings.ga_event || 'generate_lead';
|
66 |
var ga4_params = $.extend({ transport_type: 'beacon' }, params);
|
67 |
// Already defined in GA4
|
68 |
delete ga4_params.page_location;
|
69 |
delete ga4_params.page_title;
|
70 |
|
71 |
data_layer.forEach(function (item) {
|
72 |
+
if (item[0] == 'config' && item[1] && item[1].substring(0, 2) == 'G-') {
|
73 |
ga4_params.send_to = item[1];
|
74 |
+
gtag('event', ga4_event, ga4_params);
|
75 |
}
|
76 |
});
|
77 |
|
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<(
|
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&>ag("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);
|
public/partials/html.php
CHANGED
@@ -12,11 +12,11 @@
|
|
12 |
defined( 'WPINC' ) || exit;
|
13 |
?>
|
14 |
|
15 |
-
<div class="joinchat <?php echo esc_attr( join( ' ', $joinchat_classes ) ); ?>" data-settings='<?php echo JoinChatUtil::to_json( $data ); ?>'>
|
16 |
<div class="joinchat__button">
|
17 |
<div class="joinchat__button__open"></div>
|
18 |
<?php if ( $image ) : ?>
|
19 |
-
<div class="joinchat__button__image"><?php echo $image; ?></div>
|
20 |
<?php endif; ?>
|
21 |
<?php if ( $box_content ) : ?>
|
22 |
<?php if ( $settings['message_start'] ) : ?>
|
@@ -34,7 +34,7 @@ defined( 'WPINC' ) || exit;
|
|
34 |
<div class="joinchat__tooltip"><div><?php echo esc_html( $settings['button_tip'] ); ?></div></div>
|
35 |
<?php endif; ?>
|
36 |
<?php if ( $settings['qr'] ) : ?>
|
37 |
-
<div class="joinchat__qr"><div><?php
|
38 |
<?php endif; ?>
|
39 |
</div>
|
40 |
<?php if ( $box_content ) : ?>
|
@@ -42,18 +42,18 @@ defined( 'WPINC' ) || exit;
|
|
42 |
<div class="joinchat__header">
|
43 |
<?php if ( '__jc__' === $settings['header'] ) : ?>
|
44 |
<a class="joinchat__powered" href="<?php echo esc_url( $powered_link ); ?>" rel="nofollow noopener" target="_blank">
|
45 |
-
<?php
|
46 |
</a>
|
47 |
<?php elseif ( '__wa__' === $settings['header'] ) : ?>
|
48 |
<svg class="joinchat__wa" width="120" height="28" viewBox="0 0 120 28"><title>WhatsApp</title><path d="M117.2 17c0 .4-.2.7-.4 1-.1.3-.4.5-.7.7l-1 .2c-.5 0-.9 0-1.2-.2l-.7-.7a3 3 0 0 1-.4-1 5.4 5.4 0 0 1 0-2.3c0-.4.2-.7.4-1l.7-.7a2 2 0 0 1 1.1-.3 2 2 0 0 1 1.8 1l.4 1a5.3 5.3 0 0 1 0 2.3zm2.5-3c-.1-.7-.4-1.3-.8-1.7a4 4 0 0 0-1.3-1.2c-.6-.3-1.3-.4-2-.4-.6 0-1.2.1-1.7.4a3 3 0 0 0-1.2 1.1V11H110v13h2.7v-4.5c.4.4.8.8 1.3 1 .5.3 1 .4 1.6.4a4 4 0 0 0 3.2-1.5c.4-.5.7-1 .8-1.6.2-.6.3-1.2.3-1.9s0-1.3-.3-2zm-13.1 3c0 .4-.2.7-.4 1l-.7.7-1.1.2c-.4 0-.8 0-1-.2-.4-.2-.6-.4-.8-.7a3 3 0 0 1-.4-1 5.4 5.4 0 0 1 0-2.3c0-.4.2-.7.4-1 .1-.3.4-.5.7-.7a2 2 0 0 1 1-.3 2 2 0 0 1 1.9 1l.4 1a5.4 5.4 0 0 1 0 2.3zm1.7-4.7a4 4 0 0 0-3.3-1.6c-.6 0-1.2.1-1.7.4a3 3 0 0 0-1.2 1.1V11h-2.6v13h2.7v-4.5c.3.4.7.8 1.2 1 .6.3 1.1.4 1.7.4a4 4 0 0 0 3.2-1.5c.4-.5.6-1 .8-1.6.2-.6.3-1.2.3-1.9s-.1-1.3-.3-2c-.2-.6-.4-1.2-.8-1.6zm-17.5 3.2l1.7-5 1.7 5h-3.4zm.2-8.2l-5 13.4h3l1-3h5l1 3h3L94 7.3h-3zm-5.3 9.1l-.6-.8-1-.5a11.6 11.6 0 0 0-2.3-.5l-1-.3a2 2 0 0 1-.6-.3.7.7 0 0 1-.3-.6c0-.2 0-.4.2-.5l.3-.3h.5l.5-.1c.5 0 .9 0 1.2.3.4.1.6.5.6 1h2.5c0-.6-.2-1.1-.4-1.5a3 3 0 0 0-1-1 4 4 0 0 0-1.3-.5 7.7 7.7 0 0 0-3 0c-.6.1-1 .3-1.4.5l-1 1a3 3 0 0 0-.4 1.5 2 2 0 0 0 1 1.8l1 .5 1.1.3 2.2.6c.6.2.8.5.8 1l-.1.5-.4.4a2 2 0 0 1-.6.2 2.8 2.8 0 0 1-1.4 0 2 2 0 0 1-.6-.3l-.5-.5-.2-.8H77c0 .7.2 1.2.5 1.6.2.5.6.8 1 1 .4.3.9.5 1.4.6a8 8 0 0 0 3.3 0c.5 0 1-.2 1.4-.5a3 3 0 0 0 1-1c.3-.5.4-1 .4-1.6 0-.5 0-.9-.3-1.2zM74.7 8h-2.6v3h-1.7v1.7h1.7v5.8c0 .5 0 .9.2 1.2l.7.7 1 .3a7.8 7.8 0 0 0 2 0h.7v-2.1a3.4 3.4 0 0 1-.8 0l-1-.1-.2-1v-4.8h2V11h-2V8zm-7.6 9v.5l-.3.8-.7.6c-.2.2-.7.2-1.2.2h-.6l-.5-.2a1 1 0 0 1-.4-.4l-.1-.6.1-.6.4-.4.5-.3a4.8 4.8 0 0 1 1.2-.2 8.3 8.3 0 0 0 1.2-.2l.4-.3v1zm2.6 1.5v-5c0-.6 0-1.1-.3-1.5l-1-.8-1.4-.4a10.9 10.9 0 0 0-3.1 0l-1.5.6c-.4.2-.7.6-1 1a3 3 0 0 0-.5 1.5h2.7c0-.5.2-.9.5-1a2 2 0 0 1 1.3-.4h.6l.6.2.3.4.2.7c0 .3 0 .5-.3.6-.1.2-.4.3-.7.4l-1 .1a21.9 21.9 0 0 0-2.4.4l-1 .5c-.3.2-.6.5-.8.9-.2.3-.3.8-.3 1.3s.1 1 .3 1.3c.1.4.4.7.7 1l1 .4c.4.2.9.2 1.3.2a6 6 0 0 0 1.8-.2c.6-.2 1-.5 1.5-1a4 4 0 0 0 .2 1H70l-.3-1v-1.2zm-11-6.7c-.2-.4-.6-.6-1-.8-.5-.2-1-.3-1.8-.3-.5 0-1 .1-1.5.4a3 3 0 0 0-1.3 1.2v-5h-2.7v13.4H53v-5.1c0-1 .2-1.7.5-2.2.3-.4.9-.6 1.6-.6.6 0 1 .2 1.3.6.3.4.4 1 .4 1.8v5.5h2.7v-6c0-.6 0-1.2-.2-1.6 0-.5-.3-1-.5-1.3zm-14 4.7l-2.3-9.2h-2.8l-2.3 9-2.2-9h-3l3.6 13.4h3l2.2-9.2 2.3 9.2h3l3.6-13.4h-3l-2.1 9.2zm-24.5.2L18 15.6c-.3-.1-.6-.2-.8.2A20 20 0 0 1 16 17c-.2.2-.4.3-.7.1-.4-.2-1.5-.5-2.8-1.7-1-1-1.7-2-2-2.4-.1-.4 0-.5.2-.7l.5-.6.4-.6v-.6L10.4 8c-.3-.6-.6-.5-.8-.6H9c-.2 0-.6.1-.9.5C7.8 8.2 7 9 7 10.7c0 1.7 1.3 3.4 1.4 3.6.2.3 2.5 3.7 6 5.2l1.9.8c.8.2 1.6.2 2.2.1.6-.1 2-.8 2.3-1.6.3-.9.3-1.5.2-1.7l-.7-.4zM14 25.3c-2 0-4-.5-5.8-1.6l-.4-.2-4.4 1.1 1.2-4.2-.3-.5A11.5 11.5 0 0 1 22.1 5.7 11.5 11.5 0 0 1 14 25.3zM14 0A13.8 13.8 0 0 0 2 20.7L0 28l7.3-2A13.8 13.8 0 1 0 14 0z"/></svg>
|
49 |
<?php elseif ( '' !== $settings['header'] ) : ?>
|
50 |
<span class="joinchat__header__text"><?php echo esc_html( $settings['header'] ); ?></span>
|
51 |
<?php endif; ?>
|
52 |
-
<div class="joinchat__close" aria-label="<?php
|
53 |
</div>
|
54 |
<div class="joinchat__box__scroll">
|
55 |
<div class="joinchat__box__content">
|
56 |
-
<?php echo $box_content; ?>
|
57 |
</div>
|
58 |
</div>
|
59 |
</div>
|
12 |
defined( 'WPINC' ) || exit;
|
13 |
?>
|
14 |
|
15 |
+
<div class="joinchat <?php echo esc_attr( join( ' ', $joinchat_classes ) ); ?>" data-settings='<?php echo JoinChatUtil::to_json( $data ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>'>
|
16 |
<div class="joinchat__button">
|
17 |
<div class="joinchat__button__open"></div>
|
18 |
<?php if ( $image ) : ?>
|
19 |
+
<div class="joinchat__button__image"><?php echo $image; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
|
20 |
<?php endif; ?>
|
21 |
<?php if ( $box_content ) : ?>
|
22 |
<?php if ( $settings['message_start'] ) : ?>
|
34 |
<div class="joinchat__tooltip"><div><?php echo esc_html( $settings['button_tip'] ); ?></div></div>
|
35 |
<?php endif; ?>
|
36 |
<?php if ( $settings['qr'] ) : ?>
|
37 |
+
<div class="joinchat__qr"><div><?php esc_html_e( 'Scan the code', 'creame-whatsapp-me' ); ?></div></div>
|
38 |
<?php endif; ?>
|
39 |
</div>
|
40 |
<?php if ( $box_content ) : ?>
|
42 |
<div class="joinchat__header">
|
43 |
<?php if ( '__jc__' === $settings['header'] ) : ?>
|
44 |
<a class="joinchat__powered" href="<?php echo esc_url( $powered_link ); ?>" rel="nofollow noopener" target="_blank">
|
45 |
+
<?php esc_html_e( 'Powered by', 'creame-whatsapp-me' ); ?> <svg width="81" height="18" viewbox="0 0 1424 318"><title>Joinchat</title><path d="m171 7 6 2 3 3v5l-1 8a947 947 0 0 0-2 56v53l1 24v31c0 22-6 43-18 63-11 19-27 35-48 48s-44 18-69 18c-14 0-24-3-32-8-7-6-11-13-11-23a26 26 0 0 1 26-27c7 0 13 2 19 6l12 12 1 1a97 97 0 0 0 10 13c4 4 7 6 10 6 4 0 7-2 10-6l6-23v-1c2-12 3-28 3-48V76l-1-3-3-1h-1l-11-2c-2-1-3-3-3-7s1-6 3-7a434 434 0 0 0 90-49zm1205 43c4 0 6 1 6 3l3 36a1888 1888 0 0 0 34 0h1l3 2 1 8-1 8-3 1h-35v62c0 14 2 23 5 28 3 6 9 8 16 8l5-1 3-1c2 0 3 1 5 3s3 4 2 6c-4 10-11 19-22 27-10 8-22 12-36 12-16 0-28-5-37-15l-8-13v1h-1c-17 17-33 26-47 26-18 0-31-13-39-39-5 12-12 22-21 29s-19 10-31 10c-11 0-21-4-29-13-7-8-11-18-11-30 0-10 2-17 5-23s9-11 17-15c13-7 35-14 67-21h1v-11c0-11-2-19-5-26-4-6-8-9-14-9-3 0-5 1-5 4v1l-2 15c-2 11-6 19-11 24-6 6-14 8-23 8-5 0-9-1-13-4-3-3-5-8-5-13 0-11 9-22 26-33s38-17 60-17c41 0 62 15 62 46v58l1 11 2 8 2 3h4l5-3 1-1-1-13v-88l-3-2-12-1c-1 0-2-3-2-7s1-6 2-6c16-4 29-9 40-15 10-6 20-15 31-25 1-2 4-3 7-3zM290 88c28 0 50 7 67 22 17 14 25 34 25 58 0 26-9 46-27 61s-42 22-71 22c-28 0-50-7-67-22a73 73 0 0 1-25-58c0-26 9-46 27-61s42-22 71-22zm588 0c19 0 34 4 45 12 11 9 17 18 17 29 0 6-3 11-7 15s-10 6-17 6c-13 0-24-8-33-25-5-11-10-18-13-21s-6-5-9-5c-8 0-11 6-11 17a128 128 0 0 0 32 81c8 8 16 12 25 12 8 0 16-3 24-10 1-1 3 0 6 2 2 2 3 3 3 5-5 12-15 23-29 32s-30 13-48 13c-24 0-43-7-58-22a78 78 0 0 1-22-58c0-25 9-45 27-60s41-23 68-23zm-402-3 5 2 3 3-1 10a785 785 0 0 0-2 53v76c1 3 2 4 4 4l11 3 11-3c3 0 4-1 4-4v-82l-1-2-3-2-11-1-2-6c0-4 1-6 2-6a364 364 0 0 0 77-44l5 2 3 3v12a393 393 0 0 0-1 21c5-10 12-18 22-25 9-8 21-11 34-11 16 0 29 5 38 14 10 9 14 22 14 39v88c0 3 2 4 4 4l11 3c1 0 2 2 2 6 0 5-1 7-2 7h-1a932 932 0 0 1-49-2 462 462 0 0 0-48 2c-2 0-3-2-3-7 0-3 1-6 3-6l8-3 3-1 1-3v-62c0-14-2-24-6-29-4-6-12-9-22-9l-7 1v99l1 3 3 1 8 3h1l2 6c0 5-1 7-3 7a783 783 0 0 1-47-2 512 512 0 0 0-51 2h-1a895 895 0 0 1-49-2 500 500 0 0 0-50 2c-1 0-2-2-2-7 0-4 1-6 2-6l11-3c2 0 3-1 4-4v-82l-1-3-3-1-11-2c-1 0-2-2-2-6l2-6a380 380 0 0 0 80-44zm539-75 5 2 3 3-1 9a758 758 0 0 0-2 55v42h1c5-9 12-16 21-22 9-7 20-10 32-10 16 0 29 5 38 14 10 9 14 22 14 39v88c0 2 2 3 4 4l11 2c1 0 2 2 2 7 0 4-1 6-2 6h-1a937 937 0 0 1-49-2 466 466 0 0 0-48 2c-2 0-3-2-3-6s1-7 3-7l8-2 3-2 1-3v-61c0-14-2-24-6-29-4-6-12-9-22-9l-7 1v99l1 2 3 2 8 2h1c1 1 2 3 2 7s-1 6-3 6a788 788 0 0 1-47-2 517 517 0 0 0-51 2c-1 0-2-2-2-6 0-5 1-7 2-7l11-2c3-1 4-2 4-5V71l-1-3-3-1-11-2c-1 0-2-2-2-6l2-6a387 387 0 0 0 81-43zm-743 90c-8 0-12 7-12 20a266 266 0 0 0 33 116c3 3 6 4 9 4 8 0 12-6 12-20 0-17-4-38-11-65-8-27-15-44-22-50-3-4-6-5-9-5zm939 65c-6 0-9 4-9 13 0 8 2 16 7 22 5 7 10 10 15 10l6-2v-22c0-6-2-11-7-15-4-4-8-6-12-6zM451 0c10 0 18 3 25 10s10 16 10 26a35 35 0 0 1-35 36c-11 0-19-4-26-10-7-7-10-16-10-26s3-19 10-26 15-10 26-10zm297 249c9 0 16-3 22-8 6-6 9-12 9-20s-3-15-9-21-13-8-22-8-16 3-22 8-9 12-9 21 3 14 9 20 13 8 22 8z"/></svg>
|
46 |
</a>
|
47 |
<?php elseif ( '__wa__' === $settings['header'] ) : ?>
|
48 |
<svg class="joinchat__wa" width="120" height="28" viewBox="0 0 120 28"><title>WhatsApp</title><path d="M117.2 17c0 .4-.2.7-.4 1-.1.3-.4.5-.7.7l-1 .2c-.5 0-.9 0-1.2-.2l-.7-.7a3 3 0 0 1-.4-1 5.4 5.4 0 0 1 0-2.3c0-.4.2-.7.4-1l.7-.7a2 2 0 0 1 1.1-.3 2 2 0 0 1 1.8 1l.4 1a5.3 5.3 0 0 1 0 2.3zm2.5-3c-.1-.7-.4-1.3-.8-1.7a4 4 0 0 0-1.3-1.2c-.6-.3-1.3-.4-2-.4-.6 0-1.2.1-1.7.4a3 3 0 0 0-1.2 1.1V11H110v13h2.7v-4.5c.4.4.8.8 1.3 1 .5.3 1 .4 1.6.4a4 4 0 0 0 3.2-1.5c.4-.5.7-1 .8-1.6.2-.6.3-1.2.3-1.9s0-1.3-.3-2zm-13.1 3c0 .4-.2.7-.4 1l-.7.7-1.1.2c-.4 0-.8 0-1-.2-.4-.2-.6-.4-.8-.7a3 3 0 0 1-.4-1 5.4 5.4 0 0 1 0-2.3c0-.4.2-.7.4-1 .1-.3.4-.5.7-.7a2 2 0 0 1 1-.3 2 2 0 0 1 1.9 1l.4 1a5.4 5.4 0 0 1 0 2.3zm1.7-4.7a4 4 0 0 0-3.3-1.6c-.6 0-1.2.1-1.7.4a3 3 0 0 0-1.2 1.1V11h-2.6v13h2.7v-4.5c.3.4.7.8 1.2 1 .6.3 1.1.4 1.7.4a4 4 0 0 0 3.2-1.5c.4-.5.6-1 .8-1.6.2-.6.3-1.2.3-1.9s-.1-1.3-.3-2c-.2-.6-.4-1.2-.8-1.6zm-17.5 3.2l1.7-5 1.7 5h-3.4zm.2-8.2l-5 13.4h3l1-3h5l1 3h3L94 7.3h-3zm-5.3 9.1l-.6-.8-1-.5a11.6 11.6 0 0 0-2.3-.5l-1-.3a2 2 0 0 1-.6-.3.7.7 0 0 1-.3-.6c0-.2 0-.4.2-.5l.3-.3h.5l.5-.1c.5 0 .9 0 1.2.3.4.1.6.5.6 1h2.5c0-.6-.2-1.1-.4-1.5a3 3 0 0 0-1-1 4 4 0 0 0-1.3-.5 7.7 7.7 0 0 0-3 0c-.6.1-1 .3-1.4.5l-1 1a3 3 0 0 0-.4 1.5 2 2 0 0 0 1 1.8l1 .5 1.1.3 2.2.6c.6.2.8.5.8 1l-.1.5-.4.4a2 2 0 0 1-.6.2 2.8 2.8 0 0 1-1.4 0 2 2 0 0 1-.6-.3l-.5-.5-.2-.8H77c0 .7.2 1.2.5 1.6.2.5.6.8 1 1 .4.3.9.5 1.4.6a8 8 0 0 0 3.3 0c.5 0 1-.2 1.4-.5a3 3 0 0 0 1-1c.3-.5.4-1 .4-1.6 0-.5 0-.9-.3-1.2zM74.7 8h-2.6v3h-1.7v1.7h1.7v5.8c0 .5 0 .9.2 1.2l.7.7 1 .3a7.8 7.8 0 0 0 2 0h.7v-2.1a3.4 3.4 0 0 1-.8 0l-1-.1-.2-1v-4.8h2V11h-2V8zm-7.6 9v.5l-.3.8-.7.6c-.2.2-.7.2-1.2.2h-.6l-.5-.2a1 1 0 0 1-.4-.4l-.1-.6.1-.6.4-.4.5-.3a4.8 4.8 0 0 1 1.2-.2 8.3 8.3 0 0 0 1.2-.2l.4-.3v1zm2.6 1.5v-5c0-.6 0-1.1-.3-1.5l-1-.8-1.4-.4a10.9 10.9 0 0 0-3.1 0l-1.5.6c-.4.2-.7.6-1 1a3 3 0 0 0-.5 1.5h2.7c0-.5.2-.9.5-1a2 2 0 0 1 1.3-.4h.6l.6.2.3.4.2.7c0 .3 0 .5-.3.6-.1.2-.4.3-.7.4l-1 .1a21.9 21.9 0 0 0-2.4.4l-1 .5c-.3.2-.6.5-.8.9-.2.3-.3.8-.3 1.3s.1 1 .3 1.3c.1.4.4.7.7 1l1 .4c.4.2.9.2 1.3.2a6 6 0 0 0 1.8-.2c.6-.2 1-.5 1.5-1a4 4 0 0 0 .2 1H70l-.3-1v-1.2zm-11-6.7c-.2-.4-.6-.6-1-.8-.5-.2-1-.3-1.8-.3-.5 0-1 .1-1.5.4a3 3 0 0 0-1.3 1.2v-5h-2.7v13.4H53v-5.1c0-1 .2-1.7.5-2.2.3-.4.9-.6 1.6-.6.6 0 1 .2 1.3.6.3.4.4 1 .4 1.8v5.5h2.7v-6c0-.6 0-1.2-.2-1.6 0-.5-.3-1-.5-1.3zm-14 4.7l-2.3-9.2h-2.8l-2.3 9-2.2-9h-3l3.6 13.4h3l2.2-9.2 2.3 9.2h3l3.6-13.4h-3l-2.1 9.2zm-24.5.2L18 15.6c-.3-.1-.6-.2-.8.2A20 20 0 0 1 16 17c-.2.2-.4.3-.7.1-.4-.2-1.5-.5-2.8-1.7-1-1-1.7-2-2-2.4-.1-.4 0-.5.2-.7l.5-.6.4-.6v-.6L10.4 8c-.3-.6-.6-.5-.8-.6H9c-.2 0-.6.1-.9.5C7.8 8.2 7 9 7 10.7c0 1.7 1.3 3.4 1.4 3.6.2.3 2.5 3.7 6 5.2l1.9.8c.8.2 1.6.2 2.2.1.6-.1 2-.8 2.3-1.6.3-.9.3-1.5.2-1.7l-.7-.4zM14 25.3c-2 0-4-.5-5.8-1.6l-.4-.2-4.4 1.1 1.2-4.2-.3-.5A11.5 11.5 0 0 1 22.1 5.7 11.5 11.5 0 0 1 14 25.3zM14 0A13.8 13.8 0 0 0 2 20.7L0 28l7.3-2A13.8 13.8 0 1 0 14 0z"/></svg>
|
49 |
<?php elseif ( '' !== $settings['header'] ) : ?>
|
50 |
<span class="joinchat__header__text"><?php echo esc_html( $settings['header'] ); ?></span>
|
51 |
<?php endif; ?>
|
52 |
+
<div class="joinchat__close" aria-label="<?php esc_attr_e( 'Close', 'creame-whatsapp-me' ); ?>"></div>
|
53 |
</div>
|
54 |
<div class="joinchat__box__scroll">
|
55 |
<div class="joinchat__box__content">
|
56 |
+
<?php echo $box_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
57 |
</div>
|
58 |
</div>
|
59 |
</div>
|