Version Description
- SECURE window.open with 'noopener'
- FIX PHP error undefined get_col_charset() on old WordPress versions
Download this release
Release Info
Developer | creapuntome |
Plugin | WhatsApp me |
Version | 4.1.2 |
Comparing to | |
See all releases |
Code changes from version 4.1.1 to 4.1.2
- README.txt +5 -1
- admin/class-joinchat-admin.php +4 -4
- admin/css/joinchat.min.css +1 -1
- admin/js/joinchat.min.js +1 -1
- joinchat.php +2 -2
- public/class-joinchat-public.php +1 -1
- public/css/joinchat.css +1 -1
- public/css/joinchat.min.css +1 -1
- public/js/joinchat.js +1 -1
- public/js/joinchat.min.js +1 -1
README.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: whatsapp business, whatsapp, click to chat, button, whatsapp support chat,
|
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 5.5
|
7 |
Requires PHP: 5.3
|
8 |
-
Stable tag: 4.1.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -194,6 +194,10 @@ There is a Javascript event that Join.chat triggers automatically before launch
|
|
194 |
|
195 |
== Changelog ==
|
196 |
|
|
|
|
|
|
|
|
|
197 |
= 4.1.1 =
|
198 |
* FIX error on prices with '$'
|
199 |
|
5 |
Requires at least: 3.0.1
|
6 |
Tested up to: 5.5
|
7 |
Requires PHP: 5.3
|
8 |
+
Stable tag: 4.1.2
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
194 |
|
195 |
== Changelog ==
|
196 |
|
197 |
+
= 4.1.2 =
|
198 |
+
* SECURE window.open with 'noopener'
|
199 |
+
* FIX PHP error undefined get_col_charset() on old WordPress versions
|
200 |
+
|
201 |
= 4.1.1 =
|
202 |
* FIX error on prices with '$'
|
203 |
|
admin/class-joinchat-admin.php
CHANGED
@@ -346,8 +346,8 @@ class JoinChatAdmin {
|
|
346 |
}
|
347 |
|
348 |
// Encode emojis if utf8mb4 not supported by DB
|
349 |
-
if (
|
350 |
-
&&
|
351 |
&& ! has_filter( 'sanitize_text_field', 'wp_encode_emoji' ) ) {
|
352 |
add_filter( 'sanitize_text_field', 'wp_encode_emoji' );
|
353 |
}
|
@@ -977,8 +977,8 @@ class JoinChatAdmin {
|
|
977 |
}
|
978 |
|
979 |
// Encode emojis if utf8mb4 not supported by DB
|
980 |
-
if (
|
981 |
-
&&
|
982 |
&& ! has_filter( 'sanitize_text_field', 'wp_encode_emoji' ) ) {
|
983 |
add_filter( 'sanitize_text_field', 'wp_encode_emoji' );
|
984 |
}
|
346 |
}
|
347 |
|
348 |
// Encode emojis if utf8mb4 not supported by DB
|
349 |
+
if ( function_exists( 'wp_encode_emoji' )
|
350 |
+
&& 'utf8mb4' !== $wpdb->get_col_charset( $wpdb->options, 'option_value' )
|
351 |
&& ! has_filter( 'sanitize_text_field', 'wp_encode_emoji' ) ) {
|
352 |
add_filter( 'sanitize_text_field', 'wp_encode_emoji' );
|
353 |
}
|
977 |
}
|
978 |
|
979 |
// Encode emojis if utf8mb4 not supported by DB
|
980 |
+
if ( function_exists( 'wp_encode_emoji' )
|
981 |
+
&& 'utf8mb4' !== $wpdb->get_col_charset( $wpdb->postmeta, 'meta_value' )
|
982 |
&& ! has_filter( 'sanitize_text_field', 'wp_encode_emoji' ) ) {
|
983 |
add_filter( 'sanitize_text_field', 'wp_encode_emoji' );
|
984 |
}
|
admin/css/joinchat.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.joinchat-hidden{display:none!important}.js #joinchat_form textarea{overflow:hidden;min-height:100px}.joinchat-tab{display:none}.joinchat-tab-active{display:block!important}#joinchat_tab_visibility tr:hover{background:rgba(0,0,0,.05)}#joinchat_tab_visibility
|
1 |
+
.joinchat-hidden{display:none !important}.js #joinchat_form textarea{overflow:hidden;min-height:100px}.joinchat-tab{display:none}.joinchat-tab-active{display:block !important}#joinchat_tab_visibility tr:hover{background:rgba(0,0,0,.05)}#joinchat_tab_visibility th,#joinchat_tab_visibility td{padding:7px 15px}#joinchat_tab_visibility label{margin-right:15px}#joinchat_tab_visibility .dashicons{opacity:.5}#joinchat_tab_visibility input[type=radio]+span{transition:all 200ms}#joinchat_tab_visibility input[type=radio]:checked+span{color:#79ba49;opacity:1}#joinchat_tab_visibility input[type=radio]:checked+.dashicons-hidden{color:#ca4a1f}.joinchat-show-help{display:inline-block;width:1.1em;height:1.1em;line-height:1.1em;border-radius:50%;background:#999;color:#fff;font-weight:bold;text-decoration:none;text-align:center}.joinchat-show-help:hover,.joinchat-show-help:active,.joinchat-show-help:focus{background:#444;color:#fff}#tab-panel-styles-and-vars span{white-space:nowrap}.form-table td p.joinchat-addon{display:inline-block;padding:0 6px;border-radius:3px;background:#fffbe5;font-size:13px}.iti--allow-dropdown input{padding-left:52px !important}#joinchat_button_image_wrapper{position:relative;padding:8px 0 0 80px}#joinchat_button_image_holder{position:absolute;top:0;left:0;box-sizing:border-box;width:60px;height:60px;border:1px solid #25d366;border-radius:50%;background:#25d366 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="36" height="36"><path 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 01-13.754 2.299l-5.814.735a.392.392 0 01-.438-.44l.748-5.788A12.002 12.002 0 013.517 3.517zm3.61 17.043l.3.158a9.846 9.846 0 0011.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 00-1.747 11.554l.16.303-.51 3.942a.196.196 0 00.219.22l3.961-.501zm6.534-7.003l-.933 1.164a9.843 9.843 0 01-3.497-3.495l1.166-.933a.792.792 0 00.23-.94L9.561 6.96a.793.793 0 00-.924-.445 1291.6 1291.6 0 00-2.023.524.797.797 0 00-.588.88 11.754 11.754 0 0010.005 10.005.797.797 0 00.88-.587l.525-2.023a.793.793 0 00-.445-.923L14.6 13.327a.792.792 0 00-.94.23z"/></svg>') no-repeat center;box-shadow:1px 6px 24px 0 rgba(7,94,84,.24);overflow:hidden}[dir=rtl] #joinchat_button_image_wrapper{padding:8px 80px 0 0}[dir=rtl] #joinchat_button_image_holder{right:0;left:auto}.joinchat_vars_help{margin-top:5px;font-size:11px;font-weight:normal;line-height:1.9;opacity:0;transition:opacity .2s ease-out .2s}tr:hover .joinchat_vars_help,tr.joinchat--focus .joinchat_vars_help{opacity:1;transition-delay:.5s}.joinchat_vars_help code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;padding:2px 1px;font-size:inherit;vertical-align:bottom}.joinchat_vars_help code:hover{background:rgba(0,0,0,0.2)}@media screen and (max-width:782px){.joinchat_vars_help{margin-top:2px;opacity:1}.joinchat_vars_help br{display:none}}#joinchat_form .iris-picker{visibility:visible}.settings_page_joinchat .help-tab-content li ul{margin-top:6px}.settings_page_joinchat .help-tab-content li li{list-style-type:circle}.settings_page_joinchat .help-tab-content code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all}.joinchat-metabox code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;padding:2px 1px;font-size:smaller;vertical-align:text-bottom}.joinchat-metabox .dashicons{opacity:.5}.joinchat-metabox input::placeholder{color:#dedfe0}.joinchat-metabox input::-ms-input-placeholder{color:#dedfe0}.joinchat-metabox input[type=radio]{margin-right:1px}.joinchat-metabox input[type=radio]+span{margin-right:5px;transition:all 200ms}.joinchat-metabox input[type=radio]:checked+span{color:#79ba49;opacity:1}.joinchat-metabox input[type=radio]:checked+.dashicons-hidden{color:#ca4a1f}.js .joinchat-metabox textarea{overflow:hidden;min-height:3em}
|
admin/js/joinchat.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(h){"use strict";function r(){h(this).height(0).height(this.scrollHeight)}h(function(){var a,t,n,e,i,o,c,l;function s(t,e){var a;t=t||"all",e=e||h('input[name="joinchat[view]['+t+']"]:checked').val(),h(".view_inheritance_"+t).toggleClass("dashicons-visibility","yes"==e).toggleClass("dashicons-hidden","no"==e),"cpts"==t?h("[class*=view_inheritance_cpt_]").toggleClass("dashicons-visibility","yes"==e).toggleClass("dashicons-hidden","no"==e):t in l&&(a=""===(a=h('input[name="joinchat[view]['+t+']"]:checked').val())?e:a,h.each(l[t],function(){s(this,a)}))}"function"==typeof intlTelInput&&h("#joinchat_phone").length&&(t=JSON.parse(localStorage.joinchat_country_code||"{}"),n=!(!t.code||t.date!=(new Date).toDateString())&&t.code,e=h("#joinchat_phone"),i=""===e.val()?e.attr("placeholder"):null,e.removeAttr("placeholder"),(o=intlTelInput(e.get(0),{hiddenInput:e.data("name")||"joinchat[telephone]",initialCountry:"auto",preferredCountries:[n||""],geoIpLookup:function(e){n?e(n):h.getJSON("https://ipinfo.io").always(function(t){t=t&&t.country?t.country:"";localStorage.joinchat_country_code=JSON.stringify({code:t,date:(new Date).toDateString()}),e(t)})},utilsScript:"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/"+intl_tel_input_version+"/js/utils.js"})).hiddenInput.value=e.val(),"string"==typeof i&&""!=i&&o.promise.then(function(){o.setNumber(i),e.attr("placeholder",o.getNumber(intlTelInputUtils.numberFormat.NATIONAL)).val("")}),e.on("input",function(){var t=h(this),e=intlTelInputGlobals.getInstance(this);t.css("color",t.val().trim()&&!e.isValidNumber()?"#ca4a1f":""),e.hiddenInput.value=e.getNumber()}).on("blur",function(){var t=intlTelInputGlobals.getInstance(this);t.setNumber(t.getNumber())})),1===h("#joinchat_form").length&&(h(".nav-tab").click(function(t){t.preventDefault();var e=h(this),a=e.attr("href"),n=h("input[name=_wp_http_referer]"),t=n.val();n.val(t.substr(0,t.indexOf("page=joinchat"))+"page=joinchat&tab="+a.substr(14)),h(".nav-tab").removeClass("nav-tab-active").attr("aria-selected","false"),e.addClass("nav-tab-active").attr("aria-selected","true").get(0).blur(),h(".joinchat-tab").removeClass("joinchat-tab-active"),h(a).addClass("joinchat-tab-active").find("textarea").each(r)}),h("#joinchat_mobile_only").change(function(){h("#joinchat_whatsapp_web").closest("tr").toggleClass("joinchat-hidden",this.checked)}).change(),h("#joinchat_message_delay").on("change input",function(){h("#joinchat_message_badge, #joinchat_message_views").closest("tr").toggleClass("joinchat-hidden","0"==this.value)}).change(),h(".joinchat-show-help").click(function(t){t.preventDefault();t=h(this).attr("href");h("#contextual-help-wrap").is(":visible")?h("html, body").animate({scrollTop:0}):h("#contextual-help-link").click(),h("#"!=t?t:"#tab-link-styles-and-vars").find("a").click()}),h("textarea","#joinchat_form").on("focus",function(){h(this).closest("tr").addClass("joinchat--focus")}).on("blur",function(){h(this).closest("tr").removeClass("joinchat--focus")}).on("input",r).each(r),c=h("#joinchat_tab_visibility"),l=h(".joinchat_view_all").data("inheritance")||{all:["front_page","blog_page","404_page","search","archive","singular","cpts"],archive:["date","author"],singular:["page","post"]},h("input",c).change(function(){s()}),h(".joinchat_view_reset").click(function(t){t.preventDefault(),h('input[value=""]',c).prop("checked",!0),h(".joinchat_view_all input",c).first().prop("checked",!0),s()}),s(),h("#joinchat_button_image_add").click(function(t){t.preventDefault(),a||((a=wp.media({title:h(this).data("title")||"Select button image",button:{text:h(this).data("button")||"Use Image"},library:{type:"image"},multiple:!1})).on("select",function(){var t=a.state().get("selection").first().toJSON(),e=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url||t.url;h("#joinchat_button_image_holder").css({"background-size":"cover","background-image":"url("+e+")"}),h("#joinchat_button_image").val(t.id),h("#joinchat_button_image_remove").removeClass("joinchat-hidden")}),a.on("open",function(){var t=wp.media.attachment(h("#joinchat_button_image").val());a.state().get("selection").add(t?[t]:[])})),a.open()}),h("#joinchat_button_image_remove").click(function(t){t.preventDefault(),h("#joinchat_button_image_holder").removeAttr("style"),h("#joinchat_button_image").val(""),h(this).addClass("joinchat-hidden")}),h("#joinchat_color").wpColorPicker(),h("#joinchat_header_custom").on("click",function(){h(this).prev().find("input").prop("checked",!0)})),1===h(".joinchat-metabox").length&&h("textarea",".joinchat-metabox").on("focus input",r).each(r)})}(jQuery);
|
joinchat.php
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
* Plugin Name: Join.chat
|
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.1.
|
13 |
* Author: Creame
|
14 |
* Author URI: https://crea.me
|
15 |
* License: GPL-2.0+
|
@@ -27,7 +27,7 @@ if ( ! defined( 'WPINC' ) ) {
|
|
27 |
* Currently plugin version.
|
28 |
* Start at version 1.0.0 and use SemVer - https://semver.org
|
29 |
*/
|
30 |
-
define( 'JOINCHAT_VERSION', '4.1.
|
31 |
|
32 |
/**
|
33 |
* The core plugin class that is used to define internationalization,
|
9 |
* Plugin Name: Join.chat
|
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.1.2
|
13 |
* Author: Creame
|
14 |
* Author URI: https://crea.me
|
15 |
* License: GPL-2.0+
|
27 |
* Currently plugin version.
|
28 |
* Start at version 1.0.0 and use SemVer - https://semver.org
|
29 |
*/
|
30 |
+
define( 'JOINCHAT_VERSION', '4.1.2' );
|
31 |
|
32 |
/**
|
33 |
* The core plugin class that is used to define internationalization,
|
public/class-joinchat-public.php
CHANGED
@@ -295,7 +295,7 @@ class JoinChatPublic {
|
|
295 |
<?php if ( $this->settings['message_start'] ) : ?>
|
296 |
<div class="joinchat__button__sendtext"><?php echo $this->settings['message_start']; ?></div>
|
297 |
<?php endif; ?>
|
298 |
-
<?php if ( $
|
299 |
<svg class="joinchat__button__send" viewbox="0 0 400 400" stroke-linecap="round" stroke-width="33">
|
300 |
<path class="joinchat_svg__plain" d="M168.83 200.504H79.218L33.04 44.284a1 1 0 0 1 1.386-1.188L365.083 199.04a1 1 0 0 1 .003 1.808L34.432 357.903a1 1 0 0 1-1.388-1.187l29.42-99.427"/>
|
301 |
<path class="joinchat_svg__chat" d="M318.087 318.087c-52.982 52.982-132.708 62.922-195.725 29.82l-80.449 10.18 10.358-80.112C18.956 214.905 28.836 134.99 81.913 81.913c65.218-65.217 170.956-65.217 236.174 0 42.661 42.661 57.416 102.661 44.265 157.316"/>
|
295 |
<?php if ( $this->settings['message_start'] ) : ?>
|
296 |
<div class="joinchat__button__sendtext"><?php echo $this->settings['message_start']; ?></div>
|
297 |
<?php endif; ?>
|
298 |
+
<?php if ( $box_content ) : ?>
|
299 |
<svg class="joinchat__button__send" viewbox="0 0 400 400" stroke-linecap="round" stroke-width="33">
|
300 |
<path class="joinchat_svg__plain" d="M168.83 200.504H79.218L33.04 44.284a1 1 0 0 1 1.386-1.188L365.083 199.04a1 1 0 0 1 .003 1.808L34.432 357.903a1 1 0 0 1-1.388-1.187l29.42-99.427"/>
|
301 |
<path class="joinchat_svg__chat" d="M318.087 318.087c-52.982 52.982-132.708 62.922-195.725 29.82l-80.449 10.18 10.358-80.112C18.956 214.905 28.836 134.99 81.913 81.913c65.218-65.217 170.956-65.217 236.174 0 42.661 42.661 57.416 102.661 44.265 157.316"/>
|
public/css/joinchat.css
CHANGED
@@ -389,7 +389,7 @@
|
|
389 |
display: inline-block;
|
390 |
width: auto;
|
391 |
height: 18px;
|
392 |
-
vertical-align:
|
393 |
}
|
394 |
|
395 |
.joinchat__powered:hover,
|
389 |
display: inline-block;
|
390 |
width: auto;
|
391 |
height: 18px;
|
392 |
+
vertical-align: -30%;
|
393 |
}
|
394 |
|
395 |
.joinchat__powered:hover,
|
public/css/joinchat.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.joinchat{--bottom:20px;--sep:20px;--header:70px;--btn:60px;--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:rgba(var(--rgb),0.04);--tolerance:210;--bw:calc((var(--red)*0.2126 + var(--green)*0.7152 + var(--blue)*0.0722 - var(--tolerance))*-100000);--text:rgba(var(--bw),var(--bw),var(--bw),min(1,max(0.7,var(--bw))));--msg:var(--color);position:fixed;z-index:1000;right:var(--sep);bottom:var(--bottom);color:var(--text);font:normal normal normal 16px/1.625em -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;letter-spacing:0;transform:scale3d(0,0,0);transition:transform .3s ease-in-out;-webkit-user-select:none;-ms-user-select:none;user-select:none;-webkit-font-smoothing:antialiased}.joinchat *,.joinchat :after,.joinchat :before{box-sizing:border-box}.joinchat--show{transform:scaleX(1);transition:transform .5s cubic-bezier(.18,.89,.32,1.28)}.joinchat.joinchat--left{right:auto;left:var(--sep)}@media (max-width:480px),(orientation:landscape) and (max-width:767px){.joinchat{--bottom:6px;--sep:6px;--header:55px}}.joinchat.joinchat--dark{--msg:var(--dark)}@media (color-index:48){.joinchat.joinchat--dark-auto{--msg:var(--dark)}}@media (prefers-color-scheme:dark){.joinchat.joinchat--dark-auto{--msg:var(--dark)}}.joinchat__button{display:flex;flex-direction:row;position:absolute;z-index:2;bottom:8px;right:8px;height:var(--btn);min-width:var(--btn);max-width:95vw;background:#25d366;color:inherit;border-radius:calc(var(--btn)/2);box-shadow:1px 6px 24px 0 rgba(7,94,84,.24);cursor:pointer;transition:background .2s linear;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:background-color,width}.joinchat__button:hover{background:#128c7e;transition:background 1.5s linear}.joinchat__button:active{background:#128c7e;transition:none}.joinchat--chatbox .joinchat__button{background:var(--color);transition:background .2s linear;box-shadow:0 1px 2px 0 rgba(0,0,0,.3)}.joinchat--chatbox .joinchat__button:active,.joinchat--chatbox .joinchat__button:hover{background:var(--hover)}[dir=rtl] .joinchat__button{flex-direction:row-reverse}.joinchat--left .joinchat__button{right:auto;left:8px;flex-direction:row-reverse}[dir=rtl] .joinchat--left .joinchat__button{flex-direction:row}.joinchat__button__open{width:var(--btn);height:var(--btn);background:transparent 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 01-13.754 2.299l-5.814.735a.392.392 0 01-.438-.44l.748-5.788A12.002 12.002 0 013.517 3.517zm3.61 17.043l.3.158a9.846 9.846 0 0011.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 00-1.747 11.554l.16.303-.51 3.942a.196.196 0 00.219.22l3.961-.501zm6.534-7.003l-.933 1.164a9.843 9.843 0 01-3.497-3.495l1.166-.933a.792.792 0 00.23-.94L9.561 6.96a.793.793 0 00-.924-.445 1291.6 1291.6 0 00-2.023.524.797.797 0 00-.588.88 11.754 11.754 0 0010.005 10.005.797.797 0 00.88-.587l.525-2.023a.793.793 0 00-.445-.923L14.6 13.327a.792.792 0 00-.94.23z'/%3E%3C/svg%3E") 50% no-repeat;background-size:60%}.joinchat--chatbox .joinchat__button__open{display:none}.joinchat__button__image{position:absolute;top:1px;right:1px;width:calc(var(--btn) - 2px);height:calc(var(--btn) - 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;width:var(--btn);height:var(--btn);max-width:var(--btn);padding:12px 11px 12px 13px;margin:0;flex-shrink:0}.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;font-weight:600;line-height:var(--btn);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:14px;right:76px;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));transform:translateZ(0);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}@media (hover:hover){.joinchat__button:hover .joinchat__tooltip{opacity:1;animation:none;transition:opacity .2s}}.joinchat--chatbox .joinchat__tooltip{display:none}.joinchat--left .joinchat__tooltip{right:auto;left:76px}.joinchat--left .joinchat__tooltip:after{left:-6px;right:auto;border-color:transparent;border-width:6px 8px 6px 0;border-right-color:#fff}.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(100vh - var(--bottom) - var(--sep));border-radius:32px;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:opacity .4s ease-out,transform 0ms linear .3s}.joinchat--chatbox .joinchat__box{opacity:1;transform:scaleX(1);transition:opacity .2s ease-out,transform 0ms 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);padding:0 70px 0 26px;margin:0;background:var(--color);text-align:left}[dir=rtl] .joinchat__header{text-align:right}.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:text-top}.joinchat__powered:active,.joinchat__powered:hover{color:inherit!important;text-decoration:none!important;opacity:.9}.joinchat__wa{height:28px;width:auto;fill:currentColor;opacity:.8}.joinchat__close{position:absolute;top:50%;right:24px;width:34px;height:34px;margin-top:-16px;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.4L21.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;-webkit-tap-highlight-color:rgba(0,0,0,0)}.joinchat__close:hover{background-color:rgba(0,0,0,.6)}[dir=rtl] .joinchat__close{right:auto;left:24px}.joinchat__box__scroll{padding:20px 0 70px;padding-bottom:calc(var(--btn) + 10px);background:#fff linear-gradient(0deg,var(--bg),var(--bg));overflow-x:hidden;overflow-y:auto;will-change:scroll-position}.joinchat__box__scroll::-webkit-scrollbar{width:5px;background:transparent}.joinchat__box__scroll::-webkit-scrollbar-thumb{border-radius:3px;background:transparent}.joinchat__box__scroll:hover::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2)}.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}@supports (-webkit-overflow-scrolling:touch){.joinchat__box__scroll{overflow-y:scroll;-webkit-overflow-scrolling:touch}}@media (max-width:480px),(orientation:landscape) and (max-width:767px){.joinchat__header__text{font-size:17px}.joinchat__close{margin-top:-14px;width:28px;height:28px}.joinchat__box__scroll{padding-top:15px}}@media (color-index:48){.joinchat--dark-auto .joinchat__box__scroll{background:#1a1a1a}.joinchat--dark-auto .joinchat__header{background:var(--dark)}}@media (prefers-color-scheme:dark){.joinchat--dark-auto .joinchat__box__scroll{background:#1a1a1a}.joinchat--dark-auto .joinchat__header{background:var(--dark)}}.joinchat__message{position:relative;min-height:60px;padding:17px 20px;margin:0 26px 26px;border-radius:32px;background:#fff;color:#4a4a4a;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:url(#joinchat__message__peak);clip-path:url(#joinchat__message__peak)}.joinchat--dark .joinchat__message{background:#505050;color:#d8d8d8}@media (color-index:48){.joinchat--dark-auto .joinchat__message{background:#505050;color:#d8d8d8}}@media (prefers-color-scheme:dark){.joinchat--dark-auto .joinchat__message{background:#505050;color:#d8d8d8}}@media (max-width:480px),(orientation:landscape) and (max-width:767px){.joinchat__message{padding:18px 16px;line-height:24px;margin:0 20px 20px}}@keyframes joinchat_badge_in{0%{opacity:0;transform:translateY(50px)}to{opacity:1;transform:translateY(0)}}@keyframes joinchat_badge_out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-20px)}}@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:scaleY(1)}25%,to{opacity:0;transform:scaleY(1)}}
|
1 |
+
.joinchat{--bottom:20px;--sep:20px;--header:70px;--btn:60px;--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:rgba(var(--rgb),0.04);--tolerance:210;--bw:calc((var(--red)*0.2126 + var(--green)*0.7152 + var(--blue)*0.0722 - var(--tolerance))*-100000);--text:rgba(var(--bw),var(--bw),var(--bw),min(1,max(0.7,var(--bw))));--msg:var(--color);position:fixed;z-index:1000;right:var(--sep);bottom:var(--bottom);color:var(--text);font:normal normal normal 16px/1.625em -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,sans-serif;letter-spacing:0;transform:scale3d(0,0,0);transition:transform .3s ease-in-out;-webkit-user-select:none;-ms-user-select:none;user-select:none;-webkit-font-smoothing:antialiased}.joinchat *,.joinchat :after,.joinchat :before{box-sizing:border-box}.joinchat--show{transform:scaleX(1);transition:transform .5s cubic-bezier(.18,.89,.32,1.28)}.joinchat.joinchat--left{right:auto;left:var(--sep)}@media (max-width:480px),(orientation:landscape) and (max-width:767px){.joinchat{--bottom:6px;--sep:6px;--header:55px}}.joinchat.joinchat--dark{--msg:var(--dark)}@media (color-index:48){.joinchat.joinchat--dark-auto{--msg:var(--dark)}}@media (prefers-color-scheme:dark){.joinchat.joinchat--dark-auto{--msg:var(--dark)}}.joinchat__button{display:flex;flex-direction:row;position:absolute;z-index:2;bottom:8px;right:8px;height:var(--btn);min-width:var(--btn);max-width:95vw;background:#25d366;color:inherit;border-radius:calc(var(--btn)/2);box-shadow:1px 6px 24px 0 rgba(7,94,84,.24);cursor:pointer;transition:background .2s linear;-webkit-tap-highlight-color:rgba(0,0,0,0);will-change:background-color,width}.joinchat__button:hover{background:#128c7e;transition:background 1.5s linear}.joinchat__button:active{background:#128c7e;transition:none}.joinchat--chatbox .joinchat__button{background:var(--color);transition:background .2s linear;box-shadow:0 1px 2px 0 rgba(0,0,0,.3)}.joinchat--chatbox .joinchat__button:active,.joinchat--chatbox .joinchat__button:hover{background:var(--hover)}[dir=rtl] .joinchat__button{flex-direction:row-reverse}.joinchat--left .joinchat__button{right:auto;left:8px;flex-direction:row-reverse}[dir=rtl] .joinchat--left .joinchat__button{flex-direction:row}.joinchat__button__open{width:var(--btn);height:var(--btn);background:transparent 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 01-13.754 2.299l-5.814.735a.392.392 0 01-.438-.44l.748-5.788A12.002 12.002 0 013.517 3.517zm3.61 17.043l.3.158a9.846 9.846 0 0011.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 00-1.747 11.554l.16.303-.51 3.942a.196.196 0 00.219.22l3.961-.501zm6.534-7.003l-.933 1.164a9.843 9.843 0 01-3.497-3.495l1.166-.933a.792.792 0 00.23-.94L9.561 6.96a.793.793 0 00-.924-.445 1291.6 1291.6 0 00-2.023.524.797.797 0 00-.588.88 11.754 11.754 0 0010.005 10.005.797.797 0 00.88-.587l.525-2.023a.793.793 0 00-.445-.923L14.6 13.327a.792.792 0 00-.94.23z'/%3E%3C/svg%3E") 50% no-repeat;background-size:60%}.joinchat--chatbox .joinchat__button__open{display:none}.joinchat__button__image{position:absolute;top:1px;right:1px;width:calc(var(--btn) - 2px);height:calc(var(--btn) - 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;width:var(--btn);height:var(--btn);max-width:var(--btn);padding:12px 11px 12px 13px;margin:0;flex-shrink:0}.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;font-weight:600;line-height:var(--btn);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:14px;right:76px;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));transform:translateZ(0);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}@media (hover:hover){.joinchat__button:hover .joinchat__tooltip{opacity:1;animation:none;transition:opacity .2s}}.joinchat--chatbox .joinchat__tooltip{display:none}.joinchat--left .joinchat__tooltip{right:auto;left:76px}.joinchat--left .joinchat__tooltip:after{left:-6px;right:auto;border-color:transparent;border-width:6px 8px 6px 0;border-right-color:#fff}.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(100vh - var(--bottom) - var(--sep));border-radius:32px;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:opacity .4s ease-out,transform 0ms linear .3s}.joinchat--chatbox .joinchat__box{opacity:1;transform:scaleX(1);transition:opacity .2s ease-out,transform 0ms 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);padding:0 70px 0 26px;margin:0;background:var(--color);text-align:left}[dir=rtl] .joinchat__header{text-align:right}.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}.joinchat__wa{height:28px;width:auto;fill:currentColor;opacity:.8}.joinchat__close{position:absolute;top:50%;right:24px;width:34px;height:34px;margin-top:-16px;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.4L21.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;-webkit-tap-highlight-color:rgba(0,0,0,0)}.joinchat__close:hover{background-color:rgba(0,0,0,.6)}[dir=rtl] .joinchat__close{right:auto;left:24px}.joinchat__box__scroll{padding:20px 0 70px;padding-bottom:calc(var(--btn) + 10px);background:#fff linear-gradient(0deg,var(--bg),var(--bg));overflow-x:hidden;overflow-y:auto;will-change:scroll-position}.joinchat__box__scroll::-webkit-scrollbar{width:5px;background:transparent}.joinchat__box__scroll::-webkit-scrollbar-thumb{border-radius:3px;background:transparent}.joinchat__box__scroll:hover::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2)}.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}@supports (-webkit-overflow-scrolling:touch){.joinchat__box__scroll{overflow-y:scroll;-webkit-overflow-scrolling:touch}}@media (max-width:480px),(orientation:landscape) and (max-width:767px){.joinchat__header__text{font-size:17px}.joinchat__close{margin-top:-14px;width:28px;height:28px}.joinchat__box__scroll{padding-top:15px}}@media (color-index:48){.joinchat--dark-auto .joinchat__box__scroll{background:#1a1a1a}.joinchat--dark-auto .joinchat__header{background:var(--dark)}}@media (prefers-color-scheme:dark){.joinchat--dark-auto .joinchat__box__scroll{background:#1a1a1a}.joinchat--dark-auto .joinchat__header{background:var(--dark)}}.joinchat__message{position:relative;min-height:60px;padding:17px 20px;margin:0 26px 26px;border-radius:32px;background:#fff;color:#4a4a4a;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:url(#joinchat__message__peak);clip-path:url(#joinchat__message__peak)}.joinchat--dark .joinchat__message{background:#505050;color:#d8d8d8}@media (color-index:48){.joinchat--dark-auto .joinchat__message{background:#505050;color:#d8d8d8}}@media (prefers-color-scheme:dark){.joinchat--dark-auto .joinchat__message{background:#505050;color:#d8d8d8}}@media (max-width:480px),(orientation:landscape) and (max-width:767px){.joinchat__message{padding:18px 16px;line-height:24px;margin:0 20px 20px}}@keyframes joinchat_badge_in{0%{opacity:0;transform:translateY(50px)}to{opacity:1;transform:translateY(0)}}@keyframes joinchat_badge_out{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-20px)}}@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:scaleY(1)}25%,to{opacity:0;transform:scaleY(1)}}
|
public/js/joinchat.js
CHANGED
@@ -107,7 +107,7 @@
|
|
107 |
// Send analytics events
|
108 |
this.send_event(args.link);
|
109 |
// Open WhatsApp link
|
110 |
-
win.open(args.link, 'joinchat');
|
111 |
} else {
|
112 |
console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com");
|
113 |
}
|
107 |
// Send analytics events
|
108 |
this.send_event(args.link);
|
109 |
// Open WhatsApp link
|
110 |
+
win.open(args.link, 'joinchat', 'noopener');
|
111 |
} else {
|
112 |
console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com");
|
113 |
}
|
public/js/joinchat.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(
|
1 |
+
!function(u,p,d){"use strict";p.joinchat_obj=p.joinchat_obj||{},joinchat_obj=u.extend({$div:null,settings:null,store:null,chatbox:!1,is_mobile:!1},joinchat_obj),joinchat_obj.$=function(t){return u(t||this.$div,this.$div)},joinchat_obj.send_event=function(o,e){var t=p[this.settings.ga_tracker||"ga"];o=o||"",e=e||"click","function"==typeof t&&"function"==typeof t.getAll?(t("set","transport","beacon"),t.getAll().forEach(function(t){t.send("event","JoinChat",e,o)})):"function"==typeof gtag&>ag("event",e,{event_category:"JoinChat",event_label:o,transport_type:"beacon"}),"object"==typeof dataLayer&&dataLayer.push({event:"JoinChat",eventAction:e,eventLabel:o}),"function"==typeof fbq&&fbq("trackCustom","JoinChat",{eventAction:e,eventLabel:o})},joinchat_obj.whatsapp_link=function(t,o,e){return((e=void 0!==e?e:this.settings.whatsapp_web&&!this.is_mobile)?"https://web.whatsapp.com/send":"https://api.whatsapp.com/send")+"?phone="+encodeURIComponent(t)+"&text="+encodeURIComponent(o||"")},joinchat_obj.chatbox_show=function(){this.chatbox||(this.chatbox=!0,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"),u(d).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"),u(d).trigger("joinchat:hide"))},joinchat_obj.save_hash=function(){var t=this.settings.message_hash||"none",o=(this.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean);-1===o.indexOf(t)&&(o.push(t),this.store.setItem("joinchat_hashes",o.join(",")))},joinchat_obj.open_whatsapp=function(t,o){t={link:this.whatsapp_link(t||this.settings.telephone,o||this.settings.message_send)},o=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");u(d).trigger("joinchat:open",[t,this.settings]),o.test(t.link)?(this.send_event(t.link),p.open(t.link,"joinchat","noopener")):console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com")},u(function(){joinchat_obj.$div=u(".joinchat"),joinchat_obj.settings=joinchat_obj.$div.data("settings"),joinchat_obj.is_mobile=!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i);try{localStorage.setItem("test",1),localStorage.removeItem("test"),joinchat_obj.store=localStorage}catch(t){joinchat_obj.store={_data:{},setItem:function(t,o){this._data[t]=String(o)},getItem:function(t){return this._data.hasOwnProperty(t)?this._data[t]:null}}}if(void 0===joinchat_obj.settings)try{joinchat_obj.settings=JSON.parse(joinchat_obj.$div.attr("data-settings"))}catch(t){joinchat_obj.settings=void 0}joinchat_obj.$div.length&&joinchat_obj.settings&&joinchat_obj.settings.telephone&&(joinchat_obj.is_mobile||!joinchat_obj.settings.mobile_only?function(){u(d).trigger("joinchat:starting");var t,o,e=1e3*joinchat_obj.settings.button_delay,n=1e3*joinchat_obj.settings.message_delay,i=!!joinchat_obj.settings.message_hash,a=!!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(o),joinchat_obj.chatbox_show()}function j(){joinchat_obj.save_hash(),joinchat_obj.chatbox_hide()}var _,b="joinchat--show";h||i&&n&&!joinchat_obj.settings.message_badge&&s||(b+=" joinchat--tooltip");setTimeout(function(){joinchat_obj.$div.addClass(b)},e),i&&!h&&n&&(joinchat_obj.settings.message_badge?o=setTimeout(function(){joinchat_obj.$(".joinchat__badge").addClass("joinchat__badge--in")},e+n):s&&(o=setTimeout(c,e+n)));a&&!joinchat_obj.is_mobile&&joinchat_obj.$(".joinchat__button").mouseenter(function(){t=setTimeout(c,1500)}).mouseleave(function(){clearTimeout(t)});{function r(){var t=(d.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")}joinchat_obj.$(".joinchat__button").click(function(){a&&!joinchat_obj.chatbox?c():(j(),joinchat_obj.open_whatsapp())}),joinchat_obj.$(".joinchat__close").click(j),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&&u(d).on("focus blur","input, textarea",function(t){u(t.target).closest(joinchat_obj.$div).length||(clearTimeout(_),_=setTimeout(r,200))})}{var l,g;u(d).on("click",".joinchat_open, .joinchat_app",function(t){t.preventDefault(),u(this).hasClass("joinchat_app")||!a?joinchat_obj.open_whatsapp():joinchat_obj.chatbox||c()}),u(d).on("click",".joinchat_close",function(t){t.preventDefault(),joinchat_obj.chatbox_hide()}),a&&"IntersectionObserver"in p&&0<(l=u(".joinchat_show, .joinchat_force_show")).length&&(g=new IntersectionObserver(function(t){u.each(t,function(){if(0<this.intersectionRatio&&(!h||u(this.target).hasClass("joinchat_force_show")))return c(),g.disconnect(),!1})}),l.each(function(){g.observe(this)}))}u(d).trigger("joinchat:start")}():u(d).on("click",".joinchat_open, .joinchat_app",function(t){t.preventDefault(),joinchat_obj.open_whatsapp()})),joinchat_obj.store.setItem("joinchat_views",parseInt(joinchat_obj.store.getItem("joinchat_views")||0)+1)})}(jQuery,window,document);
|