WhatsApp me - Version 4.0.0

Version Description

  • NEW: Join.chat brand.
  • NEW: Widget theme color.
  • NEW: CSS class triggers to open chat window.
  • CHANGED for SEO: All analytics events change from WhatsAppMe to JoinChat
  • CHANGED for devs: All css styles change from wame or whatsappmeto joinchat and all actions and filters change from wame_ or whatsappme_to joinchat_.
  • Lighter, reduced assets size and deleted images.
Download this release

Release Info

Developer creapuntome
Plugin Icon 128x128 WhatsApp me
Version 4.0.0
Comparing to
See all releases

Code changes from version 3.2.3 to 4.0.0

Files changed (33) hide show
  1. README.txt +79 -47
  2. admin/{class-whatsappme-admin.php → class-joinchat-admin.php} +234 -161
  3. admin/{class-whatsappme-wooadmin.php → class-joinchat-wooadmin.php} +38 -38
  4. admin/css/{whatsappme.css → joinchat.css} +60 -46
  5. admin/css/joinchat.min.css +1 -0
  6. admin/css/whatsappme.min.css +0 -1
  7. admin/js/{whatsappme.js → joinchat.js} +47 -39
  8. admin/js/joinchat.min.js +1 -0
  9. admin/js/whatsappme.min.js +0 -1
  10. includes/{class-whatsappme-i18n.php → class-joinchat-i18n.php} +3 -3
  11. includes/{class-whatsappme-integrations.php → class-joinchat-integrations.php} +9 -9
  12. includes/{class-whatsappme-loader.php → class-joinchat-loader.php} +3 -3
  13. includes/{class-whatsappme-util.php → class-joinchat-util.php} +7 -12
  14. includes/{class-whatsappme.php → class-joinchat.php} +110 -27
  15. whatsappme.php → joinchat.php +12 -10
  16. languages/creame-whatsapp-me-fr_FR.mo +0 -0
  17. languages/creame-whatsapp-me-fr_FR.po +0 -549
  18. languages/creame-whatsapp-me.pot +240 -139
  19. public/class-joinchat-public.php +431 -0
  20. public/{class-whatsappme-woopublic.php → class-joinchat-woopublic.php} +13 -12
  21. public/class-whatsappme-public.php +0 -428
  22. public/css/joinchat.css +601 -0
  23. public/css/joinchat.min.css +1 -0
  24. public/css/whatsappme.css +0 -638
  25. public/css/whatsappme.min.css +0 -1
  26. public/images/background.png +0 -0
  27. public/images/background.webp +0 -0
  28. public/images/svgs.php +0 -6
  29. public/js/joinchat.js +268 -0
  30. public/js/joinchat.min.js +1 -0
  31. public/js/whatsappme.js +0 -246
  32. public/js/whatsappme.min.js +0 -1
  33. uninstall.php +12 -8
README.txt CHANGED
@@ -1,27 +1,30 @@
1
- === VVAme chat ===
2
  Contributors: creapuntome, pacotole, davidlillo, monillo
3
  Donate link: https://www.paypal.me/creapuntome/
4
  Tags: whatsapp business, whatsapp, click to chat, button, whatsapp support chat, support, contact, directly message whatsapp, floating whatsapp, whatsapp chat
5
  Requires at least: 3.0.1
6
  Tested up to: 5.4
7
  Requires PHP: 5.3
8
- Stable tag: 3.2.3
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
- Connects a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
13
 
14
  == Description ==
15
 
16
- [wame.chat](https://wame.chat?utm_source=wporg&utm_medium=web&utm_campaign=v3_2) | [Add-Ons](https://wame.chat/en/addons/?utm_source=wporg&utm_medium=web&utm_campaign=v3_2) | [Docs](https://wame.chat/en/docs/?utm_source=wporg&utm_medium=web&utm_campaign=v3_2) | [Support](https://wame.chat/en/support/?utm_source=wporg&utm_medium=web&utm_campaign=v3_2)
17
 
18
- ### Connect a WordPress chat with WhatsApp. The best solution for marketing and support. Stop losing customers and increase your sales.
 
19
 
20
- ### New in WAme 3.2 📍
21
 
22
- 🌚 **Discover the new Dark Mode.** Great news for all those who prefer white text on a black background. Now you will find an option to activate it in your settings.
23
 
24
- ### What you can do with WAme
 
 
25
 
26
  #### 🛎 Insert a WhatsApp button on your website.
27
  Define in which pages or zones it should appear, the delay time, if you want it to the right or to the left, only on mobile phones or also on the desktop.
@@ -36,7 +39,7 @@ You can serve users in different terminals, you can insert a different one in ea
36
  Use a balloon on the button to get the user's attention. In this way, you ensure that you do not miss any important message you want to give them, surprise them in a less intrusive way.
37
 
38
  #### 📯 Create call-to-action messages.
39
- For users to click on the button, use custom CTAs on each page, product or section. Welcome them, help them and offer them offers or promotions. [You can read more about this topic here](https://wame.chat/es/whatsapp-me-mucho-mas-que-un-click-to-chat/).
40
 
41
  #### 💬 Customize conversation start messages.
42
  So that the user does not waste time in writing. This way you will be able to know from which page it comes or what product is being consulted when you start the first conversation.
@@ -45,31 +48,33 @@ So that the user does not waste time in writing. This way you will be able to kn
45
  Define CTAs and Custom Messages for product pages, you can use dynamic variables such as {SKU}, {PRICE} or {PRODUCT}.
46
 
47
  #### 🏁 Analyze the conversion data in Google Analytics and Facebook Pixel.
48
- Remember, you do not have to do anything, the plugin already creates and computes the events by itself. [You can read more about this topic here](https://wame.chat/es/wame-mide-los-eventos-de-whatsapp-en-google-analytics/).
49
 
50
  #### 💱 Customize different languages.
51
  To be able to support all your users, wherever they are. Our plugin is compatible with WPML and Polylang.
52
 
53
- ### What you can´t do with WAme ⛔️
 
 
 
 
 
54
 
55
  #### 👨‍🎨 Modify the appearance of the button.
56
  Users recognize it instantly because it is in thousands of web pages and they know what it is for, it generates trust. If you modify it, you lose these important values.
57
 
58
  #### 😡 Wasting time configuring other similar plugins.
59
- Having many options is not an advantage, the configuration of WAme is so easy that in less than 2 minutes you will be ‘wasapeando’ with your clients.
60
-
61
- ### ⌁ Translations 🇦🇶
62
- -[English (US)](https://wordpress.org/plugins/creame-whatsapp-me/)
63
- -[Portuguese (Brazil)](https://br.wordpress.org/plugins/creame-whatsapp-me/)
64
- -[Spanish (Spain)](https://es.wordpress.org/plugins/creame-whatsapp-me/)
65
- -[Translate into your language](https://translate.wordpress.org/projects/wp-plugins/creame-whatsapp-me)
66
 
67
- ### ⌁ If you like WAme 😍
68
  1. Please leave us a [★★★★★](https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/#new-post) rating. We'll thank you.
69
- 2. Subscribe to our newsletter and visit our blog at [wame.chat](https://wame.chat/?utm_source=wporg&utm_medium=web&utm_campaign=v3_2).
70
- 3. Follow [@wamechat](https://twitter.com/wamechat) on twitter.
 
71
 
72
- *WhatsApp and WhatsApp Logo are brand assets and trademark of Facebook, Inc. WAme is not in partnership, sponsored or endorsed by Facebook, Inc.*
 
 
73
 
74
  == Installation ==
75
 
@@ -78,60 +83,68 @@ Having many options is not an advantage, the configuration of WAme is so easy th
78
 
79
  == Frequently Asked Questions ==
80
 
 
 
 
 
 
 
 
 
 
81
  = I can't see the button or it's over / under another thing =
82
 
83
  You can change the position of the button so that nothing covers it by adding this CSS in *Appearance > Customize > Custom CSS*:
84
 
85
- `.whatsappme { z-index:9999; }`
86
 
87
  Greater values of z-index are left over, the default value is 400.
88
 
89
  = What about GDPR? =
90
 
91
- WAme don't use cookies.
92
-
93
- WAme save two localStorage variables for proper operation:
94
 
95
- - `whatsappme_visited` to know if is the first time on site or is a returning user.
96
- - `whatsappme_hashes` if you set a Call To Action (CTA), when user launch WhatsApp or close Chat Window the CTA hashed is saved to prevent show automatically that CTA again.
 
97
 
98
  = Google Analytics integration =
99
 
100
- WAme send a custom event when user click to launch WhatsApp.
101
 
102
  If Global Site Tag (gtag.js) detected:
103
 
104
- `gtag('event', 'click', { 'event_category': 'WhatsAppMe', 'event_label': out_url })`
105
 
106
  If Universal Analtics (analytics.js) detected:
107
 
108
- `ga('send', 'event', 'WhatsAppMe', 'click', out_url })`
109
 
110
  If your tracker doesn't have the standard name 'ga' you can set your custom name with 'ga_tracker' setting:
111
 
112
- `add_filter( 'whatsappme_get_settings', function( $settings ){
113
  $settings['ga_tracker'] = 'my_custom_GA_name';
114
  return $settings;
115
  } );`
116
 
117
  = Google Tag Manager integration =
118
 
119
- WAme send an event (if GTM detected) when user click to launch WhatsApp:
120
 
121
- `dataLayer.push({ 'event': 'WhatsAppMe', 'eventAction': 'click', 'eventLabel': out_url });`
122
 
123
  = Facebook Pixel integration =
124
 
125
- WAme send a custom event if Facebook Pixel is detected when user click to launch WhatsApp:
126
 
127
- `fbq('trackCustom', 'WhatsAppMe', { eventAction: 'click', eventLabel: out_url });`
128
 
129
  = Other integrations =
130
 
131
- There is a Javascript event that WAme triggers automatically before launch WhatsApp, which can be used to add your custom tracking code (or other needs).
132
 
133
  `jQuery(document).ready(function($){
134
- $(document).on('whatsappme:open', function (event, args, settings) {
135
  // Your staff
136
  // Note: args.link is the link to open, you can change it
137
  // but only wa.me, whastapp.com or current domain are allowed.
@@ -140,17 +153,19 @@ There is a Javascript event that WAme triggers automatically before launch Whats
140
 
141
  = WPML/Polylang change Telephone by language =
142
 
143
- WAme general text settings can be translated with the strings translation of WPML/Polylang. You only need to save WAme settings to register strings and make them ready for translation. But "Telephone" is not translatable by default. If you need different phone numbers for every language add the following php code in your theme functions.php and save WAme settings.
144
 
145
- `add_filter( 'whatsappme_settings_i18n', function( $settings ) {
146
  $settings['telephone'] = 'Telephone';
147
  return $settings;
148
  } );`
149
 
150
- = Emojis are not saved =
 
 
 
151
 
152
- To save emojis the site database must use utf8mb4 encoding.
153
- If your database enconding is utf8 you can use emojis converting them to html entities with a tool [like this](https://mothereff.in/html-entities).
154
 
155
  == Screenshots ==
156
 
@@ -158,13 +173,21 @@ If your database enconding is utf8 you can use emojis converting them to html en
158
  2. Button with tooltip and custom image.
159
  3. Call to action on desktop.
160
  4. Button and call to action on mobile.
161
- 5. WAme general settings.
162
- 6. WAme advanced visibility settings.
163
- 7. WAme WooCommerce settings.
164
- 8. WAme on post/page edition.
165
 
166
  == Changelog ==
167
 
 
 
 
 
 
 
 
 
168
  = 3.2.3 =
169
  * FIX svg in safari < 13.
170
 
@@ -345,6 +368,15 @@ If your database enconding is utf8 you can use emojis converting them to html en
345
 
346
  == Upgrade Notice ==
347
 
 
 
 
 
 
 
 
 
 
348
  = 2.3.0 =
349
  WPML and Polylang integration.
350
  Added new settings to control delay and launch WhatsApp Web on desktop.
1
+ === Join.chat ===
2
  Contributors: creapuntome, pacotole, davidlillo, monillo
3
  Donate link: https://www.paypal.me/creapuntome/
4
  Tags: whatsapp business, whatsapp, click to chat, button, whatsapp support chat, support, contact, directly message whatsapp, floating whatsapp, whatsapp chat
5
  Requires at least: 3.0.1
6
  Tested up to: 5.4
7
  Requires PHP: 5.3
8
+ Stable tag: 4.0.0
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
12
+ (formerly WAme) We help you capture users with WhatsApp and turn them into clients.
13
 
14
  == Description ==
15
 
16
+ [join.chat](https://join.chat?utm_source=wporg&utm_medium=web&utm_campaign=v4_0) | [Add-ons](https://join.chat/en/addons/?utm_source=wporg&utm_medium=web&utm_campaign=v4_0) | [Documentation](https://join.chat/en/docs/?utm_source=wporg&utm_medium=web&utm_campaign=v4_0) | [Support](https://join.chat/en/support/?utm_source=wporg&utm_medium=web&utm_campaign=v4_0)
17
 
18
+ ### The best WhatsApp plugin for WordPress.
19
+ > We help more than 200,000 businesses worldwide to attract users and convert them into clients.
20
 
21
+ ### New in Join.chat 4.0 📍
22
 
23
+ 🌈 **Say hello to the colors.** We've redesigned the entire interface of the chat window, now you choose a color, and we customize all the visual theme of the Widget.
24
 
25
+ 🍾 **Triggers.** Your pages can interact with Join.chat and show the chat window or launch WhatsApp when user clicks or an item appears when scrolling. You just need to add a few css classes.
26
+
27
+ ### ⌁ What you can do with Join.chat ✅
28
 
29
  #### 🛎 Insert a WhatsApp button on your website.
30
  Define in which pages or zones it should appear, the delay time, if you want it to the right or to the left, only on mobile phones or also on the desktop.
39
  Use a balloon on the button to get the user's attention. In this way, you ensure that you do not miss any important message you want to give them, surprise them in a less intrusive way.
40
 
41
  #### 📯 Create call-to-action messages.
42
+ For users to click on the button, use custom CTAs on each page, product or section. Welcome them, help them and offer them offers or promotions. [You can read more about this topic here](https://join.chat/es/whatsapp-me-mucho-mas-que-un-click-to-chat/).
43
 
44
  #### 💬 Customize conversation start messages.
45
  So that the user does not waste time in writing. This way you will be able to know from which page it comes or what product is being consulted when you start the first conversation.
48
  Define CTAs and Custom Messages for product pages, you can use dynamic variables such as {SKU}, {PRICE} or {PRODUCT}.
49
 
50
  #### 🏁 Analyze the conversion data in Google Analytics and Facebook Pixel.
51
+ Remember, you do not have to do anything, the plugin already creates and computes the events by itself. [You can read more about this topic here](https://join.chat/es/wame-mide-los-eventos-de-whatsapp-en-google-analytics/).
52
 
53
  #### 💱 Customize different languages.
54
  To be able to support all your users, wherever they are. Our plugin is compatible with WPML and Polylang.
55
 
56
+ ### 🌚 Dark Mode.
57
+ Display the chat window with dark colors and white text. From settings you can activate it or leave it automatic so that it detects the configuration of devices in dark mode.
58
+
59
+ https://www.youtube.com/watch?v=1Gma1Wvt6gU
60
+
61
+ ### ⌁ What you can´t do with Join.chat ⛔️
62
 
63
  #### 👨‍🎨 Modify the appearance of the button.
64
  Users recognize it instantly because it is in thousands of web pages and they know what it is for, it generates trust. If you modify it, you lose these important values.
65
 
66
  #### 😡 Wasting time configuring other similar plugins.
67
+ Having many options is not an advantage, the configuration of Join.chat is so easy that in less than 2 minutes you will be ‘wasapeando’ with your clients.
 
 
 
 
 
 
68
 
69
+ ### ⌁ If you like Join.chat 😍
70
  1. Please leave us a [★★★★★](https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/#new-post) rating. We'll thank you.
71
+ 2. Help us with the [translation in your language](https://translate.wordpress.org/projects/wp-plugins/creame-whatsapp-me)
72
+ 3. Subscribe to our newsletter and visit our blog at [join.chat](https://join.chat/?utm_source=wporg&utm_medium=web&utm_campaign=v4_0).
73
+ 4. Follow [@joinchat](https://twitter.com/wamechat) on twitter.
74
 
75
+ Name history: *WhatsApp me > WAme > VVAme > **Join.chat***
76
+
77
+ *WhatsApp and WhatsApp Logo are brand assets and trademark of Facebook, Inc. Join.chat is not in partnership, sponsored or endorsed by Facebook, Inc.*
78
 
79
  == Installation ==
80
 
83
 
84
  == Frequently Asked Questions ==
85
 
86
+ = WAme now is Join.chat =
87
+
88
+ From version 4.0 we change our name to Join.chat.
89
+ To avoid using several prefixes from old and new versions we have decided to rename all them to the new `joinchat`.
90
+
91
+ * All analytics events change from `WhatsAppMe` to `JoinChat`
92
+ * All css styles change from `wame` or `whatsappme` to `joinchat`.
93
+ * All actions and filters change from `wame_` or `whatsappme_` to `joinchat_`.
94
+
95
  = I can't see the button or it's over / under another thing =
96
 
97
  You can change the position of the button so that nothing covers it by adding this CSS in *Appearance > Customize > Custom CSS*:
98
 
99
+ `.joinchat { z-index:9999; }`
100
 
101
  Greater values of z-index are left over, the default value is 400.
102
 
103
  = What about GDPR? =
104
 
105
+ Join.chat don't use cookies.
 
 
106
 
107
+ Join.chat save two localStorage variables for proper operation:
108
+ * `joinchat_visited` to know if is the first time on site or is a returning user.
109
+ * `joinchat_hashes` if you set a Call To Action (CTA), when user launch WhatsApp or close Chat Window the CTA hashed is saved to prevent show automatically that CTA again.
110
 
111
  = Google Analytics integration =
112
 
113
+ Join.chat send a custom event when user click to launch WhatsApp.
114
 
115
  If Global Site Tag (gtag.js) detected:
116
 
117
+ `gtag('event', 'click', { 'event_category': 'JoinChat', 'event_label': out_url })`
118
 
119
  If Universal Analtics (analytics.js) detected:
120
 
121
+ `ga('send', 'event', 'JoinChat', 'click', out_url })`
122
 
123
  If your tracker doesn't have the standard name 'ga' you can set your custom name with 'ga_tracker' setting:
124
 
125
+ `add_filter( 'joinchat_get_settings', function( $settings ){
126
  $settings['ga_tracker'] = 'my_custom_GA_name';
127
  return $settings;
128
  } );`
129
 
130
  = Google Tag Manager integration =
131
 
132
+ Join.chat send an event (if GTM detected) when user click to launch WhatsApp:
133
 
134
+ `dataLayer.push({ 'event': 'JoinChat', 'eventAction': 'click', 'eventLabel': out_url });`
135
 
136
  = Facebook Pixel integration =
137
 
138
+ Join.chat send a custom event if Facebook Pixel is detected when user click to launch WhatsApp:
139
 
140
+ `fbq('trackCustom', 'JoinChat', { eventAction: 'click', eventLabel: out_url });`
141
 
142
  = Other integrations =
143
 
144
+ There is a Javascript event that Join.chat triggers automatically before launch WhatsApp, which can be used to add your custom tracking code (or other needs).
145
 
146
  `jQuery(document).ready(function($){
147
+ $(document).on('joinchat:open', function (event, args, settings) {
148
  // Your staff
149
  // Note: args.link is the link to open, you can change it
150
  // but only wa.me, whastapp.com or current domain are allowed.
153
 
154
  = WPML/Polylang change Telephone by language =
155
 
156
+ Join.chat general text settings can be translated with the strings translation of WPML/Polylang. You only need to save Join.chat settings to register strings and make them ready for translation. But "Telephone" is not translateable by default. If you need different phone numbers for every language add the following php code in your theme functions.php and save Join.chat settings.
157
 
158
+ `add_filter( 'joinchat_settings_i18n', function( $settings ) {
159
  $settings['telephone'] = 'Telephone';
160
  return $settings;
161
  } );`
162
 
163
+ = Settings are not saved when using emojis =
164
+
165
+ To save emojis site database must use utf8mb4 encoding.
166
+ If settings are not saved when using emojis, add this code in your theme functions.php:
167
 
168
+ `add_filter( 'sanitize_text_field', 'wp_encode_emoji' );`
 
169
 
170
  == Screenshots ==
171
 
173
  2. Button with tooltip and custom image.
174
  3. Call to action on desktop.
175
  4. Button and call to action on mobile.
176
+ 5. Join.chat general settings.
177
+ 6. Join.chat advanced visibility settings.
178
+ 7. Join.chat WooCommerce settings.
179
+ 8. Join.chat on post/page edition.
180
 
181
  == Changelog ==
182
 
183
+ = 4.0.0 =
184
+ * **NEW:** Join.chat brand.
185
+ * **NEW:** Widget theme color.
186
+ * **NEW:** CSS class triggers to open chat window.
187
+ * **CHANGED for SEO:** All analytics events change from `WhatsAppMe` to `JoinChat`
188
+ * **CHANGED for devs:** All css styles change from `wame` or `whatsappme`to `joinchat` and all actions and filters change from `wame_` or `whatsappme_`to `joinchat_`.
189
+ * Lighter, reduced assets size and deleted images.
190
+
191
  = 3.2.3 =
192
  * FIX svg in safari < 13.
193
 
368
 
369
  == Upgrade Notice ==
370
 
371
+ = 4.0.0 =
372
+ **Join.chat rebrand.**
373
+ To avoid using several prefixes from old and new versions we have decided to rename all them to the new `joinchat`.
374
+
375
+ **WARNING**
376
+ * **For SEO:** All analytics events change from `WhatsAppMe` to `JoinChat`
377
+ * **For Devs:** All css styles change from `wame` or `whatsappme`to `joinchat`.
378
+ * **For Devs:** All actions and filters change from `wame_` or `whatsappme_`to `joinchat_`.
379
+
380
  = 2.3.0 =
381
  WPML and Polylang integration.
382
  Added new settings to control delay and launch WhatsApp Web on desktop.
admin/{class-whatsappme-admin.php → class-joinchat-admin.php} RENAMED
@@ -4,13 +4,13 @@
4
  * The admin-specific functionality of the plugin.
5
  *
6
  * @since 1.0.0
7
- * @since 2.0.0 Added advanced visibility settings
8
  * @since 3.0.0 More extendable admin via hooks
9
- * @package WhatsAppMe
10
- * @subpackage WhatsAppMe/admin
11
  * @author Creame <hola@crea.me>
12
  */
13
- class WhatsAppMe_Admin {
14
 
15
  /**
16
  * The ID of this plugin.
@@ -71,7 +71,7 @@ class WhatsAppMe_Admin {
71
  $this->version = $version;
72
 
73
  // Updated in get_settings() at 'admin_init' hook
74
- $this->enhanced_phone = '16.0.8'; // intl-tel-input version
75
  $this->tabs = array();
76
  $this->settings = array();
77
 
@@ -86,18 +86,19 @@ class WhatsAppMe_Admin {
86
  * @since 2.3.0 Added button_delay and whatsapp_web settings, message_delay in seconds
87
  * @since 3.0.0 Is public and added plugin enhanced_phone and tabs
88
  * @since 3.1.0 Added tooltip and image
 
89
  */
90
  public function get_settings() {
91
 
92
  // Use International Telephone Input library version or false to disable
93
- $this->enhanced_phone = apply_filters( 'whatsappme_enhanced_phone', $this->enhanced_phone );
94
 
95
  // Admin tabs
96
  $this->tabs = apply_filters(
97
- 'whatsappme_admin_tabs',
98
  array(
99
- 'general' => __( 'General', 'creame-whatsapp-me' ),
100
- 'advanced' => __( 'Advanced', 'creame-whatsapp-me' ),
101
  )
102
  );
103
 
@@ -112,17 +113,19 @@ class WhatsAppMe_Admin {
112
  'whatsapp_web' => 'no',
113
  'message_text' => '',
114
  'message_delay' => 10,
 
115
  'message_badge' => 'no',
116
  'message_send' => '',
117
  'message_start' => __( 'Open chat', 'creame-whatsapp-me' ),
118
  'position' => 'right',
119
  'visibility' => array( 'all' => 'yes' ),
 
120
  'dark_mode' => 'no',
121
  ),
122
- apply_filters( 'whatsappme_extra_settings', array() )
123
  );
124
 
125
- $saved_settings = get_option( 'whatsappme' );
126
 
127
  if ( is_array( $saved_settings ) ) {
128
  // clean unused saved settings
@@ -148,8 +151,8 @@ class WhatsAppMe_Admin {
148
  */
149
  public function register_styles( $hook ) {
150
 
151
- $styles = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'whatsappme.css' : 'whatsappme.min.css';
152
- wp_register_style( 'whatsappme-admin', plugin_dir_url( __FILE__ ) . 'css/' . $styles, array(), $this->version, 'all' );
153
 
154
  if ( $this->enhanced_phone ) {
155
  wp_register_style( 'intl-tel-input', 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/' . $this->enhanced_phone . '/css/intlTelInput.css', array(), null, 'all' );
@@ -166,14 +169,14 @@ class WhatsAppMe_Admin {
166
  */
167
  public function register_scripts( $hook ) {
168
 
169
- $script = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'whatsappme.js' : 'whatsappme.min.js';
170
 
171
  if ( $this->enhanced_phone ) {
172
  wp_register_script( 'intl-tel-input', 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/' . $this->enhanced_phone . '/js/intlTelInput.min.js', array(), null, true );
173
- wp_register_script( 'whatsappme-admin', plugin_dir_url( __FILE__ ) . 'js/' . $script, array( 'jquery', 'intl-tel-input' ), $this->version, true );
174
  wp_localize_script( 'intl-tel-input', 'intl_tel_input_version', $this->enhanced_phone );
175
  } else {
176
- wp_register_script( 'whatsappme-admin', plugin_dir_url( __FILE__ ) . 'js/' . $script, array( 'jquery' ), $this->version, true );
177
  }
178
 
179
  }
@@ -183,7 +186,7 @@ class WhatsAppMe_Admin {
183
  * From v1.2.0 also set filter to disable enhanced phone input
184
  *
185
  * @since 1.0.0
186
- * @since 2.0.0 Added tabs for general and Advanced settings
187
  * @since 2.3.0 Split general settings in Button and Window Chat
188
  * @since 3.0.0 Admin organized by tabs and sections
189
  * @access public
@@ -191,19 +194,19 @@ class WhatsAppMe_Admin {
191
  */
192
  public function settings_init() {
193
 
194
- // Register WordPress 'whatsappme' settings
195
- register_setting( 'whatsappme', 'whatsappme', array( $this, 'settings_validate' ) );
196
 
197
  foreach ( $this->tabs as $tab => $tab_name ) {
198
 
199
- add_settings_section( "whatsappme_tab_{$tab}_open", null, array( $this, 'settings_tab_open' ), 'whatsappme' );
200
 
201
  $sections = $this->get_tab_sections( $tab );
202
 
203
  foreach ( $sections as $section => $fields ) {
204
- $section_id = "whatsappme_tab_{$tab}__{$section}";
205
 
206
- add_settings_section( $section_id, null, array( $this, 'section_output' ), 'whatsappme' );
207
 
208
  foreach ( $fields as $field => $field_args ) {
209
  if ( is_array( $field_args ) ) {
@@ -214,11 +217,11 @@ class WhatsAppMe_Admin {
214
  $field_callback = array( $this, 'field_output' );
215
  }
216
 
217
- add_settings_field( "whatsappme_$field", $field_name, $field_callback, 'whatsappme', $section_id, $field );
218
  }
219
  }
220
 
221
- add_settings_section( "whatsappme_tab_{$tab}_close", null, array( $this, 'settings_tab_close' ), 'whatsappme' );
222
  }
223
 
224
  }
@@ -236,26 +239,31 @@ class WhatsAppMe_Admin {
236
  if ( 'general' == $tab ) {
237
 
238
  $sections = array(
239
- 'button' => array(
240
- 'telephone' => '<label for="whatsappme_phone">' . __( 'Telephone', 'creame-whatsapp-me' ) . '</label>',
241
- 'message_send' => '<label for="whatsappme_message_send">' . __( 'Message', 'creame-whatsapp-me' ) . '</label>' . self::vars_help( 'message_send' ),
242
- 'mobile_only' => __( 'Mobile Only', 'creame-whatsapp-me' ),
243
  'position' => __( 'Position on Screen', 'creame-whatsapp-me' ),
244
  'button_image' => __( 'Image', 'creame-whatsapp-me' ),
245
- 'button_tip' => __( 'Tooltip', 'creame-whatsapp-me' ),
246
- 'button_delay' => '<label for="whatsappme_button_delay">' . __( 'Button Delay', 'creame-whatsapp-me' ) . '</label>',
 
247
  'whatsapp_web' => __( 'WhatsApp Web', 'creame-whatsapp-me' ),
248
  ),
249
- 'chat' => array(
250
- 'message_text' => '<label for="whatsappme_message_text">' . __( 'Call to Action', 'creame-whatsapp-me' ) . '</label>' . self::vars_help( 'message_text' ),
251
- 'message_start' => '<label for="whatsappme_message_start">' . __( 'Start WhatsApp Button', 'creame-whatsapp-me' ) . '</label>',
252
- 'message_delay' => '<label for="whatsappme_message_delay">' . __( 'Chat Delay', 'creame-whatsapp-me' ) . '</label>',
253
- 'message_badge' => __( 'Notification Balloon', 'creame-whatsapp-me' ),
254
  'dark_mode' => __( 'Dark Mode', 'creame-whatsapp-me' ),
 
 
 
 
 
 
255
  ),
256
  );
257
 
258
- } elseif ( 'advanced' == $tab ) {
259
 
260
  $sections = array(
261
  'global' => array(
@@ -285,7 +293,7 @@ class WhatsAppMe_Admin {
285
 
286
  // Custom Post Types
287
  $custom_post_types = apply_filters(
288
- 'whatsappme_custom_post_types',
289
  array_keys( get_post_types( array( 'has_archive' => true ), 'names' ) )
290
  );
291
 
@@ -308,7 +316,7 @@ class WhatsAppMe_Admin {
308
  }
309
 
310
  // Filter tab sections to add, remove or edit sections or fields
311
- return apply_filters( "whatsappme_tab_{$tab}_sections", $sections );
312
 
313
  }
314
 
@@ -328,11 +336,11 @@ class WhatsAppMe_Admin {
328
 
329
  // Prevent bad behavior when validate twice on first save
330
  // bug https://core.trac.wordpress.org/ticket/21989
331
- if ( count( get_settings_errors( 'whatsappme' ) ) ) {
332
  return $input;
333
  }
334
 
335
- $util = new WhatsAppMe_Util(); // Shortcut
336
 
337
  $input['telephone'] = $util::clean_input( $input['telephone'] );
338
  $input['mobile_only'] = isset( $input['mobile_only'] ) ? 'yes' : 'no';
@@ -345,7 +353,9 @@ class WhatsAppMe_Admin {
345
  $input['message_send'] = $util::clean_input( $input['message_send'] );
346
  $input['message_start'] = $util::substr( $util::clean_input( $input['message_start'] ), 0, 20 );
347
  $input['message_delay'] = intval( $input['message_delay'] );
 
348
  $input['position'] = $input['position'] != 'left' ? 'right' : 'left';
 
349
  $input['dark_mode'] = in_array( $input['dark_mode'], array( 'no', 'yes', 'auto' ) ) ? $input['dark_mode'] : 'no';
350
  if ( isset( $input['view'] ) ) {
351
  $input['visibility'] = array_filter(
@@ -358,22 +368,22 @@ class WhatsAppMe_Admin {
358
  }
359
 
360
  // Filter for other validations or extra settings
361
- $input = apply_filters( 'whatsappme_settings_validate', $input );
362
 
363
  /**
364
  * Register WPML/Polylang strings for translation
365
  * https://wpml.org/wpml-hook/wpml_register_single_string/
366
  */
367
- $settings_i18n = WhatsAppMe_Util::settings_i18n();
368
 
369
  foreach ( $settings_i18n as $setting_key => $setting_name ) {
370
- do_action( 'wpml_register_single_string', 'WhatsApp me', $setting_name, $input[ $setting_key ] );
371
  }
372
 
373
  // Extra actions on save
374
- do_action( 'whatsappme_settings_validate', $input );
375
 
376
- add_settings_error( 'whatsappme', 'settings_updated', __( 'Settings saved', 'creame-whatsapp-me' ), 'updated' );
377
 
378
  return $input;
379
  }
@@ -387,10 +397,11 @@ class WhatsAppMe_Admin {
387
  */
388
  public function settings_tab_open( $args ) {
389
 
390
- $tab_id = str_replace( array( 'whatsappme_tab_', '_open' ), '', $args['id'] );
391
- $active = 'general' == $tab_id ? 'wametab-active' : '';
 
392
 
393
- echo "<div id=\"whatsappme_tab_$tab_id\" class=\"wametab $active\" role=\"tabpanel\" aria-labelledby=\"navtab_$tab_id\" >";
394
 
395
  }
396
 
@@ -418,12 +429,12 @@ class WhatsAppMe_Admin {
418
  $section_id = $args['id'];
419
 
420
  switch ( $section_id ) {
421
- case 'whatsappme_tab_general__button':
422
  $output = '<h2 class="title">' . __( 'Button', 'creame-whatsapp-me' ) . '</h2>' .
423
  '<p>' . __( 'Set the contact number and where you want the WhatsApp button to be displayed.', 'creame-whatsapp-me' ) . '</p>';
424
  break;
425
 
426
- case 'whatsappme_tab_general__chat':
427
  $output = '<hr><h2 class="title">' . __( 'Chat Window', 'creame-whatsapp-me' ) . '</h2>' .
428
  '<p>' .
429
  __( 'If you define a "Call to Action" a window will be displayed simulating a chat before launching WhatsApp.', 'creame-whatsapp-me' ) . ' ' .
@@ -431,17 +442,24 @@ class WhatsAppMe_Admin {
431
  '</p>';
432
  break;
433
 
434
- case 'whatsappme_tab_advanced__global':
435
- $output = '<h2 class="title">' . __( 'Advanced Visibility Settings', 'creame-whatsapp-me' ) . '</h2>' .
 
 
 
 
 
 
 
436
  '<p>' . __( 'From here you can configure on which pages the WhatsApp button will be visible.', 'creame-whatsapp-me' ) .
437
- ' <a href="#" class="whatsappme_view_reset">' . __( 'Restore default visibility', 'creame-whatsapp-me' ) . '</a></p>';
438
  break;
439
 
440
- case 'whatsappme_tab_advanced__wp':
441
  $output = '<hr>';
442
  break;
443
 
444
- case 'whatsappme_tab_advanced__cpt':
445
  $output = '<h2 class="title">' . __( 'Custom Post Types', 'creame-whatsapp-me' ) . '</h2>';
446
  break;
447
 
@@ -451,7 +469,7 @@ class WhatsAppMe_Admin {
451
  }
452
 
453
  // Filter section opening ouput
454
- echo apply_filters( 'whatsappme_section_output', $output, $section_id );
455
  }
456
 
457
  /**
@@ -467,112 +485,133 @@ class WhatsAppMe_Admin {
467
  $field = substr( $field_id, 6 );
468
  $value = isset( $this->settings['visibility'][ $field ] ) ? $this->settings['visibility'][ $field ] : '';
469
 
470
- $output = '<label><input type="radio" name="whatsappme[view][' . $field . ']" value="yes"' . checked( 'yes', $value, false ) . '> ' .
471
  '<span class="dashicons dashicons-visibility" title="' . __( 'Show', 'creame-whatsapp-me' ) . '"></span></label>' .
472
- '<label><input type="radio" name="whatsappme[view][' . $field . ']" value="no"' . checked( 'no', $value, false ) . '> ' .
473
  '<span class="dashicons dashicons-hidden" title="' . __( 'Hide', 'creame-whatsapp-me' ) . '"></span></label>' .
474
- '<label><input type="radio" name="whatsappme[view][' . $field . ']" value=""' . checked( '', $value, false ) . '> ' .
475
  __( 'Inherit', 'creame-whatsapp-me' ) . ' <span class="dashicons dashicons-visibility view_inheritance_' . $field . '"></span></label>';
476
 
477
  } else {
478
 
479
  $value = isset( $this->settings[ $field_id ] ) ? $this->settings[ $field_id ] : '';
480
- $utm = '?utm_source=wpadmin&utm_medium=settings&utm_campaign=v' . str_replace( '.', '_', $this->version );
 
481
 
482
  switch ( $field_id ) {
483
  case 'telephone':
484
- $output = '<input id="whatsappme_phone" ' . ( $this->enhanced_phone ? 'data-' : '' ) . 'name="whatsappme[telephone]" value="' . $value . '" type="text" style="width:15em">' .
485
  '<p class="description">' . __( "Contact phone number <strong>(the button will not be shown if it's empty)</strong>", 'creame-whatsapp-me' ) . '</p>' .
486
- '<p class="whatsappme-addon">' . sprintf(
487
  __( 'Add unlimited numbers with %1$s or multiple contacts with %2$s', 'creame-whatsapp-me' ),
488
- '<a href="https://wame.chat/en/addons/wame-random-phone/' . $utm . '" target="_blank">\'WAme Random Phone\'</a>',
489
- '<a href="https://wame.chat/en/addons/support-agents/' . $utm . '" target="_blank">\'WAme Agents\'</a>'
490
  ) . '</p>';
491
  break;
492
 
493
  case 'mobile_only':
494
  $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Mobile Only', 'creame-whatsapp-me' ) . '</span></legend>' .
495
- '<label><input id="whatsappme_mobile_only" name="whatsappme[mobile_only]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
496
  __( 'Only display the button on mobile devices', 'creame-whatsapp-me' ) . '</label></fieldset>';
497
  break;
498
 
499
  case 'position':
500
  $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Position on Screen', 'creame-whatsapp-me' ) . '</span></legend>' .
501
- '<label><input name="whatsappme[position]" value="left" type="radio"' . checked( 'left', $value, false ) . '> ' .
502
  __( 'Left', 'creame-whatsapp-me' ) . '</label><br>' .
503
- '<label><input name="whatsappme[position]" value="right" type="radio"' . checked( 'right', $value, false ) . '> ' .
504
  __( 'Right', 'creame-whatsapp-me' ) . '</label></fieldset>';
505
  break;
506
 
507
  case 'button_image':
508
- $thumb = intval( $value ) > 0 ? WhatsAppMe_Util::thumb( $value, 116, 116 ) : false;
509
  $image = is_array( $thumb ) ? $thumb['url'] : false;
510
 
511
- $output = '<div id="whatsappme_button_image_wrapper">' .
512
- '<div id="whatsappme_button_image_holder" ' . ( $image ? "style=\"background-size:cover; background-image:url('$image');\"" : '' ) . '></div>' .
513
- '<input id="whatsappme_button_image" name="whatsappme[button_image]" type="hidden" value="' . $value . '">' .
514
- '<input id="whatsappme_button_image_add" type="button" value="' . esc_attr__( 'Select an image', 'creame-whatsapp-me' ) . '" class="button-primary" ' .
515
  'data-title="' . esc_attr__( 'Select button image', 'creame-whatsapp-me' ) . '" data-button="' . esc_attr__( 'Use image', 'creame-whatsapp-me' ) . '"> ' .
516
- '<input id="whatsappme_button_image_remove" type="button" value="' . esc_attr__( 'Remove', 'creame-whatsapp-me' ) . '" class="button-secondary' . ( $image ? '' : ' wame-hidden' ) . '">' .
517
  '<p class="description">' . __( 'The image will alternate with WhatsApp logo', 'creame-whatsapp-me' ) . '</p></div>';
518
  break;
519
 
520
  case 'button_tip':
521
- $output = '<input id="whatsappme_button_tip" name="whatsappme[button_tip]" value="' . $value . '" type="text" maxlength="40" class="regular-text" placeholder="' . esc_attr__( '💬 Need help?', 'creame-whatsapp-me' ) . '"> ' .
522
  '<p class="description">' . __( 'Short text shown next to WhatsApp button', 'creame-whatsapp-me' ) . '</p>';
523
  break;
524
 
525
  case 'button_delay':
526
- $output = '<input id="whatsappme_button_delay" name="whatsappme[button_delay]" value="' . $value . '" type="number" min="0" max="120" style="width:5em"> ' . __( 'seconds', 'creame-whatsapp-me' ) .
527
  '<p class="description">' . __( 'Time since the page is opened until the WhatsApp button is displayed', 'creame-whatsapp-me' ) . '</p>';
528
  break;
529
 
530
  case 'whatsapp_web':
531
  $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'WhatsApp Web', 'creame-whatsapp-me' ) . '</span></legend>' .
532
- '<label><input id="whatsappme_whatsapp_web" name="whatsappme[whatsapp_web]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
533
  __( 'Open <em>WhatsApp Web</em> directly on desktop', 'creame-whatsapp-me' ) . '</label></fieldset>';
534
  break;
535
 
536
  case 'message_text':
537
- $output = '<textarea id="whatsappme_message_text" name="whatsappme[message_text]" rows="4" class="regular-text" placeholder="' . esc_attr__( "Hello 👋\nCan we help you?", 'creame-whatsapp-me' ) . '">' . $value . '</textarea>' .
538
  '<p class="description">' . __( 'Define a text to encourage users to contact by WhatsApp', 'creame-whatsapp-me' ) . '</p>' .
539
- '<p class="whatsappme-addon">' . sprintf(
540
  __( 'Add links, images, videos and more with %s', 'creame-whatsapp-me' ),
541
- '<a href="https://wame.chat/en/addons/cta-extras/' . $utm . '" target="_blank">\'WAme CTA Extras\'</a>'
542
  ) . '</p>';
543
  break;
544
 
545
  case 'message_send':
546
- $output = '<textarea id="whatsappme_message_send" name="whatsappme[message_send]" rows="3" class="regular-text" placeholder="' . esc_attr__( 'Hi *{SITE}*! I need more info about {TITLE} {URL}', 'creame-whatsapp-me' ) . '">' . $value . '</textarea>' .
547
  '<p class="description">' . __( 'Predefined text for the first message the user will send you', 'creame-whatsapp-me' ) . '</p>';
548
  break;
549
 
550
  case 'message_start':
551
- $output = '<input id="whatsappme_message_start" name="whatsappme[message_start]" value="' . $value . '" type="text" maxlength="20" class="regular-text" placeholder="' . esc_attr__( 'Open chat', 'creame-whatsapp-me' ) . '"> ' .
552
  '<p class="description">' . __( 'Text of the start WhatsApp button on Chat Window', 'creame-whatsapp-me' ) . '</p>';
553
  break;
554
 
555
  case 'message_delay':
556
- $output = '<input id="whatsappme_message_delay" name="whatsappme[message_delay]" value="' . $value . '" type="number" min="0" max="120" style="width:5em"> ' . __( 'seconds (0 disabled)', 'creame-whatsapp-me' ) .
557
- '<p class="description">' . __( 'Chat Window is automatically displayed after delay', 'creame-whatsapp-me' ) . '</p>';
 
 
 
 
 
558
  break;
559
 
560
  case 'message_badge':
561
  $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Notification Balloon', 'creame-whatsapp-me' ) . '</span></legend>' .
562
- '<label><input id="whatsappme_message_badge" name="whatsappme[message_badge]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
563
  __( 'Display a notification balloon instead of opening the Chat Window for a "less intrusive" mode', 'creame-whatsapp-me' ) . '</label></fieldset>';
564
  break;
565
 
 
 
 
 
566
  case 'dark_mode':
567
  $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Dark Mode', 'creame-whatsapp-me' ) . '</span></legend>' .
568
- '<label><input name="whatsappme[dark_mode]" value="no" type="radio"' . checked( 'no', $value, false ) . '> ' .
569
  __( 'No', 'creame-whatsapp-me' ) . '</label><br>' .
570
- '<label><input name="whatsappme[dark_mode]" value="yes" type="radio"' . checked( 'yes', $value, false ) . '> ' .
571
  __( 'Yes', 'creame-whatsapp-me' ) . '</label><br>' .
572
- '<label><input name="whatsappme[dark_mode]" value="auto" type="radio"' . checked( 'auto', $value, false ) . '> ' .
573
  __( 'Auto (detects device dark mode)', 'creame-whatsapp-me' ) . '</label></fieldset>';
574
  break;
575
 
 
 
 
 
 
 
 
 
 
 
 
576
  default:
577
  $output = '';
578
  break;
@@ -580,7 +619,7 @@ class WhatsAppMe_Admin {
580
  }
581
 
582
  // Filter field ouput
583
- echo apply_filters( 'whatsappme_field_output', $output, $field_id, $this->settings );
584
  }
585
 
586
  /**
@@ -594,7 +633,7 @@ class WhatsAppMe_Admin {
594
  $value = ( isset( $this->settings['visibility']['all'] ) && 'no' == $this->settings['visibility']['all'] ) ? 'no' : 'yes';
595
 
596
  $inheritance = apply_filters(
597
- 'whatsappme_advanced_inheritance',
598
  array(
599
  'all' => array( 'front_page', 'blog_page', '404_page', 'search', 'archive', 'singular', 'cpts' ),
600
  'archive' => array( 'date', 'author' ),
@@ -602,10 +641,10 @@ class WhatsAppMe_Admin {
602
  )
603
  );
604
 
605
- echo '<div class="whatsappme_view_all" data-inheritance="' . esc_attr( json_encode( $inheritance ) ) . '">' .
606
- '<label><input type="radio" name="whatsappme[view][all]" value="yes"' . checked( 'yes', $value, false ) . '> ' .
607
  '<span class="dashicons dashicons-visibility" title="' . __( 'Show', 'creame-whatsapp-me' ) . '"></span></label>' .
608
- '<label><input type="radio" name="whatsappme[view][all]" value="no"' . checked( 'no', $value, false ) . '> ' .
609
  '<span class="dashicons dashicons-hidden" title="' . __( 'Hide', 'creame-whatsapp-me' ) . '"></span></label></div>';
610
  }
611
 
@@ -618,7 +657,7 @@ class WhatsAppMe_Admin {
618
  */
619
  public function add_menu() {
620
 
621
- add_options_page( 'WAme chat', 'WAme chat', 'manage_options', 'whatsappme', array( $this, 'options_page' ) );
622
 
623
  }
624
 
@@ -631,7 +670,8 @@ class WhatsAppMe_Admin {
631
  */
632
  function help_tab() {
633
  $screen = get_current_screen();
634
- $utm = '?utm_source=wpadmin&utm_medium=helptab&utm_campaign=v' . str_replace( '.', '_', $this->version );
 
635
 
636
  $help_tabs = array(
637
  array(
@@ -639,29 +679,24 @@ class WhatsAppMe_Admin {
639
  'title' => __( 'Support and Help', 'creame-whatsapp-me' ),
640
  'content' =>
641
  '<p>' . sprintf(
642
- __(
643
- 'If you need help, first review our <a href="%1$s" rel="external" target="_blank">documentation</a> ' .
644
- 'and if you don\'t find a solution check the <a href="%2$s" rel="external" target="_blank">free plugin support forum</a> ' .
645
- 'or buy our <a href="%3$s" rel="external" target="_blank">premium support</a>.',
646
- 'creame-whatsapp-me'
647
- ),
648
- esc_url( 'https://wame.chat/en/docs/' . $utm ),
649
  esc_url( 'https://wordpress.org/support/plugin/creame-whatsapp-me/' ),
650
- esc_url( 'https://my.wame.chat/' . $utm )
651
  ) . '</p>' .
652
- '<p>' . __( 'If you like WAme 😍', 'creame-whatsapp-me' ) . '</p>' .
653
  '<ul>' .
654
  '<li>' . sprintf(
655
  __( "Please leave us a %s rating. We'll thank you.", 'creame-whatsapp-me' ),
656
- '<a href="https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/#new-post" rel="external" target="_blank">★★★★★</a>'
657
  ) . '</li>' .
658
  '<li>' . sprintf(
659
  __( 'Subscribe to our newsletter and visit our blog at %s.', 'creame-whatsapp-me' ),
660
- '<a href="https://wame.chat/' . $utm . '" rel="external" target="_blank">wame.chat</a>'
661
  ) . '</li>' .
662
  '<li>' . sprintf(
663
  __( 'Follow %s on twitter.', 'creame-whatsapp-me' ),
664
- '<a href="https://twitter.com/wamechat" rel="external" target="_blank">@wamechat</a>'
665
  ) . '</li>' .
666
  '</ul>',
667
  ),
@@ -677,10 +712,27 @@ class WhatsAppMe_Admin {
677
  '<span><code>{TITLE}</code> ➜ ' . __( 'Page Title', 'creame-whatsapp-me' ) . '</span>' .
678
  '</p>',
679
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
  );
681
 
682
  foreach ( $help_tabs as $tab_data ) {
683
- $screen->add_help_tab( apply_filters( 'whatsappme_help_tab_' . str_replace( '-', '_', $tab_data['id'] ), $tab_data ) );
684
  }
685
 
686
  }
@@ -690,16 +742,42 @@ class WhatsAppMe_Admin {
690
  *
691
  * @since 1.0.0
692
  * @access public
693
- * @return void
 
694
  */
695
  public function settings_link( $links ) {
696
 
697
  $settings_link = '<a href="options-general.php?page=' . $this->plugin_name . '">' . __( 'Settings', 'creame-whatsapp-me' ) . '</a>';
698
  array_unshift( $links, $settings_link );
 
699
  return $links;
700
 
701
  }
702
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
703
  /**
704
  * Generate the options page in the WordPress admin
705
  *
@@ -713,30 +791,32 @@ class WhatsAppMe_Admin {
713
  // Enqueue WordPress media scripts
714
  wp_enqueue_media();
715
  // Enqueue assets
716
- wp_enqueue_script( 'whatsappme-admin' );
717
- wp_enqueue_style( 'whatsappme-admin' );
 
718
 
719
  if ( $this->enhanced_phone ) {
720
  wp_enqueue_style( 'intl-tel-input' );
721
  }
722
 
 
723
  ?>
724
  <div class="wrap">
725
- <h1>WAme chat</h1>
726
 
727
- <form method="post" id="whatsappme_form" action="options.php" autocomplete="off">
728
- <?php settings_fields( 'whatsappme' ); ?>
729
  <h2 class="nav-tab-wrapper wp-clearfix" role="tablist">
730
  <?php foreach ( $this->tabs as $tab => $name ) : ?>
731
- <?php if ( 'general' === $tab ) : ?>
732
- <a id="navtab_<?php echo $tab; ?>" href="#whatsappme_tab_<?php echo $tab; ?>" class="nav-tab nav-tab-active" role="tab" aria-controls="whatsappme_tab_<?php echo $tab; ?>" aria-selected="true"><?php echo $name; ?></a>
733
  <?php else : ?>
734
- <a id="navtab_<?php echo $tab; ?>" href="#whatsappme_tab_<?php echo $tab; ?>" class="nav-tab" role="tab" aria-controls="whatsappme_tab_<?php echo $tab; ?>" aria-selected="false"><?php echo $name; ?></a>
735
  <?php endif; ?>
736
  <?php endforeach; ?>
737
  </h2>
738
- <div class="wametabs">
739
- <?php do_settings_sections( 'whatsappme' ); ?>
740
  </div><!-- end tabs -->
741
  <?php submit_button(); ?>
742
  </form>
@@ -757,13 +837,13 @@ class WhatsAppMe_Admin {
757
  // Custom post types with public url
758
  $custom_post_types = array_keys( get_post_types( array( 'has_archive' => true ), 'names' ) );
759
 
760
- // Add/remove posts types for "WAme chat" meta box
761
- $post_types = apply_filters( 'whatsappme_post_types_meta_box', array_merge( $builtin_post_types, $custom_post_types ) );
762
 
763
  foreach ( $post_types as $post_type ) {
764
  add_meta_box(
765
- 'whatsappme',
766
- __( 'WAme chat', 'creame-whatsapp-me' ),
767
  array( $this, 'meta_box' ),
768
  $post_type,
769
  'side',
@@ -779,40 +859,33 @@ class WhatsAppMe_Admin {
779
  * @since 2.0.0 Now can set as [show, hide, default]
780
  * @since 2.2.0 Enqueue scripts/styles. Added "telephone"
781
  * @since 3.0.3 Capture and filter output
782
- * @since 3.2.0 Added filter 'whatsappme_metabox_placeholders'
783
  * @access public
784
  * @return void
785
  */
786
  public function meta_box( $post ) {
787
 
788
  // Enqueue assets
789
- wp_enqueue_script( 'whatsappme-admin' );
790
- wp_enqueue_style( 'whatsappme-admin' );
791
 
792
  if ( $this->enhanced_phone ) {
793
  wp_enqueue_style( 'intl-tel-input' );
794
  }
795
 
796
- $metadata = get_post_meta( $post->ID, '_whatsappme', true ) ?: array();
797
  $metadata = array_merge(
798
  array(
799
  'telephone' => '',
800
  'message_text' => '',
801
  'message_send' => '',
802
- 'hide' => false,
803
  'view' => '',
804
  ),
805
  $metadata
806
  );
807
 
808
- // Move old 'hide' to new 'view' field
809
- if ( $metadata['hide'] ) {
810
- $metadata['view'] = 'no';
811
- }
812
- unset( $metadata['hide'] );
813
-
814
  $placeholders = apply_filters(
815
- 'whatsappme_metabox_placeholders',
816
  array(
817
  'telephone' => $this->settings['telephone'],
818
  'message_text' => $this->settings['message_text'],
@@ -822,45 +895,45 @@ class WhatsAppMe_Admin {
822
  $this->settings
823
  );
824
 
825
- $metabox_vars = apply_filters( 'whatsappme_metabox_vars', array( 'SITE', 'URL', 'TITLE' ), $post );
826
 
827
  ob_start();
828
  ?>
829
- <div class="whatsappme-metabox">
830
- <?php wp_nonce_field( 'whatsappme_data', 'whatsappme_nonce' ); ?>
831
  <p>
832
- <label for="whatsappme_phone"><?php _e( 'Telephone', 'creame-whatsapp-me' ); ?></label><br>
833
- <input id="whatsappme_phone" <?php echo $this->enhanced_phone ? 'data-' : ''; ?>name="whatsappme_telephone" value="<?php echo $metadata['telephone']; ?>" type="text" placeholder="<?php echo $placeholders['telephone']; ?>">
834
  </p>
835
  <p>
836
- <label for="whatsappme_message"><?php _e( 'Call to Action', 'creame-whatsapp-me' ); ?></label><br>
837
- <textarea id="whatsappme_message" name="whatsappme_message" rows="2" placeholder="<?php echo $placeholders['message_text']; ?>" class="large-text"><?php echo $metadata['message_text']; ?></textarea>
838
  </p>
839
  <p>
840
- <label for="whatsappme_message_send"><?php _e( 'Message', 'creame-whatsapp-me' ); ?></label><br>
841
- <textarea id="whatsappme_message_send" name="whatsappme_message_send" rows="2" placeholder="<?php echo $placeholders['message_send']; ?>" class="large-text"><?php echo $metadata['message_send']; ?></textarea>
842
  <?php if ( count( $metabox_vars ) ) : ?>
843
  <small><?php _e( 'Can use vars', 'creame-whatsapp-me' ); ?> <code>{<?php echo join( '}</code> <code>{', $metabox_vars ); ?>}</code></small>
844
  <?php endif; ?>
845
  <small><?php _e( 'to leave it blank use', 'creame-whatsapp-me' ); ?> <code>{}</code></small>
846
  </p>
847
  <p>
848
- <label><input type="radio" name="whatsappme_view" value="yes" <?php checked( 'yes', $metadata['view'] ); ?>>
849
  <span class="dashicons dashicons-visibility" title="<?php echo __( 'Show', 'creame-whatsapp-me' ); ?>"></span></label>
850
- <label><input type="radio" name="whatsappme_view" value="no" <?php checked( 'no', $metadata['view'] ); ?>>
851
  <span class="dashicons dashicons-hidden" title="<?php echo __( 'Hide', 'creame-whatsapp-me' ); ?>"></span></label>
852
- <label><input type="radio" name="whatsappme_view" value="" <?php checked( '', $metadata['view'] ); ?>>
853
  <?php echo __( 'Default visibility', 'creame-whatsapp-me' ); ?></label>
854
  </p>
855
  </div>
856
  <?php
857
  $metabox_output = ob_get_clean();
858
 
859
- echo apply_filters( 'whatsappme_metabox_output', $metabox_output, $post, $metadata );
860
  }
861
 
862
  /**
863
- * Save meta data from "WAme chat" Meta Box on post save
864
  *
865
  * @since 1.1.0
866
  * @since 2.0.0 Change 'hide' key to 'view' now values can be [yes, no]
@@ -871,29 +944,29 @@ class WhatsAppMe_Admin {
871
  */
872
  public function save_post( $post_id ) {
873
  if ( wp_is_post_autosave( $post_id ) ||
874
- ! isset( $_POST['whatsappme_nonce'] ) ||
875
- ! wp_verify_nonce( $_POST['whatsappme_nonce'], 'whatsappme_data' ) ) {
876
  return;
877
  }
878
 
879
  // Clean and delete empty/false fields
880
  $metadata = array_filter(
881
- WhatsAppMe_Util::clean_input(
882
  array(
883
- 'telephone' => $_POST['whatsappme_telephone'],
884
- 'message_text' => $_POST['whatsappme_message'],
885
- 'message_send' => $_POST['whatsappme_message_send'],
886
- 'view' => $_POST['whatsappme_view'],
887
  )
888
  )
889
  );
890
 
891
- $metadata = apply_filters( 'whatsappme_metabox_save', $metadata, $post_id );
892
 
893
  if ( count( $metadata ) ) {
894
- update_post_meta( $post_id, '_whatsappme', $metadata );
895
  } else {
896
- delete_post_meta( $post_id, '_whatsappme' );
897
  }
898
  }
899
 
@@ -907,10 +980,10 @@ class WhatsAppMe_Admin {
907
  */
908
  public static function vars_help( $field ) {
909
 
910
- $vars = apply_filters( 'whatsappme_vars_help', array( 'SITE', 'URL', 'TITLE' ), $field );
911
 
912
- return count( $vars ) ? '<div class="whatsappme_vars_help">' . __( 'You can use vars', 'creame-whatsapp-me' ) . ' ' .
913
- '<a class="whatsappme-show-help" href="#" title="' . __( 'Show Help', 'creame-whatsapp-me' ) . '">?</a><br> ' .
914
  '<code>{' . join( '}</code> <code>{', $vars ) . '}</code></div>' : '';
915
 
916
  }
4
  * The admin-specific functionality of the plugin.
5
  *
6
  * @since 1.0.0
7
+ * @since 2.0.0 Added visibility settings
8
  * @since 3.0.0 More extendable admin via hooks
9
+ * @package JoinChat
10
+ * @subpackage JoinChat/admin
11
  * @author Creame <hola@crea.me>
12
  */
13
+ class JoinChatAdmin {
14
 
15
  /**
16
  * The ID of this plugin.
71
  $this->version = $version;
72
 
73
  // Updated in get_settings() at 'admin_init' hook
74
+ $this->enhanced_phone = '16.0.11'; // intl-tel-input version
75
  $this->tabs = array();
76
  $this->settings = array();
77
 
86
  * @since 2.3.0 Added button_delay and whatsapp_web settings, message_delay in seconds
87
  * @since 3.0.0 Is public and added plugin enhanced_phone and tabs
88
  * @since 3.1.0 Added tooltip and image
89
+ * @since 4.0.0 Added message_views and color
90
  */
91
  public function get_settings() {
92
 
93
  // Use International Telephone Input library version or false to disable
94
+ $this->enhanced_phone = apply_filters( 'joinchat_enhanced_phone', $this->enhanced_phone );
95
 
96
  // Admin tabs
97
  $this->tabs = apply_filters(
98
+ 'joinchat_admin_tabs',
99
  array(
100
+ 'general' => __( 'General', 'creame-whatsapp-me' ),
101
+ 'visibility' => __( 'Visibility', 'creame-whatsapp-me' ),
102
  )
103
  );
104
 
113
  'whatsapp_web' => 'no',
114
  'message_text' => '',
115
  'message_delay' => 10,
116
+ 'message_views' => 2,
117
  'message_badge' => 'no',
118
  'message_send' => '',
119
  'message_start' => __( 'Open chat', 'creame-whatsapp-me' ),
120
  'position' => 'right',
121
  'visibility' => array( 'all' => 'yes' ),
122
+ 'color' => '#25d366',
123
  'dark_mode' => 'no',
124
  ),
125
+ apply_filters( 'joinchat_extra_settings', array() )
126
  );
127
 
128
+ $saved_settings = get_option( 'joinchat' );
129
 
130
  if ( is_array( $saved_settings ) ) {
131
  // clean unused saved settings
151
  */
152
  public function register_styles( $hook ) {
153
 
154
+ $styles = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'joinchat.css' : 'joinchat.min.css';
155
+ wp_register_style( 'joinchat-admin', plugin_dir_url( __FILE__ ) . 'css/' . $styles, array(), $this->version, 'all' );
156
 
157
  if ( $this->enhanced_phone ) {
158
  wp_register_style( 'intl-tel-input', 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/' . $this->enhanced_phone . '/css/intlTelInput.css', array(), null, 'all' );
169
  */
170
  public function register_scripts( $hook ) {
171
 
172
+ $script = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? 'joinchat.js' : 'joinchat.min.js';
173
 
174
  if ( $this->enhanced_phone ) {
175
  wp_register_script( 'intl-tel-input', 'https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/' . $this->enhanced_phone . '/js/intlTelInput.min.js', array(), null, true );
176
+ wp_register_script( 'joinchat-admin', plugin_dir_url( __FILE__ ) . 'js/' . $script, array( 'jquery', 'wp-color-picker', 'intl-tel-input' ), $this->version, true );
177
  wp_localize_script( 'intl-tel-input', 'intl_tel_input_version', $this->enhanced_phone );
178
  } else {
179
+ wp_register_script( 'joinchat-admin', plugin_dir_url( __FILE__ ) . 'js/' . $script, array( 'jquery', 'wp-color-picker' ), $this->version, true );
180
  }
181
 
182
  }
186
  * From v1.2.0 also set filter to disable enhanced phone input
187
  *
188
  * @since 1.0.0
189
+ * @since 2.0.0 Added tabs for general and Visibility settings
190
  * @since 2.3.0 Split general settings in Button and Window Chat
191
  * @since 3.0.0 Admin organized by tabs and sections
192
  * @access public
194
  */
195
  public function settings_init() {
196
 
197
+ // Register WordPress 'joinchat' settings
198
+ register_setting( 'joinchat', 'joinchat', array( $this, 'settings_validate' ) );
199
 
200
  foreach ( $this->tabs as $tab => $tab_name ) {
201
 
202
+ add_settings_section( "joinchat_tab_{$tab}_open", null, array( $this, 'settings_tab_open' ), 'joinchat' );
203
 
204
  $sections = $this->get_tab_sections( $tab );
205
 
206
  foreach ( $sections as $section => $fields ) {
207
+ $section_id = "joinchat_tab_{$tab}__{$section}";
208
 
209
+ add_settings_section( $section_id, null, array( $this, 'section_output' ), 'joinchat' );
210
 
211
  foreach ( $fields as $field => $field_args ) {
212
  if ( is_array( $field_args ) ) {
217
  $field_callback = array( $this, 'field_output' );
218
  }
219
 
220
+ add_settings_field( "joinchat_$field", $field_name, $field_callback, 'joinchat', $section_id, $field );
221
  }
222
  }
223
 
224
+ add_settings_section( "joinchat_tab_{$tab}_close", null, array( $this, 'settings_tab_close' ), 'joinchat' );
225
  }
226
 
227
  }
239
  if ( 'general' == $tab ) {
240
 
241
  $sections = array(
242
+ 'button' => array(
243
+ 'telephone' => '<label for="joinchat_phone">' . __( 'Telephone', 'creame-whatsapp-me' ) . '</label>',
244
+ 'message_send' => '<label for="joinchat_message_send">' . __( 'Message', 'creame-whatsapp-me' ) . '</label>' . self::vars_help( 'message_send' ),
 
245
  'position' => __( 'Position on Screen', 'creame-whatsapp-me' ),
246
  'button_image' => __( 'Image', 'creame-whatsapp-me' ),
247
+ 'button_tip' => '<label for="joinchat_button_tip">' . __( 'Tooltip', 'creame-whatsapp-me' ) . '</label>',
248
+ 'button_delay' => '<label for="joinchat_button_delay">' . __( 'Button Delay', 'creame-whatsapp-me' ) . '</label>',
249
+ 'mobile_only' => __( 'Mobile Only', 'creame-whatsapp-me' ),
250
  'whatsapp_web' => __( 'WhatsApp Web', 'creame-whatsapp-me' ),
251
  ),
252
+ 'chat' => array(
253
+ 'message_text' => '<label for="joinchat_message_text">' . __( 'Call to Action', 'creame-whatsapp-me' ) . '</label>' . self::vars_help( 'message_text' ),
254
+ 'message_start' => '<label for="joinchat_message_start">' . __( 'Start WhatsApp Button', 'creame-whatsapp-me' ) . '</label>',
255
+ 'color' => __( 'Theme Color', 'creame-whatsapp-me' ),
 
256
  'dark_mode' => __( 'Dark Mode', 'creame-whatsapp-me' ),
257
+ 'remove_brand' => __( 'Logo', 'creame-whatsapp-me' ),
258
+ ),
259
+ 'chat_open' => array(
260
+ 'message_delay' => '<label for="joinchat_message_delay">' . __( 'Chat Delay', 'creame-whatsapp-me' ) . '</label>',
261
+ 'message_views' => '<label for="joinchat_message_views">' . __( 'Page Views', 'creame-whatsapp-me' ) . '</label>',
262
+ 'message_badge' => __( 'Notification Balloon', 'creame-whatsapp-me' ),
263
  ),
264
  );
265
 
266
+ } elseif ( 'visibility' == $tab ) {
267
 
268
  $sections = array(
269
  'global' => array(
293
 
294
  // Custom Post Types
295
  $custom_post_types = apply_filters(
296
+ 'joinchat_custom_post_types',
297
  array_keys( get_post_types( array( 'has_archive' => true ), 'names' ) )
298
  );
299
 
316
  }
317
 
318
  // Filter tab sections to add, remove or edit sections or fields
319
+ return apply_filters( "joinchat_tab_{$tab}_sections", $sections );
320
 
321
  }
322
 
336
 
337
  // Prevent bad behavior when validate twice on first save
338
  // bug https://core.trac.wordpress.org/ticket/21989
339
+ if ( count( get_settings_errors( 'joinchat' ) ) ) {
340
  return $input;
341
  }
342
 
343
+ $util = new JoinChatUtil(); // Shortcut
344
 
345
  $input['telephone'] = $util::clean_input( $input['telephone'] );
346
  $input['mobile_only'] = isset( $input['mobile_only'] ) ? 'yes' : 'no';
353
  $input['message_send'] = $util::clean_input( $input['message_send'] );
354
  $input['message_start'] = $util::substr( $util::clean_input( $input['message_start'] ), 0, 20 );
355
  $input['message_delay'] = intval( $input['message_delay'] );
356
+ $input['message_views'] = intval( $input['message_views'] ) ?: 1;
357
  $input['position'] = $input['position'] != 'left' ? 'right' : 'left';
358
+ $input['color'] = preg_match( '/^#[a-f0-9]{6}$/i', $input['color'] ) ? $input['color'] : '#25d366';
359
  $input['dark_mode'] = in_array( $input['dark_mode'], array( 'no', 'yes', 'auto' ) ) ? $input['dark_mode'] : 'no';
360
  if ( isset( $input['view'] ) ) {
361
  $input['visibility'] = array_filter(
368
  }
369
 
370
  // Filter for other validations or extra settings
371
+ $input = apply_filters( 'joinchat_settings_validate', $input );
372
 
373
  /**
374
  * Register WPML/Polylang strings for translation
375
  * https://wpml.org/wpml-hook/wpml_register_single_string/
376
  */
377
+ $settings_i18n = JoinChatUtil::settings_i18n();
378
 
379
  foreach ( $settings_i18n as $setting_key => $setting_name ) {
380
+ do_action( 'wpml_register_single_string', 'Join.chat', $setting_name, $input[ $setting_key ] );
381
  }
382
 
383
  // Extra actions on save
384
+ do_action( 'joinchat_settings_validate', $input );
385
 
386
+ add_settings_error( 'joinchat', 'settings_updated', __( 'Settings saved', 'creame-whatsapp-me' ), 'updated' );
387
 
388
  return $input;
389
  }
397
  */
398
  public function settings_tab_open( $args ) {
399
 
400
+ $tab_id = str_replace( array( 'joinchat_tab_', '_open' ), '', $args['id'] );
401
+ $active_tab = isset( $_GET['tab'] ) && in_array( $_GET['tab'], array_keys( $this->tabs ) ) ? $_GET['tab'] : 'general';
402
+ $active = $active_tab == $tab_id ? 'joinchat-tab-active' : '';
403
 
404
+ echo "<div id=\"joinchat_tab_$tab_id\" class=\"joinchat-tab $active\" role=\"tabpanel\" aria-labelledby=\"navtab_$tab_id\" >";
405
 
406
  }
407
 
429
  $section_id = $args['id'];
430
 
431
  switch ( $section_id ) {
432
+ case 'joinchat_tab_general__button':
433
  $output = '<h2 class="title">' . __( 'Button', 'creame-whatsapp-me' ) . '</h2>' .
434
  '<p>' . __( 'Set the contact number and where you want the WhatsApp button to be displayed.', 'creame-whatsapp-me' ) . '</p>';
435
  break;
436
 
437
+ case 'joinchat_tab_general__chat':
438
  $output = '<hr><h2 class="title">' . __( 'Chat Window', 'creame-whatsapp-me' ) . '</h2>' .
439
  '<p>' .
440
  __( 'If you define a "Call to Action" a window will be displayed simulating a chat before launching WhatsApp.', 'creame-whatsapp-me' ) . ' ' .
442
  '</p>';
443
  break;
444
 
445
+ case 'joinchat_tab_general__chat_open':
446
+ $output = '<p>' .
447
+ __( 'If it\'s defined a "Call to Action", the Chat Window can be displayed automatically if conditions are met.', 'creame-whatsapp-me' ) .
448
+ ' <a class="joinchat-show-help" href="#tab-link-triggers" title="' . __( 'Show Help', 'creame-whatsapp-me' ) . '">?</a>' .
449
+ '</p>';
450
+ break;
451
+
452
+ case 'joinchat_tab_visibility__global':
453
+ $output = '<h2 class="title">' . __( 'Visibility Settings', 'creame-whatsapp-me' ) . '</h2>' .
454
  '<p>' . __( 'From here you can configure on which pages the WhatsApp button will be visible.', 'creame-whatsapp-me' ) .
455
+ ' <a href="#" class="joinchat_view_reset">' . __( 'Restore default visibility', 'creame-whatsapp-me' ) . '</a></p>';
456
  break;
457
 
458
+ case 'joinchat_tab_visibility__wp':
459
  $output = '<hr>';
460
  break;
461
 
462
+ case 'joinchat_tab_visibility__cpt':
463
  $output = '<h2 class="title">' . __( 'Custom Post Types', 'creame-whatsapp-me' ) . '</h2>';
464
  break;
465
 
469
  }
470
 
471
  // Filter section opening ouput
472
+ echo apply_filters( 'joinchat_section_output', $output, $section_id );
473
  }
474
 
475
  /**
485
  $field = substr( $field_id, 6 );
486
  $value = isset( $this->settings['visibility'][ $field ] ) ? $this->settings['visibility'][ $field ] : '';
487
 
488
+ $output = '<label><input type="radio" name="joinchat[view][' . $field . ']" value="yes"' . checked( 'yes', $value, false ) . '> ' .
489
  '<span class="dashicons dashicons-visibility" title="' . __( 'Show', 'creame-whatsapp-me' ) . '"></span></label>' .
490
+ '<label><input type="radio" name="joinchat[view][' . $field . ']" value="no"' . checked( 'no', $value, false ) . '> ' .
491
  '<span class="dashicons dashicons-hidden" title="' . __( 'Hide', 'creame-whatsapp-me' ) . '"></span></label>' .
492
+ '<label><input type="radio" name="joinchat[view][' . $field . ']" value=""' . checked( '', $value, false ) . '> ' .
493
  __( 'Inherit', 'creame-whatsapp-me' ) . ' <span class="dashicons dashicons-visibility view_inheritance_' . $field . '"></span></label>';
494
 
495
  } else {
496
 
497
  $value = isset( $this->settings[ $field_id ] ) ? $this->settings[ $field_id ] : '';
498
+ $utm = '?utm_source=settings&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
499
+ $lang = _x( 'en', 'url lang slug (only avaible for spanish "es")', 'creame-whatsapp-me' );
500
 
501
  switch ( $field_id ) {
502
  case 'telephone':
503
+ $output = '<input id="joinchat_phone" ' . ( $this->enhanced_phone ? 'data-' : '' ) . 'name="joinchat[telephone]" value="' . $value . '" type="text" style="width:15em">' .
504
  '<p class="description">' . __( "Contact phone number <strong>(the button will not be shown if it's empty)</strong>", 'creame-whatsapp-me' ) . '</p>' .
505
+ '<p class="joinchat-addon">' . sprintf(
506
  __( 'Add unlimited numbers with %1$s or multiple contacts with %2$s', 'creame-whatsapp-me' ),
507
+ '<a href="https://join.chat/' . $lang . '/addons/random-phone/' . $utm . '" target="_blank">\'Random Phone\'</a>',
508
+ '<a href="https://join.chat/' . $lang . '/addons/support-agents/' . $utm . '" target="_blank">\'Support Agents\'</a>'
509
  ) . '</p>';
510
  break;
511
 
512
  case 'mobile_only':
513
  $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Mobile Only', 'creame-whatsapp-me' ) . '</span></legend>' .
514
+ '<label><input id="joinchat_mobile_only" name="joinchat[mobile_only]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
515
  __( 'Only display the button on mobile devices', 'creame-whatsapp-me' ) . '</label></fieldset>';
516
  break;
517
 
518
  case 'position':
519
  $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Position on Screen', 'creame-whatsapp-me' ) . '</span></legend>' .
520
+ '<label><input name="joinchat[position]" value="left" type="radio"' . checked( 'left', $value, false ) . '> ' .
521
  __( 'Left', 'creame-whatsapp-me' ) . '</label><br>' .
522
+ '<label><input name="joinchat[position]" value="right" type="radio"' . checked( 'right', $value, false ) . '> ' .
523
  __( 'Right', 'creame-whatsapp-me' ) . '</label></fieldset>';
524
  break;
525
 
526
  case 'button_image':
527
+ $thumb = intval( $value ) > 0 ? JoinChatUtil::thumb( $value, 116, 116 ) : false;
528
  $image = is_array( $thumb ) ? $thumb['url'] : false;
529
 
530
+ $output = '<div id="joinchat_button_image_wrapper">' .
531
+ '<div id="joinchat_button_image_holder" ' . ( $image ? "style=\"background-size:cover; background-image:url('$image');\"" : '' ) . '></div>' .
532
+ '<input id="joinchat_button_image" name="joinchat[button_image]" type="hidden" value="' . $value . '">' .
533
+ '<input id="joinchat_button_image_add" type="button" value="' . esc_attr__( 'Select an image', 'creame-whatsapp-me' ) . '" class="button-primary" ' .
534
  'data-title="' . esc_attr__( 'Select button image', 'creame-whatsapp-me' ) . '" data-button="' . esc_attr__( 'Use image', 'creame-whatsapp-me' ) . '"> ' .
535
+ '<input id="joinchat_button_image_remove" type="button" value="' . esc_attr__( 'Remove', 'creame-whatsapp-me' ) . '" class="button-secondary' . ( $image ? '' : ' joinchat-hidden' ) . '">' .
536
  '<p class="description">' . __( 'The image will alternate with WhatsApp logo', 'creame-whatsapp-me' ) . '</p></div>';
537
  break;
538
 
539
  case 'button_tip':
540
+ $output = '<input id="joinchat_button_tip" name="joinchat[button_tip]" value="' . $value . '" type="text" maxlength="40" class="regular-text" placeholder="' . esc_attr__( '💬 Need help?', 'creame-whatsapp-me' ) . '"> ' .
541
  '<p class="description">' . __( 'Short text shown next to WhatsApp button', 'creame-whatsapp-me' ) . '</p>';
542
  break;
543
 
544
  case 'button_delay':
545
+ $output = '<input id="joinchat_button_delay" name="joinchat[button_delay]" value="' . $value . '" type="number" min="0" max="120" style="width:5em"> ' . __( 'seconds', 'creame-whatsapp-me' ) .
546
  '<p class="description">' . __( 'Time since the page is opened until the WhatsApp button is displayed', 'creame-whatsapp-me' ) . '</p>';
547
  break;
548
 
549
  case 'whatsapp_web':
550
  $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'WhatsApp Web', 'creame-whatsapp-me' ) . '</span></legend>' .
551
+ '<label><input id="joinchat_whatsapp_web" name="joinchat[whatsapp_web]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
552
  __( 'Open <em>WhatsApp Web</em> directly on desktop', 'creame-whatsapp-me' ) . '</label></fieldset>';
553
  break;
554
 
555
  case 'message_text':
556
+ $output = '<textarea id="joinchat_message_text" name="joinchat[message_text]" rows="4" class="regular-text" placeholder="' . esc_attr__( "Hello 👋\nCan we help you?", 'creame-whatsapp-me' ) . '">' . $value . '</textarea>' .
557
  '<p class="description">' . __( 'Define a text to encourage users to contact by WhatsApp', 'creame-whatsapp-me' ) . '</p>' .
558
+ '<p class="joinchat-addon">' . sprintf(
559
  __( 'Add links, images, videos and more with %s', 'creame-whatsapp-me' ),
560
+ '<a href="https://join.chat/' . $lang . '/addons/cta-extras/' . $utm . '" target="_blank">\'CTA Extras\'</a>'
561
  ) . '</p>';
562
  break;
563
 
564
  case 'message_send':
565
+ $output = '<textarea id="joinchat_message_send" name="joinchat[message_send]" rows="3" class="regular-text" placeholder="' . esc_attr__( 'Hi *{SITE}*! I need more info about {TITLE} {URL}', 'creame-whatsapp-me' ) . '">' . $value . '</textarea>' .
566
  '<p class="description">' . __( 'Predefined text for the first message the user will send you', 'creame-whatsapp-me' ) . '</p>';
567
  break;
568
 
569
  case 'message_start':
570
+ $output = '<input id="joinchat_message_start" name="joinchat[message_start]" value="' . $value . '" type="text" maxlength="20" class="regular-text" placeholder="' . esc_attr__( 'Open chat', 'creame-whatsapp-me' ) . '"> ' .
571
  '<p class="description">' . __( 'Text of the start WhatsApp button on Chat Window', 'creame-whatsapp-me' ) . '</p>';
572
  break;
573
 
574
  case 'message_delay':
575
+ $output = '<input id="joinchat_message_delay" name="joinchat[message_delay]" value="' . $value . '" type="number" min="0" max="120" style="width:5em"> ' . __( 'seconds (0 disabled)', 'creame-whatsapp-me' ) .
576
+ '<p class="description">' . __( 'Chat Window auto displays after delay', 'creame-whatsapp-me' ) . '</p>';
577
+ break;
578
+
579
+ case 'message_views':
580
+ $output = '<input id="joinchat_message_views" name="joinchat[message_views]" value="' . $value . '" type="number" min="1" max="120" style="width:5em"> ' .
581
+ '<p class="description">' . __( 'Chat Window auto displays from this number of page views', 'creame-whatsapp-me' ) . '</p>';
582
  break;
583
 
584
  case 'message_badge':
585
  $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Notification Balloon', 'creame-whatsapp-me' ) . '</span></legend>' .
586
+ '<label><input id="joinchat_message_badge" name="joinchat[message_badge]" value="yes" type="checkbox"' . checked( 'yes', $value, false ) . '> ' .
587
  __( 'Display a notification balloon instead of opening the Chat Window for a "less intrusive" mode', 'creame-whatsapp-me' ) . '</label></fieldset>';
588
  break;
589
 
590
+ case 'color':
591
+ $output = '<input id="joinchat_color" name="joinchat[color]" value="' . $value . '" type="text" data-default-color="#25d366"> ';
592
+ break;
593
+
594
  case 'dark_mode':
595
  $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Dark Mode', 'creame-whatsapp-me' ) . '</span></legend>' .
596
+ '<label><input name="joinchat[dark_mode]" value="no" type="radio"' . checked( 'no', $value, false ) . '> ' .
597
  __( 'No', 'creame-whatsapp-me' ) . '</label><br>' .
598
+ '<label><input name="joinchat[dark_mode]" value="yes" type="radio"' . checked( 'yes', $value, false ) . '> ' .
599
  __( 'Yes', 'creame-whatsapp-me' ) . '</label><br>' .
600
+ '<label><input name="joinchat[dark_mode]" value="auto" type="radio"' . checked( 'auto', $value, false ) . '> ' .
601
  __( 'Auto (detects device dark mode)', 'creame-whatsapp-me' ) . '</label></fieldset>';
602
  break;
603
 
604
+ case 'remove_brand':
605
+ $output = '<fieldset><legend class="screen-reader-text"><span>' . __( 'Logo', 'creame-whatsapp-me' ) . '</span></legend>' .
606
+ '<label><input id="joinchat_remove_brand" type="checkbox" disabled> ' .
607
+ __( 'Remove "Powered by Join.chat" link', 'creame-whatsapp-me' ) . '</label></fieldset>' .
608
+ '<p class="joinchat-addon">' . sprintf(
609
+ __( 'Included with all our %1$sadd-ons%2$s', 'creame-whatsapp-me' ),
610
+ '<a target="_blank" href="https://join.chat/' . $lang . '/addons/' . $utm . '">',
611
+ '</a>'
612
+ ) . '</p>';
613
+ break;
614
+
615
  default:
616
  $output = '';
617
  break;
619
  }
620
 
621
  // Filter field ouput
622
+ echo apply_filters( 'joinchat_field_output', $output, $field_id, $this->settings );
623
  }
624
 
625
  /**
633
  $value = ( isset( $this->settings['visibility']['all'] ) && 'no' == $this->settings['visibility']['all'] ) ? 'no' : 'yes';
634
 
635
  $inheritance = apply_filters(
636
+ 'joinchat_visibility_inheritance',
637
  array(
638
  'all' => array( 'front_page', 'blog_page', '404_page', 'search', 'archive', 'singular', 'cpts' ),
639
  'archive' => array( 'date', 'author' ),
641
  )
642
  );
643
 
644
+ echo '<div class="joinchat_view_all" data-inheritance="' . esc_attr( json_encode( $inheritance ) ) . '">' .
645
+ '<label><input type="radio" name="joinchat[view][all]" value="yes"' . checked( 'yes', $value, false ) . '> ' .
646
  '<span class="dashicons dashicons-visibility" title="' . __( 'Show', 'creame-whatsapp-me' ) . '"></span></label>' .
647
+ '<label><input type="radio" name="joinchat[view][all]" value="no"' . checked( 'no', $value, false ) . '> ' .
648
  '<span class="dashicons dashicons-hidden" title="' . __( 'Hide', 'creame-whatsapp-me' ) . '"></span></label></div>';
649
  }
650
 
657
  */
658
  public function add_menu() {
659
 
660
+ add_options_page( 'Join.chat', 'Join.chat', 'manage_options', 'joinchat', array( $this, 'options_page' ) );
661
 
662
  }
663
 
670
  */
671
  function help_tab() {
672
  $screen = get_current_screen();
673
+ $utm = '?utm_source=helptab&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
674
+ $lang = _x( 'en', 'url lang slug (only avaible for spanish "es")', 'creame-whatsapp-me' );
675
 
676
  $help_tabs = array(
677
  array(
679
  'title' => __( 'Support and Help', 'creame-whatsapp-me' ),
680
  'content' =>
681
  '<p>' . sprintf(
682
+ __( 'If you need help, first review our <a href="%1$s" target="_blank">documentation</a> and if you don\'t find a solution check the <a href="%2$s" target="_blank">free plugin support forum</a> or buy our <a href="%3$s" target="_blank">premium support</a>.', 'creame-whatsapp-me' ),
683
+ esc_url( 'https://join.chat/' . $lang . '/docs/' . $utm ),
 
 
 
 
 
684
  esc_url( 'https://wordpress.org/support/plugin/creame-whatsapp-me/' ),
685
+ esc_url( 'https://my.join.chat/' . $utm )
686
  ) . '</p>' .
687
+ '<p>' . __( 'If you like Join.chat 😍', 'creame-whatsapp-me' ) . '</p>' .
688
  '<ul>' .
689
  '<li>' . sprintf(
690
  __( "Please leave us a %s rating. We'll thank you.", 'creame-whatsapp-me' ),
691
+ '<a href="https://wordpress.org/support/plugin/creame-whatsapp-me/reviews/#new-post" target="_blank">★★★★★</a>'
692
  ) . '</li>' .
693
  '<li>' . sprintf(
694
  __( 'Subscribe to our newsletter and visit our blog at %s.', 'creame-whatsapp-me' ),
695
+ '<a href="https://join.chat/' . $utm . '" target="_blank">join.chat</a>'
696
  ) . '</li>' .
697
  '<li>' . sprintf(
698
  __( 'Follow %s on twitter.', 'creame-whatsapp-me' ),
699
+ '<a href="https://twitter.com/joinchatnow" target="_blank">@joinchatnow</a>'
700
  ) . '</li>' .
701
  '</ul>',
702
  ),
712
  '<span><code>{TITLE}</code> ➜ ' . __( 'Page Title', 'creame-whatsapp-me' ) . '</span>' .
713
  '</p>',
714
  ),
715
+ array(
716
+ 'id' => 'triggers',
717
+ 'title' => __( 'Triggers', 'creame-whatsapp-me' ),
718
+ 'content' =>
719
+ '<p>' . __( 'Chat Window with a Call to Action (CTA) can be displayed automatically after a defined delay time and from a number of page views.', 'creame-whatsapp-me' ) . ' ' .
720
+ __( 'When the user close Chat Window or open WhatsApp, that CTA will not automatically show again.', 'creame-whatsapp-me' ) . '</p>' .
721
+ '<p>' . __( 'You can also interact with Join.chat in your pages adding some CSS classes to your HTML:', 'creame-whatsapp-me' ) . '</p>' .
722
+ '<ul>' .
723
+ '<li><code>joinchat_open</code> ' . __( 'to show Chat Window or open WhatsApp on click.', 'creame-whatsapp-me' ) . '</li>' .
724
+ '<li><code>joinchat_close</code> ' . __( 'to hide Chat Window on click.', 'creame-whatsapp-me' ) . '</li>' .
725
+ '<li>' . __( 'To show Chat Window when an HTML element appears on screen when user scrolls:', 'creame-whatsapp-me' ) .
726
+ '<ul>' .
727
+ '<li><code>joinchat_show</code> ' . __( 'only show if it\'s an not seen CTA.', 'creame-whatsapp-me' ) . '</li>' .
728
+ '<li><code>joinchat_force_show</code> ' . __( 'to show allways.', 'creame-whatsapp-me' ) . '</li>' .
729
+ '</ul></li>' .
730
+ '</ul>',
731
+ ),
732
  );
733
 
734
  foreach ( $help_tabs as $tab_data ) {
735
+ $screen->add_help_tab( apply_filters( 'joinchat_help_tab_' . str_replace( '-', '_', $tab_data['id'] ), $tab_data ) );
736
  }
737
 
738
  }
742
  *
743
  * @since 1.0.0
744
  * @access public
745
+ * @param array $links current plugin links.
746
+ * @return array
747
  */
748
  public function settings_link( $links ) {
749
 
750
  $settings_link = '<a href="options-general.php?page=' . $this->plugin_name . '">' . __( 'Settings', 'creame-whatsapp-me' ) . '</a>';
751
  array_unshift( $links, $settings_link );
752
+
753
  return $links;
754
 
755
  }
756
 
757
+ /**
758
+ * Add plugin meta links
759
+ *
760
+ * @since 4.0.0
761
+ * @access public
762
+ * @param array $plugin_meta current plugin row meta.
763
+ * @param string $plugin_file plugin file.
764
+ * @return array
765
+ */
766
+ public function plugin_links( $plugin_meta, $plugin_file ) {
767
+
768
+ if ( 'creame-whatsapp-me/joinchat.php' == $plugin_file ) {
769
+ $utm = '?utm_source=plugins&utm_medium=wpadmin&utm_campaign=v' . str_replace( '.', '_', $this->version );
770
+ $lang = _x( 'en', 'url lang slug (only avaible for spanish "es")', 'creame-whatsapp-me' );
771
+
772
+ $plugin_meta[] = '<a target="_blank" href="https://join.chat/' . $lang . '/docs/' . $utm . '">' . __( 'Documentation', 'creame-whatsapp-me' ) . '</a>';
773
+ $plugin_meta[] = '<a target="_blank" href="https://join.chat/' . $lang . '/addons/' . $utm . '">' . __( 'Add-ons', 'creame-whatsapp-me' ) . '</a>';
774
+ $plugin_meta[] = '<a target="_blank" href="https://join.chat/' . $lang . '/support/' . $utm . '">' . __( 'Support', 'creame-whatsapp-me' ) . '</a>';
775
+ }
776
+
777
+ return $plugin_meta;
778
+
779
+ }
780
+
781
  /**
782
  * Generate the options page in the WordPress admin
783
  *
791
  // Enqueue WordPress media scripts
792
  wp_enqueue_media();
793
  // Enqueue assets
794
+ wp_enqueue_script( 'joinchat-admin' );
795
+ wp_enqueue_style( 'wp-color-picker' );
796
+ wp_enqueue_style( 'joinchat-admin' );
797
 
798
  if ( $this->enhanced_phone ) {
799
  wp_enqueue_style( 'intl-tel-input' );
800
  }
801
 
802
+ $active_tab = isset( $_GET['tab'] ) && in_array( $_GET['tab'], array_keys( $this->tabs ) ) ? $_GET['tab'] : 'general';
803
  ?>
804
  <div class="wrap">
805
+ <h1><?php _e( 'Join.chat Settings', 'creame-whatsapp-me' ); ?></h1>
806
 
807
+ <form method="post" id="joinchat_form" action="options.php" autocomplete="off">
808
+ <?php settings_fields( 'joinchat' ); ?>
809
  <h2 class="nav-tab-wrapper wp-clearfix" role="tablist">
810
  <?php foreach ( $this->tabs as $tab => $name ) : ?>
811
+ <?php if ( $active_tab === $tab ) : ?>
812
+ <a id="navtab_<?php echo $tab; ?>" href="#joinchat_tab_<?php echo $tab; ?>" class="nav-tab nav-tab-active" role="tab" aria-controls="joinchat_tab_<?php echo $tab; ?>" aria-selected="true"><?php echo $name; ?></a>
813
  <?php else : ?>
814
+ <a id="navtab_<?php echo $tab; ?>" href="#joinchat_tab_<?php echo $tab; ?>" class="nav-tab" role="tab" aria-controls="joinchat_tab_<?php echo $tab; ?>" aria-selected="false"><?php echo $name; ?></a>
815
  <?php endif; ?>
816
  <?php endforeach; ?>
817
  </h2>
818
+ <div class="joinchat-tabs">
819
+ <?php do_settings_sections( 'joinchat' ); ?>
820
  </div><!-- end tabs -->
821
  <?php submit_button(); ?>
822
  </form>
837
  // Custom post types with public url
838
  $custom_post_types = array_keys( get_post_types( array( 'has_archive' => true ), 'names' ) );
839
 
840
+ // Add/remove posts types for "Join.chat" meta box
841
+ $post_types = apply_filters( 'joinchat_post_types_meta_box', array_merge( $builtin_post_types, $custom_post_types ) );
842
 
843
  foreach ( $post_types as $post_type ) {
844
  add_meta_box(
845
+ 'joinchat',
846
+ __( 'Join.chat', 'creame-whatsapp-me' ),
847
  array( $this, 'meta_box' ),
848
  $post_type,
849
  'side',
859
  * @since 2.0.0 Now can set as [show, hide, default]
860
  * @since 2.2.0 Enqueue scripts/styles. Added "telephone"
861
  * @since 3.0.3 Capture and filter output
862
+ * @since 3.2.0 Added filter 'joinchat_metabox_placeholders'
863
  * @access public
864
  * @return void
865
  */
866
  public function meta_box( $post ) {
867
 
868
  // Enqueue assets
869
+ wp_enqueue_script( 'joinchat-admin' );
870
+ wp_enqueue_style( 'joinchat-admin' );
871
 
872
  if ( $this->enhanced_phone ) {
873
  wp_enqueue_style( 'intl-tel-input' );
874
  }
875
 
876
+ $metadata = get_post_meta( $post->ID, '_joinchat', true ) ?: array();
877
  $metadata = array_merge(
878
  array(
879
  'telephone' => '',
880
  'message_text' => '',
881
  'message_send' => '',
 
882
  'view' => '',
883
  ),
884
  $metadata
885
  );
886
 
 
 
 
 
 
 
887
  $placeholders = apply_filters(
888
+ 'joinchat_metabox_placeholders',
889
  array(
890
  'telephone' => $this->settings['telephone'],
891
  'message_text' => $this->settings['message_text'],
895
  $this->settings
896
  );
897
 
898
+ $metabox_vars = apply_filters( 'joinchat_metabox_vars', array( 'SITE', 'URL', 'TITLE' ), $post );
899
 
900
  ob_start();
901
  ?>
902
+ <div class="joinchat-metabox">
903
+ <?php wp_nonce_field( 'joinchat_data', 'joinchat_nonce' ); ?>
904
  <p>
905
+ <label for="joinchat_phone"><?php _e( 'Telephone', 'creame-whatsapp-me' ); ?></label><br>
906
+ <input id="joinchat_phone" <?php echo $this->enhanced_phone ? 'data-' : ''; ?>name="joinchat_telephone" value="<?php echo $metadata['telephone']; ?>" type="text" placeholder="<?php echo $placeholders['telephone']; ?>">
907
  </p>
908
  <p>
909
+ <label for="joinchat_message"><?php _e( 'Call to Action', 'creame-whatsapp-me' ); ?></label><br>
910
+ <textarea id="joinchat_message" name="joinchat_message" rows="2" placeholder="<?php echo $placeholders['message_text']; ?>" class="large-text"><?php echo $metadata['message_text']; ?></textarea>
911
  </p>
912
  <p>
913
+ <label for="joinchat_message_send"><?php _e( 'Message', 'creame-whatsapp-me' ); ?></label><br>
914
+ <textarea id="joinchat_message_send" name="joinchat_message_send" rows="2" placeholder="<?php echo $placeholders['message_send']; ?>" class="large-text"><?php echo $metadata['message_send']; ?></textarea>
915
  <?php if ( count( $metabox_vars ) ) : ?>
916
  <small><?php _e( 'Can use vars', 'creame-whatsapp-me' ); ?> <code>{<?php echo join( '}</code> <code>{', $metabox_vars ); ?>}</code></small>
917
  <?php endif; ?>
918
  <small><?php _e( 'to leave it blank use', 'creame-whatsapp-me' ); ?> <code>{}</code></small>
919
  </p>
920
  <p>
921
+ <label><input type="radio" name="joinchat_view" value="yes" <?php checked( 'yes', $metadata['view'] ); ?>>
922
  <span class="dashicons dashicons-visibility" title="<?php echo __( 'Show', 'creame-whatsapp-me' ); ?>"></span></label>
923
+ <label><input type="radio" name="joinchat_view" value="no" <?php checked( 'no', $metadata['view'] ); ?>>
924
  <span class="dashicons dashicons-hidden" title="<?php echo __( 'Hide', 'creame-whatsapp-me' ); ?>"></span></label>
925
+ <label><input type="radio" name="joinchat_view" value="" <?php checked( '', $metadata['view'] ); ?>>
926
  <?php echo __( 'Default visibility', 'creame-whatsapp-me' ); ?></label>
927
  </p>
928
  </div>
929
  <?php
930
  $metabox_output = ob_get_clean();
931
 
932
+ echo apply_filters( 'joinchat_metabox_output', $metabox_output, $post, $metadata );
933
  }
934
 
935
  /**
936
+ * Save meta data from "Join.chat" Meta Box on post save
937
  *
938
  * @since 1.1.0
939
  * @since 2.0.0 Change 'hide' key to 'view' now values can be [yes, no]
944
  */
945
  public function save_post( $post_id ) {
946
  if ( wp_is_post_autosave( $post_id ) ||
947
+ ! isset( $_POST['joinchat_nonce'] ) ||
948
+ ! wp_verify_nonce( $_POST['joinchat_nonce'], 'joinchat_data' ) ) {
949
  return;
950
  }
951
 
952
  // Clean and delete empty/false fields
953
  $metadata = array_filter(
954
+ JoinChatUtil::clean_input(
955
  array(
956
+ 'telephone' => $_POST['joinchat_telephone'],
957
+ 'message_text' => $_POST['joinchat_message'],
958
+ 'message_send' => $_POST['joinchat_message_send'],
959
+ 'view' => $_POST['joinchat_view'],
960
  )
961
  )
962
  );
963
 
964
+ $metadata = apply_filters( 'joinchat_metabox_save', $metadata, $post_id );
965
 
966
  if ( count( $metadata ) ) {
967
+ update_post_meta( $post_id, '_joinchat', $metadata );
968
  } else {
969
+ delete_post_meta( $post_id, '_joinchat' );
970
  }
971
  }
972
 
980
  */
981
  public static function vars_help( $field ) {
982
 
983
+ $vars = apply_filters( 'joinchat_vars_help', array( 'SITE', 'URL', 'TITLE' ), $field );
984
 
985
+ return count( $vars ) ? '<div class="joinchat_vars_help">' . __( 'You can use vars', 'creame-whatsapp-me' ) . ' ' .
986
+ '<a class="joinchat-show-help" href="#" title="' . __( 'Show Help', 'creame-whatsapp-me' ) . '">?</a><br> ' .
987
  '<code>{' . join( '}</code> <code>{', $vars ) . '}</code></div>' : '';
988
 
989
  }
admin/{class-whatsappme-wooadmin.php → class-joinchat-wooadmin.php} RENAMED
@@ -4,37 +4,37 @@
4
  * The admin-specific functionality of the WooCommerce integration.
5
  *
6
  * @since 3.0.0
7
- * @package WhatsAppMe
8
- * @subpackage WhatsAppMe/admin
9
  * @author Creame <hola@crea.me>
10
  */
11
- class WhatsAppMe_WooAdmin {
12
 
13
  /**
14
  * Initialize all hooks
15
  *
16
  * @since 3.0.0
17
- * @param array $whatsappme WhatsAppMe object.
18
  * @return void
19
  */
20
- public function init( $whatsappme ) {
21
-
22
- $loader = $whatsappme->get_loader();
23
-
24
- $loader->add_filter( 'whatsappme_extra_settings', $this, 'extra_settings' );
25
- $loader->add_filter( 'whatsappme_settings_validate', $this, 'settings_validate' );
26
- $loader->add_filter( 'whatsappme_settings_i18n', $this, 'settings_i18n' );
27
- $loader->add_filter( 'whatsappme_admin_tabs', $this, 'admin_tab' );
28
- $loader->add_filter( 'whatsappme_custom_post_types', $this, 'custom_post_types' );
29
- $loader->add_filter( 'whatsappme_tab_advanced_sections', $this, 'advanced_tab_section' );
30
- $loader->add_filter( 'whatsappme_tab_woocommerce_sections', $this, 'woo_tab_sections' );
31
- $loader->add_filter( 'whatsappme_vars_help', $this, 'vars_help', 10, 2 );
32
- $loader->add_filter( 'whatsappme_section_output', $this, 'section_ouput', 10, 2 );
33
- $loader->add_filter( 'whatsappme_field_output', $this, 'field_ouput', 10, 3 );
34
- $loader->add_filter( 'whatsappme_advanced_inheritance', $this, 'advanced_inheritance' );
35
- $loader->add_filter( 'whatsappme_help_tab_styles_and_vars', $this, 'help_vars' );
36
- $loader->add_filter( 'whatsappme_metabox_vars', $this, 'metabox_vars', 10, 2 );
37
- $loader->add_filter( 'whatsappme_metabox_placeholders', $this, 'metabox_placeholders', 10, 3 );
38
  }
39
 
40
  /**
@@ -64,9 +64,9 @@ class WhatsAppMe_WooAdmin {
64
  */
65
  public function settings_validate( $input ) {
66
 
67
- $input['message_text_product'] = WhatsAppMe_Util::clean_input( $input['message_text_product'] );
68
- $input['message_text_on_sale'] = WhatsAppMe_Util::clean_input( $input['message_text_on_sale'] );
69
- $input['message_send_product'] = WhatsAppMe_Util::clean_input( $input['message_send_product'] );
70
 
71
  return $input;
72
  }
@@ -116,13 +116,13 @@ class WhatsAppMe_WooAdmin {
116
  }
117
 
118
  /**
119
- * Woocommerce sections and fields for 'whatsappme_tab_advanced'
120
  *
121
  * @since 3.0.0
122
  * @param array $sections current tab sections and fields.
123
  * @return array
124
  */
125
- public function advanced_tab_section( $sections ) {
126
 
127
  $sections['woo'] = array(
128
  'view__woocommerce' => __( 'Shop', 'creame-whatsapp-me' ),
@@ -136,7 +136,7 @@ class WhatsAppMe_WooAdmin {
136
  }
137
 
138
  /**
139
- * Woocommerce sections and fields for 'whatsappme_tab_woocommerce'
140
  *
141
  * @since 3.0.0
142
  * @param array $sections current tab sections and fields.
@@ -151,7 +151,7 @@ class WhatsAppMe_WooAdmin {
151
  );
152
 
153
  foreach ( $woo_sections as $key => $label ) {
154
- $woo_sections[ $key ] = "<label for=\"whatsappme_$key\">$label</label>" . WhatsAppMe_Admin::vars_help( $key );
155
  }
156
 
157
  $sections['chat'] = $woo_sections;
@@ -160,7 +160,7 @@ class WhatsAppMe_WooAdmin {
160
  }
161
 
162
  /**
163
- * Woocommerce sections and fields for 'whatsappme_tab_woocommerce'
164
  *
165
  * @since 3.0.0
166
  * @param array $sections current tab sections and fields.
@@ -187,11 +187,11 @@ class WhatsAppMe_WooAdmin {
187
  */
188
  public function section_ouput( $output, $section_id ) {
189
 
190
- if ( 'whatsappme_tab_advanced__woo' == $section_id ) {
191
 
192
  $output = '<h2 class="title">' . __( 'WooCommerce', 'creame-whatsapp-me' ) . '</h2>';
193
 
194
- } elseif ( 'whatsappme_tab_woocommerce__chat' == $section_id ) {
195
 
196
  $output = '<h2 class="title">' . __( 'Product Chat Window', 'creame-whatsapp-me' ) . '</h2>' .
197
  '<p>' .
@@ -209,7 +209,7 @@ class WhatsAppMe_WooAdmin {
209
  * @since 3.0.0
210
  * @param string $output current field output.
211
  * @param string $field_id current field id.
212
- * @param array $settings current whatsappme settings.
213
  * @return string
214
  */
215
  public function field_ouput( $output, $field_id, $settings ) {
@@ -218,21 +218,21 @@ class WhatsAppMe_WooAdmin {
218
 
219
  switch ( $field_id ) {
220
  case 'message_text_product':
221
- $output = '<textarea id="whatsappme_message_text_product" name="whatsappme[message_text_product]" rows="4" class="regular-text" ' .
222
  'placeholder="' . esc_attr__( "This *{PRODUCT}* can be yours for only *{PRICE}*!\nIf you have any questions, ask us.", 'creame-whatsapp-me' ) . '">' .
223
  $value . '</textarea>' .
224
  '<p class="description">' . __( 'Define a text for your products to encourage customers to contact', 'creame-whatsapp-me' ) . '</p>';
225
  break;
226
 
227
  case 'message_text_on_sale':
228
- $output = '<textarea id="whatsappme_message_text_on_sale" name="whatsappme[message_text_on_sale]" rows="4" class="regular-text" ' .
229
  'placeholder="' . esc_attr__( "Save {DISCOUNT}! This *{PRODUCT}* can be yours for only ~{REGULAR}~ *{PRICE}*.\nIf you have any questions, ask us.", 'creame-whatsapp-me' ) . '">' .
230
  $value . '</textarea>' .
231
  '<p class="description">' . __( 'Define a text for your products on sale to encourage customers to contact', 'creame-whatsapp-me' ) . '</p>';
232
  break;
233
 
234
  case 'message_send_product':
235
- $output = '<textarea id="whatsappme_message_send_product" name="whatsappme[message_send_product]" rows="3" class="regular-text" ' .
236
  'placeholder="' . esc_attr__( "*Hi {SITE}!*\nI have a question about *{PRODUCT} ({SKU})*", 'creame-whatsapp-me' ) . '">' . $value . '</textarea>' .
237
  '<p class="description">' . __( 'Predefined text for the first message the client will send you', 'creame-whatsapp-me' ) . '</p>';
238
  break;
@@ -243,13 +243,13 @@ class WhatsAppMe_WooAdmin {
243
 
244
  /**
245
  * Modify $inheritance array to properly inherit
246
- * WooCommerce fields on advanced visibily admin tab.
247
  *
248
  * @since 3.0.0
249
  * @param array $inheritance current section output.
250
  * @return array
251
  */
252
- public function advanced_inheritance( $inheritance ) {
253
 
254
  // 'woocommerce' inherit from 'all' (Global)
255
  $inheritance['all'][] = 'woocommerce';
4
  * The admin-specific functionality of the WooCommerce integration.
5
  *
6
  * @since 3.0.0
7
+ * @package JoinChat
8
+ * @subpackage JoinChat/admin
9
  * @author Creame <hola@crea.me>
10
  */
11
+ class JoinChatWooAdmin {
12
 
13
  /**
14
  * Initialize all hooks
15
  *
16
  * @since 3.0.0
17
+ * @param array $joinchat JoinChat object.
18
  * @return void
19
  */
20
+ public function init( $joinchat ) {
21
+
22
+ $loader = $joinchat->get_loader();
23
+
24
+ $loader->add_filter( 'joinchat_extra_settings', $this, 'extra_settings' );
25
+ $loader->add_filter( 'joinchat_settings_validate', $this, 'settings_validate' );
26
+ $loader->add_filter( 'joinchat_settings_i18n', $this, 'settings_i18n' );
27
+ $loader->add_filter( 'joinchat_admin_tabs', $this, 'admin_tab' );
28
+ $loader->add_filter( 'joinchat_custom_post_types', $this, 'custom_post_types' );
29
+ $loader->add_filter( 'joinchat_tab_visibility_sections', $this, 'visibility_tab_section' );
30
+ $loader->add_filter( 'joinchat_tab_woocommerce_sections', $this, 'woo_tab_sections' );
31
+ $loader->add_filter( 'joinchat_vars_help', $this, 'vars_help', 10, 2 );
32
+ $loader->add_filter( 'joinchat_section_output', $this, 'section_ouput', 10, 2 );
33
+ $loader->add_filter( 'joinchat_field_output', $this, 'field_ouput', 10, 3 );
34
+ $loader->add_filter( 'joinchat_visibility_inheritance', $this, 'visibility_inheritance' );
35
+ $loader->add_filter( 'joinchat_help_tab_styles_and_vars', $this, 'help_vars' );
36
+ $loader->add_filter( 'joinchat_metabox_vars', $this, 'metabox_vars', 10, 2 );
37
+ $loader->add_filter( 'joinchat_metabox_placeholders', $this, 'metabox_placeholders', 10, 3 );
38
  }
39
 
40
  /**
64
  */
65
  public function settings_validate( $input ) {
66
 
67
+ $input['message_text_product'] = JoinChatUtil::clean_input( $input['message_text_product'] );
68
+ $input['message_text_on_sale'] = JoinChatUtil::clean_input( $input['message_text_on_sale'] );
69
+ $input['message_send_product'] = JoinChatUtil::clean_input( $input['message_send_product'] );
70
 
71
  return $input;
72
  }
116
  }
117
 
118
  /**
119
+ * Woocommerce sections and fields for 'joinchat_tab_visibility'
120
  *
121
  * @since 3.0.0
122
  * @param array $sections current tab sections and fields.
123
  * @return array
124
  */
125
+ public function visibility_tab_section( $sections ) {
126
 
127
  $sections['woo'] = array(
128
  'view__woocommerce' => __( 'Shop', 'creame-whatsapp-me' ),
136
  }
137
 
138
  /**
139
+ * Woocommerce sections and fields for 'joinchat_tab_woocommerce'
140
  *
141
  * @since 3.0.0
142
  * @param array $sections current tab sections and fields.
151
  );
152
 
153
  foreach ( $woo_sections as $key => $label ) {
154
+ $woo_sections[ $key ] = "<label for=\"joinchat_$key\">$label</label>" . JoinChatAdmin::vars_help( $key );
155
  }
156
 
157
  $sections['chat'] = $woo_sections;
160
  }
161
 
162
  /**
163
+ * Woocommerce sections and fields for 'joinchat_tab_woocommerce'
164
  *
165
  * @since 3.0.0
166
  * @param array $sections current tab sections and fields.
187
  */
188
  public function section_ouput( $output, $section_id ) {
189
 
190
+ if ( 'joinchat_tab_visibility__woo' == $section_id ) {
191
 
192
  $output = '<h2 class="title">' . __( 'WooCommerce', 'creame-whatsapp-me' ) . '</h2>';
193
 
194
+ } elseif ( 'joinchat_tab_woocommerce__chat' == $section_id ) {
195
 
196
  $output = '<h2 class="title">' . __( 'Product Chat Window', 'creame-whatsapp-me' ) . '</h2>' .
197
  '<p>' .
209
  * @since 3.0.0
210
  * @param string $output current field output.
211
  * @param string $field_id current field id.
212
+ * @param array $settings current joinchat settings.
213
  * @return string
214
  */
215
  public function field_ouput( $output, $field_id, $settings ) {
218
 
219
  switch ( $field_id ) {
220
  case 'message_text_product':
221
+ $output = '<textarea id="joinchat_message_text_product" name="joinchat[message_text_product]" rows="4" class="regular-text" ' .
222
  'placeholder="' . esc_attr__( "This *{PRODUCT}* can be yours for only *{PRICE}*!\nIf you have any questions, ask us.", 'creame-whatsapp-me' ) . '">' .
223
  $value . '</textarea>' .
224
  '<p class="description">' . __( 'Define a text for your products to encourage customers to contact', 'creame-whatsapp-me' ) . '</p>';
225
  break;
226
 
227
  case 'message_text_on_sale':
228
+ $output = '<textarea id="joinchat_message_text_on_sale" name="joinchat[message_text_on_sale]" rows="4" class="regular-text" ' .
229
  'placeholder="' . esc_attr__( "Save {DISCOUNT}! This *{PRODUCT}* can be yours for only ~{REGULAR}~ *{PRICE}*.\nIf you have any questions, ask us.", 'creame-whatsapp-me' ) . '">' .
230
  $value . '</textarea>' .
231
  '<p class="description">' . __( 'Define a text for your products on sale to encourage customers to contact', 'creame-whatsapp-me' ) . '</p>';
232
  break;
233
 
234
  case 'message_send_product':
235
+ $output = '<textarea id="joinchat_message_send_product" name="joinchat[message_send_product]" rows="3" class="regular-text" ' .
236
  'placeholder="' . esc_attr__( "*Hi {SITE}!*\nI have a question about *{PRODUCT} ({SKU})*", 'creame-whatsapp-me' ) . '">' . $value . '</textarea>' .
237
  '<p class="description">' . __( 'Predefined text for the first message the client will send you', 'creame-whatsapp-me' ) . '</p>';
238
  break;
243
 
244
  /**
245
  * Modify $inheritance array to properly inherit
246
+ * WooCommerce fields on visibility visibily admin tab.
247
  *
248
  * @since 3.0.0
249
  * @param array $inheritance current section output.
250
  * @return array
251
  */
252
+ public function visibility_inheritance( $inheritance ) {
253
 
254
  // 'woocommerce' inherit from 'all' (Global)
255
  $inheritance['all'][] = 'woocommerce';
admin/css/{whatsappme.css → joinchat.css} RENAMED
@@ -1,53 +1,53 @@
1
- /* WAme chat settings page */
2
 
3
- .wame-hidden {
4
  display: none !important;
5
  }
6
 
7
- .js #whatsappme_form textarea {
8
  overflow: hidden;
9
  min-height: 100px;
10
  }
11
 
12
- .wametab {
13
  display: none;
14
  }
15
 
16
- .wametab-active {
17
  display: block !important;
18
  }
19
 
20
- #whatsappme_tab_advanced tr:hover {
21
  background: rgba(0, 0, 0, .05);
22
  }
23
 
24
- #whatsappme_tab_advanced th,
25
- #whatsappme_tab_advanced td {
26
  padding: 7px 15px;
27
  }
28
 
29
- #whatsappme_tab_advanced label {
30
  margin-right: 15px;
31
  }
32
 
33
- #whatsappme_tab_advanced .dashicons {
34
  opacity: .5;
35
  }
36
 
37
- #whatsappme_tab_advanced input[type=radio]+span {
38
  transition: all 200ms;
39
  }
40
 
41
- #whatsappme_tab_advanced input[type=radio]:checked+span {
42
  color: #79ba49;
43
  opacity: 1;
44
  }
45
 
46
- #whatsappme_tab_advanced input[type=radio]:checked+.dashicons-hidden {
47
  color: #ca4a1f;
48
  }
49
 
50
- .whatsappme-show-help {
51
  display: inline-block;
52
  width: 1.1em;
53
  height: 1.1em;
@@ -60,9 +60,9 @@
60
  text-align: center;
61
  }
62
 
63
- .whatsappme-show-help:hover,
64
- .whatsappme-show-help:active,
65
- .whatsappme-show-help:focus {
66
  background: #444;
67
  color: #fff;
68
  }
@@ -71,14 +71,7 @@
71
  white-space: nowrap;
72
  }
73
 
74
- #tab-panel-styles-and-vars code {
75
- -webkit-user-select: all;
76
- -moz-user-select: all;
77
- -ms-user-select: all;
78
- user-select: all;
79
- }
80
-
81
- .form-table td p.whatsappme-addon {
82
  display: inline-block;
83
  padding: 0 6px;
84
  border-radius: 3px;
@@ -90,12 +83,12 @@
90
  padding-left: 52px !important;
91
  }
92
 
93
- #whatsappme_button_image_wrapper {
94
  position: relative;
95
  padding: 8px 0 0 80px;
96
  }
97
 
98
- #whatsappme_button_image_holder {
99
  position: absolute;
100
  top: 0;
101
  left: 0;
@@ -109,16 +102,16 @@
109
  overflow: hidden;
110
  }
111
 
112
- [dir=rtl] #whatsappme_button_image_wrapper {
113
  padding: 8px 80px 0 0;
114
  }
115
 
116
- [dir=rtl] #whatsappme_button_image_holder {
117
  right: 0;
118
  left: auto;
119
  }
120
 
121
- .whatsappme_vars_help {
122
  margin-top: 5px;
123
  font-size: 11px;
124
  font-weight: normal;
@@ -127,13 +120,13 @@
127
  transition: opacity 0.2s ease-out 0.2s;
128
  }
129
 
130
- tr:hover .whatsappme_vars_help,
131
- tr.whatsappme--focus .whatsappme_vars_help {
132
  opacity: 1;
133
  transition-delay: 0.5s;
134
  }
135
 
136
- .whatsappme_vars_help code {
137
  -webkit-user-select: all;
138
  -moz-user-select: all;
139
  -ms-user-select: all;
@@ -143,24 +136,45 @@ tr.whatsappme--focus .whatsappme_vars_help {
143
  vertical-align: bottom;
144
  }
145
 
146
- .whatsappme_vars_help code:hover {
147
  background: rgba(0, 0, 0, 0.2);
148
  }
149
 
150
  @media screen and (max-width: 782px) {
151
- .whatsappme_vars_help {
152
  margin-top: 2px;
153
  opacity: 1;
154
  }
155
 
156
- .whatsappme_vars_help br {
157
  display: none;
158
  }
159
  }
160
 
161
- /* WAme chat metabox */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
 
163
- .whatsappme-metabox code {
164
  -webkit-user-select: all;
165
  -moz-user-select: all;
166
  -ms-user-select: all;
@@ -170,37 +184,37 @@ tr.whatsappme--focus .whatsappme_vars_help {
170
  vertical-align: text-bottom;
171
  }
172
 
173
- .whatsappme-metabox .dashicons {
174
  opacity: .5;
175
  }
176
 
177
- .whatsappme-metabox input::placeholder {
178
  color: #dedfe0;
179
  }
180
 
181
- .whatsappme-metabox input::-ms-input-placeholder {
182
  color: #dedfe0;
183
  }
184
 
185
- .whatsappme-metabox input[type=radio] {
186
  margin-right: 1px;
187
  }
188
 
189
- .whatsappme-metabox input[type=radio]+span {
190
  margin-right: 5px;
191
  transition: all 200ms;
192
  }
193
 
194
- .whatsappme-metabox input[type=radio]:checked+span {
195
  color: #79ba49;
196
  opacity: 1;
197
  }
198
 
199
- .whatsappme-metabox input[type=radio]:checked+.dashicons-hidden {
200
  color: #ca4a1f;
201
  }
202
 
203
- .js .whatsappme-metabox textarea {
204
  overflow: hidden;
205
  min-height: 3em;
206
  }
1
+ /* Join.chat settings page */
2
 
3
+ .joinchat-hidden {
4
  display: none !important;
5
  }
6
 
7
+ .js #joinchat_form textarea {
8
  overflow: hidden;
9
  min-height: 100px;
10
  }
11
 
12
+ .joinchat-tab {
13
  display: none;
14
  }
15
 
16
+ .joinchat-tab-active {
17
  display: block !important;
18
  }
19
 
20
+ #joinchat_tab_visibility tr:hover {
21
  background: rgba(0, 0, 0, .05);
22
  }
23
 
24
+ #joinchat_tab_visibility th,
25
+ #joinchat_tab_visibility td {
26
  padding: 7px 15px;
27
  }
28
 
29
+ #joinchat_tab_visibility label {
30
  margin-right: 15px;
31
  }
32
 
33
+ #joinchat_tab_visibility .dashicons {
34
  opacity: .5;
35
  }
36
 
37
+ #joinchat_tab_visibility input[type=radio]+span {
38
  transition: all 200ms;
39
  }
40
 
41
+ #joinchat_tab_visibility input[type=radio]:checked+span {
42
  color: #79ba49;
43
  opacity: 1;
44
  }
45
 
46
+ #joinchat_tab_visibility input[type=radio]:checked+.dashicons-hidden {
47
  color: #ca4a1f;
48
  }
49
 
50
+ .joinchat-show-help {
51
  display: inline-block;
52
  width: 1.1em;
53
  height: 1.1em;
60
  text-align: center;
61
  }
62
 
63
+ .joinchat-show-help:hover,
64
+ .joinchat-show-help:active,
65
+ .joinchat-show-help:focus {
66
  background: #444;
67
  color: #fff;
68
  }
71
  white-space: nowrap;
72
  }
73
 
74
+ .form-table td p.joinchat-addon {
 
 
 
 
 
 
 
75
  display: inline-block;
76
  padding: 0 6px;
77
  border-radius: 3px;
83
  padding-left: 52px !important;
84
  }
85
 
86
+ #joinchat_button_image_wrapper {
87
  position: relative;
88
  padding: 8px 0 0 80px;
89
  }
90
 
91
+ #joinchat_button_image_holder {
92
  position: absolute;
93
  top: 0;
94
  left: 0;
102
  overflow: hidden;
103
  }
104
 
105
+ [dir=rtl] #joinchat_button_image_wrapper {
106
  padding: 8px 80px 0 0;
107
  }
108
 
109
+ [dir=rtl] #joinchat_button_image_holder {
110
  right: 0;
111
  left: auto;
112
  }
113
 
114
+ .joinchat_vars_help {
115
  margin-top: 5px;
116
  font-size: 11px;
117
  font-weight: normal;
120
  transition: opacity 0.2s ease-out 0.2s;
121
  }
122
 
123
+ tr:hover .joinchat_vars_help,
124
+ tr.joinchat--focus .joinchat_vars_help {
125
  opacity: 1;
126
  transition-delay: 0.5s;
127
  }
128
 
129
+ .joinchat_vars_help code {
130
  -webkit-user-select: all;
131
  -moz-user-select: all;
132
  -ms-user-select: all;
136
  vertical-align: bottom;
137
  }
138
 
139
+ .joinchat_vars_help code:hover {
140
  background: rgba(0, 0, 0, 0.2);
141
  }
142
 
143
  @media screen and (max-width: 782px) {
144
+ .joinchat_vars_help {
145
  margin-top: 2px;
146
  opacity: 1;
147
  }
148
 
149
+ .joinchat_vars_help br {
150
  display: none;
151
  }
152
  }
153
 
154
+ #joinchat_form .iris-picker {
155
+ visibility: visible;
156
+ }
157
+
158
+ /* Help */
159
+
160
+ .settings_page_joinchat .help-tab-content li ul {
161
+ margin-top: 6px;
162
+ }
163
+
164
+ .settings_page_joinchat .help-tab-content li li {
165
+ list-style-type: circle;
166
+ }
167
+
168
+ .settings_page_joinchat .help-tab-content code {
169
+ -webkit-user-select: all;
170
+ -moz-user-select: all;
171
+ -ms-user-select: all;
172
+ user-select: all;
173
+ }
174
+
175
+ /* Join.chat metabox */
176
 
177
+ .joinchat-metabox code {
178
  -webkit-user-select: all;
179
  -moz-user-select: all;
180
  -ms-user-select: all;
184
  vertical-align: text-bottom;
185
  }
186
 
187
+ .joinchat-metabox .dashicons {
188
  opacity: .5;
189
  }
190
 
191
+ .joinchat-metabox input::placeholder {
192
  color: #dedfe0;
193
  }
194
 
195
+ .joinchat-metabox input::-ms-input-placeholder {
196
  color: #dedfe0;
197
  }
198
 
199
+ .joinchat-metabox input[type=radio] {
200
  margin-right: 1px;
201
  }
202
 
203
+ .joinchat-metabox input[type=radio]+span {
204
  margin-right: 5px;
205
  transition: all 200ms;
206
  }
207
 
208
+ .joinchat-metabox input[type=radio]:checked+span {
209
  color: #79ba49;
210
  opacity: 1;
211
  }
212
 
213
+ .joinchat-metabox input[type=radio]:checked+.dashicons-hidden {
214
  color: #ca4a1f;
215
  }
216
 
217
+ .js .joinchat-metabox textarea {
218
  overflow: hidden;
219
  min-height: 3em;
220
  }
admin/css/joinchat.min.css ADDED
@@ -0,0 +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 td,#joinchat_tab_visibility th{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 .2s}#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:700;text-decoration:none;text-align:center}.joinchat-show-help:active,.joinchat-show-help:focus,.joinchat-show-help:hover{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:400;line-height:1.9;opacity:0;transition:opacity .2s ease-out .2s}tr.joinchat--focus .joinchat_vars_help,tr:hover .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,.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 .2s}.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/css/whatsappme.min.css DELETED
@@ -1 +0,0 @@
1
- .wame-hidden{display:none!important}.js #whatsappme_form textarea{overflow:hidden;min-height:100px}.wametab{display:none}.wametab-active{display:block!important}#whatsappme_tab_advanced tr:hover{background:rgba(0,0,0,.05)}#whatsappme_tab_advanced td,#whatsappme_tab_advanced th{padding:7px 15px}#whatsappme_tab_advanced label{margin-right:15px}#whatsappme_tab_advanced .dashicons{opacity:.5}#whatsappme_tab_advanced input[type=radio]+span{transition:all .2s}#whatsappme_tab_advanced input[type=radio]:checked+span{color:#79ba49;opacity:1}#whatsappme_tab_advanced input[type=radio]:checked+.dashicons-hidden{color:#ca4a1f}.whatsappme-show-help{display:inline-block;width:1.1em;height:1.1em;line-height:1.1em;border-radius:50%;background:#999;color:#fff;font-weight:700;text-decoration:none;text-align:center}.whatsappme-show-help:active,.whatsappme-show-help:focus,.whatsappme-show-help:hover{background:#444;color:#fff}#tab-panel-styles-and-vars span{white-space:nowrap}#tab-panel-styles-and-vars code{-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all}.form-table td p.whatsappme-addon{display:inline-block;padding:0 6px;border-radius:3px;background:#fffbe5;font-size:13px}.iti--allow-dropdown input{padding-left:52px!important}#whatsappme_button_image_wrapper{position:relative;padding:8px 0 0 80px}#whatsappme_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] #whatsappme_button_image_wrapper{padding:8px 80px 0 0}[dir=rtl] #whatsappme_button_image_holder{right:0;left:auto}.whatsappme_vars_help{margin-top:5px;font-size:11px;font-weight:400;line-height:1.9;opacity:0;transition:opacity .2s ease-out .2s}tr.whatsappme--focus .whatsappme_vars_help,tr:hover .whatsappme_vars_help{opacity:1;transition-delay:.5s}.whatsappme_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}.whatsappme_vars_help code:hover{background:rgba(0,0,0,.2)}@media screen and (max-width:782px){.whatsappme_vars_help{margin-top:2px;opacity:1}.whatsappme_vars_help br{display:none}}.whatsappme-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}.whatsappme-metabox .dashicons{opacity:.5}.whatsappme-metabox input::placeholder{color:#dedfe0}.whatsappme-metabox input::-ms-input-placeholder{color:#dedfe0}.whatsappme-metabox input[type=radio]{margin-right:1px}.whatsappme-metabox input[type=radio]+span{margin-right:5px;transition:all .2s}.whatsappme-metabox input[type=radio]:checked+span{color:#79ba49;opacity:1}.whatsappme-metabox input[type=radio]:checked+.dashicons-hidden{color:#ca4a1f}.js .whatsappme-metabox textarea{overflow:hidden;min-height:3em}
 
admin/js/{whatsappme.js → joinchat.js} RENAMED
@@ -8,17 +8,17 @@
8
  $(function () {
9
  var media_frame;
10
 
11
- if (typeof (intlTelInput) === 'function' && $('#whatsappme_phone').length) {
12
- var country_request = JSON.parse(localStorage.whatsappme_country_code || '{}');
13
  var country_code = (country_request.code && country_request.date == new Date().toDateString()) ? country_request.code : false;
14
- var $phone = $('#whatsappme_phone');
15
 
16
  // If empty value capture placeholdre and remove
17
  var placeholder = $phone.val() === '' ? $phone.attr('placeholder') : null;
18
  $phone.removeAttr('placeholder');
19
 
20
  var iti = intlTelInput($phone.get(0), {
21
- hiddenInput: $phone.data('name') || 'whatsappme[telephone]',
22
  initialCountry: 'auto',
23
  preferredCountries: [country_code || ''],
24
  geoIpLookup: function (callback) {
@@ -27,7 +27,7 @@
27
  } else {
28
  $.getJSON('https://ipinfo.io').always(function (resp) {
29
  var countryCode = (resp && resp.country) ? resp.country : '';
30
- localStorage.whatsappme_country_code = JSON.stringify({ code: countryCode, date: new Date().toDateString() });
31
  callback(countryCode);
32
  });
33
  }
@@ -39,7 +39,7 @@
39
 
40
  // Post metabox if empty value set placeholder from general settings
41
  if (typeof placeholder == 'string' && placeholder != '') {
42
- iti.promise.then(function() {
43
  iti.setNumber(placeholder);
44
  $phone.attr('placeholder', iti.getNumber(intlTelInputUtils.numberFormat.NATIONAL)).val('');
45
  });
@@ -58,30 +58,36 @@
58
  });
59
  }
60
 
61
- if ($('#whatsappme_form').length === 1) {
62
  // Tabs
63
  $('.nav-tab').click(function (e) {
64
  e.preventDefault();
65
  var $navtab = $(this);
 
 
 
 
 
 
66
 
67
  $('.nav-tab').removeClass('nav-tab-active').attr('aria-selected', 'false');
68
  $navtab.addClass('nav-tab-active').attr('aria-selected', 'true').get(0).blur();
69
- $('.wametab').removeClass('wametab-active');
70
- $($navtab.attr('href')).addClass('wametab-active').find('textarea').each(textarea_autoheight);
71
  });
72
 
73
  // Toggle WhatsApp web option
74
- $('#whatsappme_mobile_only').change(function () {
75
- $('#whatsappme_whatsapp_web').closest('tr').toggleClass('wame-hidden', this.checked);
76
  }).change();
77
 
78
- // Toggle WhatsApp badge option
79
- $('#whatsappme_message_delay').on('change input', function () {
80
- $('#whatsappme_message_badge').closest('tr').toggleClass('wame-hidden', this.value == '0');
81
  }).change();
82
 
83
  // Show help
84
- $('.whatsappme-show-help').click(function (e) {
85
  e.preventDefault();
86
  var help_tab = $(this).attr('href');
87
  if ($('#contextual-help-wrap').is(':visible')) {
@@ -89,20 +95,20 @@
89
  } else {
90
  $('#contextual-help-link').click();
91
  }
92
- $( help_tab != '#' ? help_tab : '#tab-link-styles-and-vars').find('a').click();
93
  });
94
 
95
  // Texarea focus and auto height
96
- $('textarea', '#whatsappme_form')
97
- .on('focus', function () { $(this).closest('tr').addClass('whatsappme--focus'); })
98
- .on('blur', function () { $(this).closest('tr').removeClass('whatsappme--focus'); })
99
  .on('input', textarea_autoheight)
100
  .each(textarea_autoheight);
101
 
102
 
103
- // Advanced view inheritance
104
- var $tab_advanced = $('#whatsappme_tab_advanced');
105
- var inheritance = $('.whatsappme_view_all').data('inheritance') || {
106
  'all': ['front_page', 'blog_page', '404_page', 'search', 'archive', 'singular', 'cpts'],
107
  'archive': ['date', 'author'],
108
  'singular': ['page', 'post'],
@@ -110,7 +116,7 @@
110
 
111
  function propagate_inheritance(field, show) {
112
  field = field || 'all';
113
- show = show || $('input[name="whatsappme[view][' + field + ']"]:checked').val();
114
 
115
  $('.view_inheritance_' + field)
116
  .toggleClass('dashicons-visibility', show == 'yes')
@@ -121,27 +127,27 @@
121
  .toggleClass('dashicons-visibility', show == 'yes')
122
  .toggleClass('dashicons-hidden', show == 'no');
123
  } else if (field in inheritance) {
124
- var value = $('input[name="whatsappme[view][' + field + ']"]:checked').val();
125
  value = value === '' ? show : value;
126
 
127
  $.each(inheritance[field], function () { propagate_inheritance(this, value); });
128
  }
129
  }
130
 
131
- $('input', $tab_advanced).change(function () {
132
  propagate_inheritance();
133
  });
134
 
135
- $('.whatsappme_view_reset').click(function (e) {
136
  e.preventDefault();
137
- $('input[value=""]', $tab_advanced).prop('checked', true);
138
- $('.whatsappme_view_all input', $tab_advanced).first().prop('checked', true);
139
  propagate_inheritance();
140
  });
141
 
142
  propagate_inheritance();
143
 
144
- $('#whatsappme_button_image_add').click(function (e) {
145
  e.preventDefault();
146
 
147
  if (!media_frame) {
@@ -159,14 +165,14 @@
159
  var attachment = media_frame.state().get('selection').first().toJSON();
160
  var url = attachment.sizes && attachment.sizes.thumbnail && attachment.sizes.thumbnail.url || attachment.url;
161
 
162
- $('#whatsappme_button_image_holder').css({ 'background-size': 'cover', 'background-image': 'url(' + url + ')' });
163
- $('#whatsappme_button_image').val(attachment.id);
164
- $('#whatsappme_button_image_remove').removeClass('wame-hidden');
165
  });
166
 
167
  media_frame.on('open', function () {
168
  // Pre-selected attachment
169
- var attachment = wp.media.attachment($('#whatsappme_button_image').val());
170
  media_frame.state().get('selection').add(attachment ? [attachment] : []);
171
  });
172
  }
@@ -174,18 +180,20 @@
174
  media_frame.open();
175
  });
176
 
177
- $('#whatsappme_button_image_remove').click(function (e) {
178
  e.preventDefault();
179
 
180
- $('#whatsappme_button_image_holder').removeAttr('style');
181
- $('#whatsappme_button_image').val('');
182
- $(this).addClass('wame-hidden');
183
  });
 
 
184
  }
185
 
186
- if ($('.whatsappme-metabox').length === 1) {
187
  // Texarea auto height
188
- $('textarea', '.whatsappme-metabox').on('focus input', textarea_autoheight).each(textarea_autoheight);
189
  }
190
  });
191
  })(jQuery);
8
  $(function () {
9
  var media_frame;
10
 
11
+ if (typeof (intlTelInput) === 'function' && $('#joinchat_phone').length) {
12
+ var country_request = JSON.parse(localStorage.joinchat_country_code || '{}');
13
  var country_code = (country_request.code && country_request.date == new Date().toDateString()) ? country_request.code : false;
14
+ var $phone = $('#joinchat_phone');
15
 
16
  // If empty value capture placeholdre and remove
17
  var placeholder = $phone.val() === '' ? $phone.attr('placeholder') : null;
18
  $phone.removeAttr('placeholder');
19
 
20
  var iti = intlTelInput($phone.get(0), {
21
+ hiddenInput: $phone.data('name') || 'joinchat[telephone]',
22
  initialCountry: 'auto',
23
  preferredCountries: [country_code || ''],
24
  geoIpLookup: function (callback) {
27
  } else {
28
  $.getJSON('https://ipinfo.io').always(function (resp) {
29
  var countryCode = (resp && resp.country) ? resp.country : '';
30
+ localStorage.joinchat_country_code = JSON.stringify({ code: countryCode, date: new Date().toDateString() });
31
  callback(countryCode);
32
  });
33
  }
39
 
40
  // Post metabox if empty value set placeholder from general settings
41
  if (typeof placeholder == 'string' && placeholder != '') {
42
+ iti.promise.then(function () {
43
  iti.setNumber(placeholder);
44
  $phone.attr('placeholder', iti.getNumber(intlTelInputUtils.numberFormat.NATIONAL)).val('');
45
  });
58
  });
59
  }
60
 
61
+ if ($('#joinchat_form').length === 1) {
62
  // Tabs
63
  $('.nav-tab').click(function (e) {
64
  e.preventDefault();
65
  var $navtab = $(this);
66
+ var href = $navtab.attr('href');
67
+ var $referer = $('input[name=_wp_http_referer]');
68
+ var ref_val = $referer.val();
69
+
70
+ // Update form referer to open same tab on submit
71
+ $referer.val(ref_val.substr(0, ref_val.indexOf('page=joinchat')) + 'page=joinchat&tab=' + href.substr(14));
72
 
73
  $('.nav-tab').removeClass('nav-tab-active').attr('aria-selected', 'false');
74
  $navtab.addClass('nav-tab-active').attr('aria-selected', 'true').get(0).blur();
75
+ $('.joinchat-tab').removeClass('joinchat-tab-active');
76
+ $(href).addClass('joinchat-tab-active').find('textarea').each(textarea_autoheight);
77
  });
78
 
79
  // Toggle WhatsApp web option
80
+ $('#joinchat_mobile_only').change(function () {
81
+ $('#joinchat_whatsapp_web').closest('tr').toggleClass('joinchat-hidden', this.checked);
82
  }).change();
83
 
84
+ // Toggle badge option
85
+ $('#joinchat_message_delay').on('change input', function () {
86
+ $('#joinchat_message_badge, #joinchat_message_views').closest('tr').toggleClass('joinchat-hidden', this.value == '0');
87
  }).change();
88
 
89
  // Show help
90
+ $('.joinchat-show-help').click(function (e) {
91
  e.preventDefault();
92
  var help_tab = $(this).attr('href');
93
  if ($('#contextual-help-wrap').is(':visible')) {
95
  } else {
96
  $('#contextual-help-link').click();
97
  }
98
+ $(help_tab != '#' ? help_tab : '#tab-link-styles-and-vars').find('a').click();
99
  });
100
 
101
  // Texarea focus and auto height
102
+ $('textarea', '#joinchat_form')
103
+ .on('focus', function () { $(this).closest('tr').addClass('joinchat--focus'); })
104
+ .on('blur', function () { $(this).closest('tr').removeClass('joinchat--focus'); })
105
  .on('input', textarea_autoheight)
106
  .each(textarea_autoheight);
107
 
108
 
109
+ // Visibility view inheritance
110
+ var $tab_visibility = $('#joinchat_tab_visibility');
111
+ var inheritance = $('.joinchat_view_all').data('inheritance') || {
112
  'all': ['front_page', 'blog_page', '404_page', 'search', 'archive', 'singular', 'cpts'],
113
  'archive': ['date', 'author'],
114
  'singular': ['page', 'post'],
116
 
117
  function propagate_inheritance(field, show) {
118
  field = field || 'all';
119
+ show = show || $('input[name="joinchat[view][' + field + ']"]:checked').val();
120
 
121
  $('.view_inheritance_' + field)
122
  .toggleClass('dashicons-visibility', show == 'yes')
127
  .toggleClass('dashicons-visibility', show == 'yes')
128
  .toggleClass('dashicons-hidden', show == 'no');
129
  } else if (field in inheritance) {
130
+ var value = $('input[name="joinchat[view][' + field + ']"]:checked').val();
131
  value = value === '' ? show : value;
132
 
133
  $.each(inheritance[field], function () { propagate_inheritance(this, value); });
134
  }
135
  }
136
 
137
+ $('input', $tab_visibility).change(function () {
138
  propagate_inheritance();
139
  });
140
 
141
+ $('.joinchat_view_reset').click(function (e) {
142
  e.preventDefault();
143
+ $('input[value=""]', $tab_visibility).prop('checked', true);
144
+ $('.joinchat_view_all input', $tab_visibility).first().prop('checked', true);
145
  propagate_inheritance();
146
  });
147
 
148
  propagate_inheritance();
149
 
150
+ $('#joinchat_button_image_add').click(function (e) {
151
  e.preventDefault();
152
 
153
  if (!media_frame) {
165
  var attachment = media_frame.state().get('selection').first().toJSON();
166
  var url = attachment.sizes && attachment.sizes.thumbnail && attachment.sizes.thumbnail.url || attachment.url;
167
 
168
+ $('#joinchat_button_image_holder').css({ 'background-size': 'cover', 'background-image': 'url(' + url + ')' });
169
+ $('#joinchat_button_image').val(attachment.id);
170
+ $('#joinchat_button_image_remove').removeClass('joinchat-hidden');
171
  });
172
 
173
  media_frame.on('open', function () {
174
  // Pre-selected attachment
175
+ var attachment = wp.media.attachment($('#joinchat_button_image').val());
176
  media_frame.state().get('selection').add(attachment ? [attachment] : []);
177
  });
178
  }
180
  media_frame.open();
181
  });
182
 
183
+ $('#joinchat_button_image_remove').click(function (e) {
184
  e.preventDefault();
185
 
186
+ $('#joinchat_button_image_holder').removeAttr('style');
187
+ $('#joinchat_button_image').val('');
188
+ $(this).addClass('joinchat-hidden');
189
  });
190
+
191
+ $('#joinchat_color').wpColorPicker();
192
  }
193
 
194
+ if ($('.joinchat-metabox').length === 1) {
195
  // Texarea auto height
196
+ $('textarea', '.joinchat-metabox').on('focus input', textarea_autoheight).each(textarea_autoheight);
197
  }
198
  });
199
  })(jQuery);
admin/js/joinchat.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t){"use strict";function e(){t(this).height(0).height(this.scrollHeight)}t(function(){var a;if("function"==typeof intlTelInput&&t("#joinchat_phone").length){var n=JSON.parse(localStorage.joinchat_country_code||"{}"),i=!(!n.code||n.date!=(new Date).toDateString())&&n.code,o=t("#joinchat_phone"),c=""===o.val()?o.attr("placeholder"):null;o.removeAttr("placeholder");var l=intlTelInput(o.get(0),{hiddenInput:o.data("name")||"joinchat[telephone]",initialCountry:"auto",preferredCountries:[i||""],geoIpLookup:function(e){i?e(i):t.getJSON("https://ipinfo.io").always(function(t){var a=t&&t.country?t.country:"";localStorage.joinchat_country_code=JSON.stringify({code:a,date:(new Date).toDateString()}),e(a)})},utilsScript:"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/"+intl_tel_input_version+"/js/utils.js"});l.hiddenInput.value=o.val(),"string"==typeof c&&""!=c&&l.promise.then(function(){l.setNumber(c),o.attr("placeholder",l.getNumber(intlTelInputUtils.numberFormat.NATIONAL)).val("")}),o.on("input",function(){var e=t(this),a=intlTelInputGlobals.getInstance(this);e.css("color",e.val().trim()&&!a.isValidNumber()?"#ca4a1f":""),a.hiddenInput.value=a.getNumber()}).on("blur",function(){var t=intlTelInputGlobals.getInstance(this);t.setNumber(t.getNumber())})}if(1===t("#joinchat_form").length){t(".nav-tab").click(function(a){a.preventDefault();var n=t(this),i=n.attr("href"),o=t("input[name=_wp_http_referer]"),c=o.val();o.val(c.substr(0,c.indexOf("page=joinchat"))+"page=joinchat&tab="+i.substr(14)),t(".nav-tab").removeClass("nav-tab-active").attr("aria-selected","false"),n.addClass("nav-tab-active").attr("aria-selected","true").get(0).blur(),t(".joinchat-tab").removeClass("joinchat-tab-active"),t(i).addClass("joinchat-tab-active").find("textarea").each(e)}),t("#joinchat_mobile_only").change(function(){t("#joinchat_whatsapp_web").closest("tr").toggleClass("joinchat-hidden",this.checked)}).change(),t("#joinchat_message_delay").on("change input",function(){t("#joinchat_message_badge, #joinchat_message_views").closest("tr").toggleClass("joinchat-hidden","0"==this.value)}).change(),t(".joinchat-show-help").click(function(e){e.preventDefault();var a=t(this).attr("href");t("#contextual-help-wrap").is(":visible")?t("html, body").animate({scrollTop:0}):t("#contextual-help-link").click(),t("#"!=a?a:"#tab-link-styles-and-vars").find("a").click()}),t("textarea","#joinchat_form").on("focus",function(){t(this).closest("tr").addClass("joinchat--focus")}).on("blur",function(){t(this).closest("tr").removeClass("joinchat--focus")}).on("input",e).each(e);var s=t("#joinchat_tab_visibility"),r=t(".joinchat_view_all").data("inheritance")||{all:["front_page","blog_page","404_page","search","archive","singular","cpts"],archive:["date","author"],singular:["page","post"]};function h(e,a){if(e=e||"all",a=a||t('input[name="joinchat[view]['+e+']"]:checked').val(),t(".view_inheritance_"+e).toggleClass("dashicons-visibility","yes"==a).toggleClass("dashicons-hidden","no"==a),"cpts"==e)t("[class*=view_inheritance_cpt_]").toggleClass("dashicons-visibility","yes"==a).toggleClass("dashicons-hidden","no"==a);else if(e in r){var n=t('input[name="joinchat[view]['+e+']"]:checked').val();n=""===n?a:n,t.each(r[e],function(){h(this,n)})}}t("input",s).change(function(){h()}),t(".joinchat_view_reset").click(function(e){e.preventDefault(),t('input[value=""]',s).prop("checked",!0),t(".joinchat_view_all input",s).first().prop("checked",!0),h()}),h(),t("#joinchat_button_image_add").click(function(e){e.preventDefault(),a||((a=wp.media({title:t(this).data("title")||"Select button image",button:{text:t(this).data("button")||"Use Image"},library:{type:"image"},multiple:!1})).on("select",function(){var e=a.state().get("selection").first().toJSON(),n=e.sizes&&e.sizes.thumbnail&&e.sizes.thumbnail.url||e.url;t("#joinchat_button_image_holder").css({"background-size":"cover","background-image":"url("+n+")"}),t("#joinchat_button_image").val(e.id),t("#joinchat_button_image_remove").removeClass("joinchat-hidden")}),a.on("open",function(){var e=wp.media.attachment(t("#joinchat_button_image").val());a.state().get("selection").add(e?[e]:[])})),a.open()}),t("#joinchat_button_image_remove").click(function(e){e.preventDefault(),t("#joinchat_button_image_holder").removeAttr("style"),t("#joinchat_button_image").val(""),t(this).addClass("joinchat-hidden")}),t("#joinchat_color").wpColorPicker()}1===t(".joinchat-metabox").length&&t("textarea",".joinchat-metabox").on("focus input",e).each(e)})}(jQuery);
admin/js/whatsappme.min.js DELETED
@@ -1 +0,0 @@
1
- !function(e){"use strict";function t(){e(this).height(0).height(this.scrollHeight)}e(function(){var a;if("function"==typeof intlTelInput&&e("#whatsappme_phone").length){var n=JSON.parse(localStorage.whatsappme_country_code||"{}"),i=!(!n.code||n.date!=(new Date).toDateString())&&n.code,s=e("#whatsappme_phone"),l=""===s.val()?s.attr("placeholder"):null;s.removeAttr("placeholder");var o=intlTelInput(s.get(0),{hiddenInput:s.data("name")||"whatsappme[telephone]",initialCountry:"auto",preferredCountries:[i||""],geoIpLookup:function(t){i?t(i):e.getJSON("https://ipinfo.io").always(function(e){var a=e&&e.country?e.country:"";localStorage.whatsappme_country_code=JSON.stringify({code:a,date:(new Date).toDateString()}),t(a)})},utilsScript:"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/"+intl_tel_input_version+"/js/utils.js"});o.hiddenInput.value=s.val(),"string"==typeof l&&""!=l&&o.promise.then(function(){o.setNumber(l),s.attr("placeholder",o.getNumber(intlTelInputUtils.numberFormat.NATIONAL)).val("")}),s.on("input",function(){var t=e(this),a=intlTelInputGlobals.getInstance(this);t.css("color",t.val().trim()&&!a.isValidNumber()?"#ca4a1f":""),a.hiddenInput.value=a.getNumber()}).on("blur",function(){var e=intlTelInputGlobals.getInstance(this);e.setNumber(e.getNumber())})}if(1===e("#whatsappme_form").length){e(".nav-tab").click(function(a){a.preventDefault();var n=e(this);e(".nav-tab").removeClass("nav-tab-active").attr("aria-selected","false"),n.addClass("nav-tab-active").attr("aria-selected","true").get(0).blur(),e(".wametab").removeClass("wametab-active"),e(n.attr("href")).addClass("wametab-active").find("textarea").each(t)}),e("#whatsappme_mobile_only").change(function(){e("#whatsappme_whatsapp_web").closest("tr").toggleClass("wame-hidden",this.checked)}).change(),e("#whatsappme_message_delay").on("change input",function(){e("#whatsappme_message_badge").closest("tr").toggleClass("wame-hidden","0"==this.value)}).change(),e(".whatsappme-show-help").click(function(t){t.preventDefault();var a=e(this).attr("href");e("#contextual-help-wrap").is(":visible")?e("html, body").animate({scrollTop:0}):e("#contextual-help-link").click(),e("#"!=a?a:"#tab-link-styles-and-vars").find("a").click()}),e("textarea","#whatsappme_form").on("focus",function(){e(this).closest("tr").addClass("whatsappme--focus")}).on("blur",function(){e(this).closest("tr").removeClass("whatsappme--focus")}).on("input",t).each(t);var p=e("#whatsappme_tab_advanced"),c=e(".whatsappme_view_all").data("inheritance")||{all:["front_page","blog_page","404_page","search","archive","singular","cpts"],archive:["date","author"],singular:["page","post"]};function r(t,a){if(t=t||"all",a=a||e('input[name="whatsappme[view]['+t+']"]:checked').val(),e(".view_inheritance_"+t).toggleClass("dashicons-visibility","yes"==a).toggleClass("dashicons-hidden","no"==a),"cpts"==t)e("[class*=view_inheritance_cpt_]").toggleClass("dashicons-visibility","yes"==a).toggleClass("dashicons-hidden","no"==a);else if(t in c){var n=e('input[name="whatsappme[view]['+t+']"]:checked').val();n=""===n?a:n,e.each(c[t],function(){r(this,n)})}}e("input",p).change(function(){r()}),e(".whatsappme_view_reset").click(function(t){t.preventDefault(),e('input[value=""]',p).prop("checked",!0),e(".whatsappme_view_all input",p).first().prop("checked",!0),r()}),r(),e("#whatsappme_button_image_add").click(function(t){t.preventDefault(),a||((a=wp.media({title:e(this).data("title")||"Select button image",button:{text:e(this).data("button")||"Use Image"},library:{type:"image"},multiple:!1})).on("select",function(){var t=a.state().get("selection").first().toJSON(),n=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url||t.url;e("#whatsappme_button_image_holder").css({"background-size":"cover","background-image":"url("+n+")"}),e("#whatsappme_button_image").val(t.id),e("#whatsappme_button_image_remove").removeClass("wame-hidden")}),a.on("open",function(){var t=wp.media.attachment(e("#whatsappme_button_image").val());a.state().get("selection").add(t?[t]:[])})),a.open()}),e("#whatsappme_button_image_remove").click(function(t){t.preventDefault(),e("#whatsappme_button_image_holder").removeAttr("style"),e("#whatsappme_button_image").val(""),e(this).addClass("wame-hidden")})}1===e(".whatsappme-metabox").length&&e("textarea",".whatsappme-metabox").on("focus input",t).each(t)})}(jQuery);
 
includes/{class-whatsappme-i18n.php → class-joinchat-i18n.php} RENAMED
@@ -7,11 +7,11 @@
7
  * so that it is ready for translation.
8
  *
9
  * @since 1.0.0
10
- * @package WhatsAppMe
11
- * @subpackage WhatsAppMe/includes
12
  * @author Creame <hola@crea.me>
13
  */
14
- class WhatsAppMe_i18n {
15
 
16
 
17
  /**
7
  * so that it is ready for translation.
8
  *
9
  * @since 1.0.0
10
+ * @package JoinChat
11
+ * @subpackage JoinChat/includes
12
  * @author Creame <hola@crea.me>
13
  */
14
+ class JoinChat_i18n {
15
 
16
 
17
  /**
includes/{class-whatsappme-integrations.php → class-joinchat-integrations.php} RENAMED
@@ -4,11 +4,11 @@
4
  * Define the third party plugins integration functionality.
5
  *
6
  * @since 3.0.0
7
- * @package WhatsAppMe
8
- * @subpackage WhatsAppMe/includes
9
  * @author Creame <hola@crea.me>
10
  */
11
- class WhatsAppMe_Integrations {
12
 
13
  /**
14
  * Load third party plugins integrations.
@@ -19,20 +19,20 @@ class WhatsAppMe_Integrations {
19
 
20
  // Integration with WooCommerce
21
  if ( class_exists( 'WooCommerce' ) ) {
22
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-whatsappme-wooadmin.php';
23
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-whatsappme-woopublic.php';
24
 
25
  if ( is_admin() ) {
26
 
27
- $plugin_wooadmin = new WhatsAppMe_WooAdmin();
28
 
29
- add_action( 'whatsappme_run_pre', array( $plugin_wooadmin, 'init' ) );
30
 
31
  } else {
32
 
33
- $plugin_woopublic = new WhatsAppMe_WooPublic();
34
 
35
- add_action( 'whatsappme_run_pre', array( $plugin_woopublic, 'init' ) );
36
 
37
  }
38
  }
4
  * Define the third party plugins integration functionality.
5
  *
6
  * @since 3.0.0
7
+ * @package JoinChat
8
+ * @subpackage JoinChat/includes
9
  * @author Creame <hola@crea.me>
10
  */
11
+ class JoinChatIntegrations {
12
 
13
  /**
14
  * Load third party plugins integrations.
19
 
20
  // Integration with WooCommerce
21
  if ( class_exists( 'WooCommerce' ) ) {
22
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-joinchat-wooadmin.php';
23
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-joinchat-woopublic.php';
24
 
25
  if ( is_admin() ) {
26
 
27
+ $plugin_wooadmin = new JoinChatWooAdmin();
28
 
29
+ add_action( 'joinchat_run_pre', array( $plugin_wooadmin, 'init' ) );
30
 
31
  } else {
32
 
33
+ $plugin_woopublic = new JoinChatWooPublic();
34
 
35
+ add_action( 'joinchat_run_pre', array( $plugin_woopublic, 'init' ) );
36
 
37
  }
38
  }
includes/{class-whatsappme-loader.php → class-joinchat-loader.php} RENAMED
@@ -8,11 +8,11 @@
8
  * run function to execute the list of actions and filters.
9
  *
10
  * @since 1.0.0
11
- * @package WhatsAppMe
12
- * @subpackage WhatsAppMe/includes
13
  * @author Creame <hola@crea.me>
14
  */
15
- class WhatsAppMe_Loader {
16
 
17
  /**
18
  * The array of actions registered with WordPress.
8
  * run function to execute the list of actions and filters.
9
  *
10
  * @since 1.0.0
11
+ * @package JoinChat
12
+ * @subpackage JoinChat/includes
13
  * @author Creame <hola@crea.me>
14
  */
15
+ class JoinChatLoader {
16
 
17
  /**
18
  * The array of actions registered with WordPress.
includes/{class-whatsappme-util.php → class-joinchat-util.php} RENAMED
@@ -6,11 +6,11 @@
6
  * Include static methods.
7
  *
8
  * @since 3.1.0
9
- * @package WhatsAppMe
10
- * @subpackage WhatsAppMe/includes
11
  * @author Creame <hola@crea.me>
12
  */
13
- class WhatsAppMe_Util {
14
 
15
  /**
16
  * Return list of settings that can be translated
@@ -25,7 +25,7 @@ class WhatsAppMe_Util {
25
  public static function settings_i18n() {
26
 
27
  return apply_filters(
28
- 'whatsappme_settings_i18n',
29
  array(
30
  'button_tip' => 'Tooltip',
31
  'message_text' => 'Call to Action',
@@ -144,7 +144,7 @@ class WhatsAppMe_Util {
144
  public static function formated_message( $string ) {
145
 
146
  $replacements = apply_filters(
147
- 'whatsappme_format_replacements',
148
  array(
149
  '/_(\S[^_]*\S)_/u' => '<em>$1</em>',
150
  '/\*(\S[^\*]*\S)\*/u' => '<strong>$1</strong>',
@@ -152,11 +152,6 @@ class WhatsAppMe_Util {
152
  )
153
  );
154
 
155
- // Since WP 4.6
156
- if ( function_exists( 'apply_filters_deprecated' ) ) {
157
- $replacements = apply_filters_deprecated( 'whatsappme_message_replacements', array( $replacements ), '3.0.3', 'whatsappme_format_replacements' );
158
- }
159
-
160
  // Split text into lines and apply replacements line by line
161
  $lines = explode( "\n", $string );
162
  foreach ( $lines as $key => $line ) {
@@ -188,7 +183,7 @@ class WhatsAppMe_Util {
188
  global $wp;
189
 
190
  $replacements = apply_filters(
191
- 'whatsappme_variable_replacements',
192
  array(
193
  'SITE' => get_bloginfo( 'name' ),
194
  'URL' => home_url( $wp->request ),
@@ -231,7 +226,7 @@ class WhatsAppMe_Util {
231
  $title = get_bloginfo( 'name' );
232
  }
233
 
234
- return apply_filters( 'whatsappme_get_title', $title );
235
 
236
  }
237
 
6
  * Include static methods.
7
  *
8
  * @since 3.1.0
9
+ * @package JoinChat
10
+ * @subpackage JoinChat/includes
11
  * @author Creame <hola@crea.me>
12
  */
13
+ class JoinChatUtil {
14
 
15
  /**
16
  * Return list of settings that can be translated
25
  public static function settings_i18n() {
26
 
27
  return apply_filters(
28
+ 'joinchat_settings_i18n',
29
  array(
30
  'button_tip' => 'Tooltip',
31
  'message_text' => 'Call to Action',
144
  public static function formated_message( $string ) {
145
 
146
  $replacements = apply_filters(
147
+ 'joinchat_format_replacements',
148
  array(
149
  '/_(\S[^_]*\S)_/u' => '<em>$1</em>',
150
  '/\*(\S[^\*]*\S)\*/u' => '<strong>$1</strong>',
152
  )
153
  );
154
 
 
 
 
 
 
155
  // Split text into lines and apply replacements line by line
156
  $lines = explode( "\n", $string );
157
  foreach ( $lines as $key => $line ) {
183
  global $wp;
184
 
185
  $replacements = apply_filters(
186
+ 'joinchat_variable_replacements',
187
  array(
188
  'SITE' => get_bloginfo( 'name' ),
189
  'URL' => home_url( $wp->request ),
226
  $title = get_bloginfo( 'name' );
227
  }
228
 
229
+ return apply_filters( 'joinchat_get_title', $title );
230
 
231
  }
232
 
includes/{class-whatsappme.php → class-joinchat.php} RENAMED
@@ -10,11 +10,11 @@
10
  * version of the plugin.
11
  *
12
  * @since 1.0.0
13
- * @package WhatsAppMe
14
- * @subpackage WhatsAppMe/includes
15
  * @author Creame <hola@crea.me>
16
  */
17
- class WhatsAppMe {
18
 
19
  /**
20
  * The loader that's responsible for maintaining and registering all hooks that power
@@ -22,7 +22,7 @@ class WhatsAppMe {
22
  *
23
  * @since 1.0.0
24
  * @access protected
25
- * @var WhatsAppMe_Loader $loader Maintains and registers all hooks for the plugin.
26
  */
27
  protected $loader;
28
 
@@ -54,14 +54,16 @@ class WhatsAppMe {
54
  * @since 1.0.0
55
  */
56
  public function __construct() {
57
- $this->version = defined( 'WHATSAPPME_VERSION' ) ? WHATSAPPME_VERSION : '1.0.0';
58
- $this->plugin_name = 'whatsappme';
59
 
60
  $this->load_dependencies();
61
  $this->set_locale();
62
  $this->load_integrations();
63
 
64
- is_admin() ? $this->define_admin_hooks() : $this->define_public_hooks();
 
 
65
 
66
  }
67
 
@@ -70,42 +72,44 @@ class WhatsAppMe {
70
  *
71
  * Include the following files that make up the plugin:
72
  *
73
- * - WhatsAppMe_Loader. Orchestrates the hooks of the plugin.
74
- * - WhatsAppMe_i18n. Defines internationalization functionality.
75
- * - WhatsAppMe_Admin. Defines all hooks for the admin area.
76
- * - WhatsAppMe_Public. Defines all hooks for the public side of the site.
77
  *
78
  * Create an instance of the loader which will be used to register the hooks
79
  * with WordPress.
80
  *
81
  * @since 1.0.0
82
  * @access private
 
83
  */
84
  private function load_dependencies() {
85
 
86
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-whatsappme-loader.php';
87
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-whatsappme-i18n.php';
88
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-whatsappme-integrations.php';
89
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-whatsappme-util.php';
90
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-whatsappme-admin.php';
91
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-whatsappme-public.php';
92
 
93
- $this->loader = new WhatsAppMe_Loader();
94
 
95
  }
96
 
97
  /**
98
  * Define the locale for this plugin for internationalization.
99
  *
100
- * Uses the WhatsAppMe_i18n class in order to set the domain and to register the hook
101
  * with WordPress.
102
  *
103
  * @since 1.0.0
104
  * @access private
 
105
  */
106
  private function set_locale() {
107
 
108
- $plugin_i18n = new WhatsAppMe_i18n();
109
 
110
  // No delegate to $this->loader, use WordPress add_action
111
  add_action( 'plugins_loaded', array( $plugin_i18n, 'load_plugin_textdomain' ) );
@@ -117,10 +121,11 @@ class WhatsAppMe {
117
  *
118
  * @since 3.0.0
119
  * @access private
 
120
  */
121
  private function load_integrations() {
122
 
123
- $plugin_integrations = new WhatsAppMe_Integrations();
124
 
125
  // No delegate to $this->loader, use WordPress add_action.
126
  // At 'plugins_loaded' hook can determine if other plugins are present.
@@ -128,6 +133,26 @@ class WhatsAppMe {
128
 
129
  }
130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
  /**
133
  * Register all of the hooks related to the admin area functionality
@@ -135,10 +160,11 @@ class WhatsAppMe {
135
  *
136
  * @since 1.0.0
137
  * @access private
 
138
  */
139
  private function define_admin_hooks() {
140
 
141
- $plugin_admin = new WhatsAppMe_Admin( $this->get_plugin_name(), $this->get_version() );
142
 
143
  $this->loader->add_action( 'admin_init', $plugin_admin, 'get_settings', 5 );
144
  $this->loader->add_action( 'admin_init', $plugin_admin, 'settings_init' );
@@ -147,9 +173,10 @@ class WhatsAppMe {
147
  $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_menu' );
148
  $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_meta_boxes' );
149
  $this->loader->add_action( 'save_post', $plugin_admin, 'save_post' );
150
- $this->loader->add_action( 'load-settings_page_whatsappme', $plugin_admin, 'help_tab' );
151
 
152
  $this->loader->add_filter( "plugin_action_links_creame-whatsapp-me/{$this->plugin_name}.php", $plugin_admin, 'settings_link' );
 
153
 
154
  }
155
 
@@ -159,10 +186,11 @@ class WhatsAppMe {
159
  *
160
  * @since 1.0.0
161
  * @access private
 
162
  */
163
  private function define_public_hooks() {
164
 
165
- $plugin_public = new WhatsAppMe_Public( $this->get_plugin_name(), $this->get_version() );
166
 
167
  $this->loader->add_action( 'wp', $plugin_public, 'get_settings' );
168
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
@@ -172,19 +200,59 @@ class WhatsAppMe {
172
 
173
  }
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  /**
176
  * Run the loader to execute all of the hooks with WordPress.
177
  *
178
  * @since 1.0.0
179
  * @since 3.0.0 Added actions
 
180
  */
181
  public function run() {
182
 
183
- do_action( 'whatsappme_run_pre', $this );
184
 
185
  $this->loader->run();
186
 
187
- do_action( 'whatsappme_run_pos', $this );
188
 
189
  }
190
 
@@ -203,7 +271,7 @@ class WhatsAppMe {
203
  * The reference to the class that orchestrates the hooks with the plugin.
204
  *
205
  * @since 1.0.0
206
- * @return WhatsAppMe_Loader Orchestrates the hooks of the plugin.
207
  */
208
  public function get_loader() {
209
  return $this->loader;
@@ -219,4 +287,19 @@ class WhatsAppMe {
219
  return $this->version;
220
  }
221
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
222
  }
10
  * version of the plugin.
11
  *
12
  * @since 1.0.0
13
+ * @package JoinChat
14
+ * @subpackage JoinChat/includes
15
  * @author Creame <hola@crea.me>
16
  */
17
+ class JoinChat {
18
 
19
  /**
20
  * The loader that's responsible for maintaining and registering all hooks that power
22
  *
23
  * @since 1.0.0
24
  * @access protected
25
+ * @var JoinChatLoader $loader Maintains and registers all hooks for the plugin.
26
  */
27
  protected $loader;
28
 
54
  * @since 1.0.0
55
  */
56
  public function __construct() {
57
+ $this->version = defined( 'JOINCHAT_VERSION' ) ? JOINCHAT_VERSION : '1.0.0';
58
+ $this->plugin_name = 'joinchat';
59
 
60
  $this->load_dependencies();
61
  $this->set_locale();
62
  $this->load_integrations();
63
 
64
+ if ( $this->checks() ) {
65
+ is_admin() ? $this->define_admin_hooks() : $this->define_public_hooks();
66
+ }
67
 
68
  }
69
 
72
  *
73
  * Include the following files that make up the plugin:
74
  *
75
+ * - JoinChatLoader. Orchestrates the hooks of the plugin.
76
+ * - JoinChat_i18n. Defines internationalization functionality.
77
+ * - JoinChatAdmin. Defines all hooks for the admin area.
78
+ * - JoinChatPublic. Defines all hooks for the public side of the site.
79
  *
80
  * Create an instance of the loader which will be used to register the hooks
81
  * with WordPress.
82
  *
83
  * @since 1.0.0
84
  * @access private
85
+ * @return void
86
  */
87
  private function load_dependencies() {
88
 
89
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-joinchat-loader.php';
90
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-joinchat-i18n.php';
91
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-joinchat-integrations.php';
92
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-joinchat-util.php';
93
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-joinchat-admin.php';
94
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-joinchat-public.php';
95
 
96
+ $this->loader = new JoinChatLoader();
97
 
98
  }
99
 
100
  /**
101
  * Define the locale for this plugin for internationalization.
102
  *
103
+ * Uses the JoinChat_i18n class in order to set the domain and to register the hook
104
  * with WordPress.
105
  *
106
  * @since 1.0.0
107
  * @access private
108
+ * @return void
109
  */
110
  private function set_locale() {
111
 
112
+ $plugin_i18n = new JoinChat_i18n();
113
 
114
  // No delegate to $this->loader, use WordPress add_action
115
  add_action( 'plugins_loaded', array( $plugin_i18n, 'load_plugin_textdomain' ) );
121
  *
122
  * @since 3.0.0
123
  * @access private
124
+ * @return void
125
  */
126
  private function load_integrations() {
127
 
128
+ $plugin_integrations = new JoinChatIntegrations();
129
 
130
  // No delegate to $this->loader, use WordPress add_action.
131
  // At 'plugins_loaded' hook can determine if other plugins are present.
133
 
134
  }
135
 
136
+ /**
137
+ * Run checks.
138
+ *
139
+ * Check if exists 'whatsappme' settings of previous versions (<4.0)
140
+ *
141
+ * @since 4.0.0
142
+ * @access private
143
+ * @return boolean true if pass checks, false otherwise
144
+ */
145
+ private function checks() {
146
+
147
+ $whatsappme = false !== get_option( 'whatsappme' );
148
+
149
+ if ( $whatsappme ) {
150
+ add_action( 'admin_notices', array( $this, 'need_reactivate_notice' ) );
151
+ }
152
+
153
+ return ! $whatsappme;
154
+
155
+ }
156
 
157
  /**
158
  * Register all of the hooks related to the admin area functionality
160
  *
161
  * @since 1.0.0
162
  * @access private
163
+ * @return void
164
  */
165
  private function define_admin_hooks() {
166
 
167
+ $plugin_admin = new JoinChatAdmin( $this->get_plugin_name(), $this->get_version() );
168
 
169
  $this->loader->add_action( 'admin_init', $plugin_admin, 'get_settings', 5 );
170
  $this->loader->add_action( 'admin_init', $plugin_admin, 'settings_init' );
173
  $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_menu' );
174
  $this->loader->add_action( 'add_meta_boxes', $plugin_admin, 'add_meta_boxes' );
175
  $this->loader->add_action( 'save_post', $plugin_admin, 'save_post' );
176
+ $this->loader->add_action( 'load-settings_page_joinchat', $plugin_admin, 'help_tab' );
177
 
178
  $this->loader->add_filter( "plugin_action_links_creame-whatsapp-me/{$this->plugin_name}.php", $plugin_admin, 'settings_link' );
179
+ $this->loader->add_filter( 'plugin_row_meta', $plugin_admin, 'plugin_links', 10, 2 );
180
 
181
  }
182
 
186
  *
187
  * @since 1.0.0
188
  * @access private
189
+ * @return void
190
  */
191
  private function define_public_hooks() {
192
 
193
+ $plugin_public = new JoinChatPublic( $this->get_plugin_name(), $this->get_version() );
194
 
195
  $this->loader->add_action( 'wp', $plugin_public, 'get_settings' );
196
  $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
200
 
201
  }
202
 
203
+ /**
204
+ * Migrate 'whatsappme' settings on versions < 4.0 to new 'joinchat'
205
+ *
206
+ * @since 4.0.0
207
+ * @access private
208
+ * @return void
209
+ */
210
+ public function activate() {
211
+ global $wpdb;
212
+
213
+ $general_option = get_option( 'whatsappme' );
214
+ if ( false !== $general_option ) {
215
+ // General option
216
+ update_option( 'joinchat', $general_option );
217
+ delete_option( 'whatsappme' );
218
+
219
+ // Post metas
220
+ $wpdb->update( $wpdb->postmeta, array( 'meta_key' => '_joinchat' ), array( 'meta_key' => '_whatsappme' ) );
221
+
222
+ // WPML strings
223
+ $wpml_strings_table = $wpdb->prefix . 'icl_strings';
224
+ if ( $wpdb->get_var( "SHOW TABLES LIKE '$wpml_strings_table'" ) === $wpml_strings_table ) {
225
+ $wpdb->update( $wpml_strings_table, array( 'context' => 'Join.chat' ), array( 'context' => 'WhatsApp me' ) );
226
+ }
227
+
228
+ // Polylang strings
229
+ $polylang_strings = get_option( 'polylang_wpml_strings' );
230
+ if ( false !== $polylang_strings ) {
231
+ foreach ( $polylang_strings as $key => $data ) {
232
+ if ( 'WhatsApp me' == $data['context'] ) {
233
+ $polylang_strings[ $key ]['context'] = 'Join.chat';
234
+ }
235
+ }
236
+ update_option( 'polylang_wpml_strings', $polylang_strings );
237
+ }
238
+ }
239
+
240
+ }
241
+
242
  /**
243
  * Run the loader to execute all of the hooks with WordPress.
244
  *
245
  * @since 1.0.0
246
  * @since 3.0.0 Added actions
247
+ * @return void
248
  */
249
  public function run() {
250
 
251
+ do_action( 'joinchat_run_pre', $this );
252
 
253
  $this->loader->run();
254
 
255
+ do_action( 'joinchat_run_pos', $this );
256
 
257
  }
258
 
271
  * The reference to the class that orchestrates the hooks with the plugin.
272
  *
273
  * @since 1.0.0
274
+ * @return JoinChatLoader Orchestrates the hooks of the plugin.
275
  */
276
  public function get_loader() {
277
  return $this->loader;
287
  return $this->version;
288
  }
289
 
290
+ /**
291
+ * Output notice message for plugin re-activation
292
+ *
293
+ * @since 4.0.0
294
+ * @access public
295
+ * @return void
296
+ */
297
+ public function need_reactivate_notice() {
298
+
299
+ echo '<div class="error"><p>' .
300
+ __( '<strong>WAme</strong> now is <strong>Join.chat</strong>. Please, deactivate and re-activate plugin to migrate settings.', 'creame-whatsapp-me' ) .
301
+ '</p></div>';
302
+
303
+ }
304
+
305
  }
whatsappme.php → joinchat.php RENAMED
@@ -3,13 +3,13 @@
3
  /**
4
  * @link https://crea.me
5
  * @since 1.0.0
6
- * @package WhatsAppMe
7
  *
8
  * @wordpress-plugin
9
- * Plugin Name: VVAme chat
10
- * Plugin URI: https://wame.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: 3.2.3
13
  * Author: Creame
14
  * Author URI: https://crea.me
15
  * License: GPL-2.0+
@@ -27,29 +27,31 @@ if ( ! defined( 'WPINC' ) ) {
27
  * Currently plugin version.
28
  * Start at version 1.0.0 and use SemVer - https://semver.org
29
  */
30
- define( 'WHATSAPPME_VERSION', '3.2.3' );
31
 
32
  /**
33
  * The core plugin class that is used to define internationalization,
34
  * admin-specific hooks, and public-facing site hooks.
35
  */
36
- require plugin_dir_path( __FILE__ ) . 'includes/class-whatsappme.php';
37
 
38
  /**
39
  * Begins execution of the plugin.
40
  *
41
  * Everything within the plugin is registered via hooks,
42
  * but initiation is delayed to 'init' hook to allow extensions
43
- * or third party plugins to change WAme behavior.
44
  *
45
  * @since 1.0.0
46
  * @since 3.0.0 Replaced direct run() to launch via 'init' hook
47
  */
48
- function run_whatsappme() {
49
 
50
- $plugin = new WhatsAppMe();
51
 
 
52
  add_action( 'init', array( $plugin, 'run' ) );
53
 
54
  }
55
- run_whatsappme();
 
3
  /**
4
  * @link https://crea.me
5
  * @since 1.0.0
6
+ * @package JoinChat
7
  *
8
  * @wordpress-plugin
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.0.0
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.0.0' );
31
 
32
  /**
33
  * The core plugin class that is used to define internationalization,
34
  * admin-specific hooks, and public-facing site hooks.
35
  */
36
+ require plugin_dir_path( __FILE__ ) . 'includes/class-joinchat.php';
37
 
38
  /**
39
  * Begins execution of the plugin.
40
  *
41
  * Everything within the plugin is registered via hooks,
42
  * but initiation is delayed to 'init' hook to allow extensions
43
+ * or third party plugins to change Join.chat behavior.
44
  *
45
  * @since 1.0.0
46
  * @since 3.0.0 Replaced direct run() to launch via 'init' hook
47
  */
48
+ function run_joinchat() {
49
 
50
+ $plugin = new JoinChat();
51
 
52
+ register_activation_hook( __FILE__, array( $plugin, 'activate' ) );
53
  add_action( 'init', array( $plugin, 'run' ) );
54
 
55
  }
56
+
57
+ run_joinchat();
languages/creame-whatsapp-me-fr_FR.mo DELETED
Binary file
languages/creame-whatsapp-me-fr_FR.po DELETED
@@ -1,549 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: WAme chat\n"
4
- "Report-Msgid-Bugs-To: Translator Name <translations@example.com>\n"
5
- "POT-Creation-Date: 2020-03-19 17:27+0100\n"
6
- "PO-Revision-Date: 2020-03-19 17:30+0100\n"
7
- "Last-Translator: Pacotole <pacotole@crea.me>\n"
8
- "Language-Team: Creame <hola@crea.me>\n"
9
- "Language: fr\n"
10
- "MIME-Version: 1.0\n"
11
- "Content-Type: text/plain; charset=UTF-8\n"
12
- "Content-Transfer-Encoding: 8bit\n"
13
- "Plural-Forms: nplurals=2; plural=(n > 1);\n"
14
- "X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n"
15
- "X-Poedit-SourceCharset: UTF-8\n"
16
- "X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html_x:1,2c;esc_html__;"
17
- "esc_attr_e;esc_attr_x:1,2c;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
18
- "_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2\n"
19
- "X-Poedit-Basepath: ..\n"
20
- "X-Generator: Poedit 1.8.7.1\n"
21
- "X-Poedit-SearchPath-0: .\n"
22
-
23
- #: admin/class-whatsappme-admin.php:99
24
- msgid "General"
25
- msgstr "Général"
26
-
27
- #: admin/class-whatsappme-admin.php:100
28
- msgid "Advanced"
29
- msgstr "Avancé"
30
-
31
- #: admin/class-whatsappme-admin.php:117 admin/class-whatsappme-admin.php:551
32
- #: public/class-whatsappme-public.php:102
33
- msgid "Open chat"
34
- msgstr "Ouvrir chat"
35
-
36
- #: admin/class-whatsappme-admin.php:240 admin/class-whatsappme-admin.php:832
37
- msgid "Telephone"
38
- msgstr "Téléphone"
39
-
40
- #: admin/class-whatsappme-admin.php:241 admin/class-whatsappme-admin.php:840
41
- msgid "Message"
42
- msgstr "Message"
43
-
44
- #: admin/class-whatsappme-admin.php:242 admin/class-whatsappme-admin.php:494
45
- msgid "Mobile Only"
46
- msgstr "Mobile seulement"
47
-
48
- #: admin/class-whatsappme-admin.php:243 admin/class-whatsappme-admin.php:500
49
- msgid "Position on Screen"
50
- msgstr "Position sur l’écran"
51
-
52
- #: admin/class-whatsappme-admin.php:244
53
- msgid "Image"
54
- msgstr "Image"
55
-
56
- #: admin/class-whatsappme-admin.php:245
57
- msgid "Tooltip"
58
- msgstr "Info-bulle"
59
-
60
- #: admin/class-whatsappme-admin.php:246
61
- msgid "Button Delay"
62
- msgstr "Délai de bouton"
63
-
64
- #: admin/class-whatsappme-admin.php:247 admin/class-whatsappme-admin.php:531
65
- msgid "WhatsApp Web"
66
- msgstr "WhatsApp Web"
67
-
68
- #: admin/class-whatsappme-admin.php:250 admin/class-whatsappme-admin.php:836
69
- msgid "Call to Action"
70
- msgstr "Appel à Action"
71
-
72
- #: admin/class-whatsappme-admin.php:251
73
- msgid "Start WhatsApp Button"
74
- msgstr "Bouton de démarrage WhatsApp"
75
-
76
- #: admin/class-whatsappme-admin.php:252
77
- msgid "Chat Delay"
78
- msgstr "Retard de chat"
79
-
80
- #: admin/class-whatsappme-admin.php:253 admin/class-whatsappme-admin.php:561
81
- msgid "Notification Balloon"
82
- msgstr "Ballon de notification"
83
-
84
- #: admin/class-whatsappme-admin.php:254 admin/class-whatsappme-admin.php:567
85
- msgid "Dark Mode"
86
- msgstr "Mode sombre"
87
-
88
- #: admin/class-whatsappme-admin.php:263
89
- msgid "Global"
90
- msgstr "Global"
91
-
92
- #: admin/class-whatsappme-admin.php:268
93
- msgid "Front Page"
94
- msgstr "Page d’accueil"
95
-
96
- #: admin/class-whatsappme-admin.php:269
97
- msgid "Blog Page"
98
- msgstr "Page blog"
99
-
100
- #: admin/class-whatsappme-admin.php:270
101
- msgid "404 Page"
102
- msgstr "Page 404"
103
-
104
- #: admin/class-whatsappme-admin.php:271
105
- msgid "Search Results"
106
- msgstr "Résultats de la recherche"
107
-
108
- #: admin/class-whatsappme-admin.php:272
109
- msgid "Archives"
110
- msgstr "Archives"
111
-
112
- #: admin/class-whatsappme-admin.php:273
113
- msgid "Date Archives"
114
- msgstr "Archives de dates"
115
-
116
- #: admin/class-whatsappme-admin.php:274
117
- msgid "Author Archives"
118
- msgstr "Archives de l'auteur"
119
-
120
- #: admin/class-whatsappme-admin.php:275
121
- msgid "Singular"
122
- msgstr "Singulier"
123
-
124
- #: admin/class-whatsappme-admin.php:276
125
- msgid "Page"
126
- msgstr "Page"
127
-
128
- #: admin/class-whatsappme-admin.php:277
129
- msgid "Post"
130
- msgstr "Article"
131
-
132
- #: admin/class-whatsappme-admin.php:376
133
- msgid "Settings saved"
134
- msgstr "Paramètres sauvegardés"
135
-
136
- #: admin/class-whatsappme-admin.php:422
137
- msgid "Button"
138
- msgstr "Bouton"
139
-
140
- #: admin/class-whatsappme-admin.php:423
141
- msgid ""
142
- "Set the contact number and where you want the WhatsApp button to be "
143
- "displayed."
144
- msgstr ""
145
- "Définissez le numéro de contact et l'endroit où vous souhaitez que le bouton "
146
- "WhatsApp s'affiche."
147
-
148
- #: admin/class-whatsappme-admin.php:427
149
- msgid "Chat Window"
150
- msgstr "Fenêtre de conversation"
151
-
152
- #: admin/class-whatsappme-admin.php:429
153
- msgid ""
154
- "If you define a \"Call to Action\" a window will be displayed simulating a "
155
- "chat before launching WhatsApp."
156
- msgstr ""
157
- "Si vous définissez un \"Appel à l'action\", une fenêtre sera affichée "
158
- "simulant un chat avant de lancer WhatsApp."
159
-
160
- #: admin/class-whatsappme-admin.php:430
161
- msgid ""
162
- "You can introduce yourself, offer help or even make promotions to your users."
163
- msgstr ""
164
- "Vous pouvez vous présenter, proposer de l’aide ou même faire des promotions "
165
- "à vos utilisateurs."
166
-
167
- #: admin/class-whatsappme-admin.php:435
168
- msgid "Advanced Visibility Settings"
169
- msgstr "Paramètres de visibilité avancés"
170
-
171
- #: admin/class-whatsappme-admin.php:436
172
- msgid ""
173
- "From here you can configure on which pages the WhatsApp button will be "
174
- "visible."
175
- msgstr ""
176
- "Ici, vous pouvez configurer les pages sur lesquelles le bouton WhatsApp sera "
177
- "visible."
178
-
179
- #: admin/class-whatsappme-admin.php:437
180
- msgid "Restore default visibility"
181
- msgstr "Restaurer la visibilité par défaut"
182
-
183
- #: admin/class-whatsappme-admin.php:445
184
- msgid "Custom Post Types"
185
- msgstr "Types d'Articles personnalisés"
186
-
187
- #: admin/class-whatsappme-admin.php:471 admin/class-whatsappme-admin.php:607
188
- #: admin/class-whatsappme-admin.php:849
189
- msgid "Show"
190
- msgstr "Afficher"
191
-
192
- #: admin/class-whatsappme-admin.php:473 admin/class-whatsappme-admin.php:609
193
- #: admin/class-whatsappme-admin.php:851
194
- msgid "Hide"
195
- msgstr "Masquer"
196
-
197
- #: admin/class-whatsappme-admin.php:475
198
- msgid "Inherit"
199
- msgstr "Hérité"
200
-
201
- #: admin/class-whatsappme-admin.php:485
202
- msgid ""
203
- "Contact phone number <strong>(the button will not be shown if it's empty)</"
204
- "strong>"
205
- msgstr ""
206
- "Numéro de téléphone de contact <strong>(le bouton ne sera pas affiché s’il "
207
- "est vide)</strong>"
208
-
209
- #: admin/class-whatsappme-admin.php:487
210
- #, php-format
211
- msgid "Add unlimited numbers with %1$s or multiple contacts with %2$s"
212
- msgstr ""
213
- "Ajouter des nombres illimités de numéros avec des contacts de %1$s ou "
214
- "plusieurs avec %2$s"
215
-
216
- #: admin/class-whatsappme-admin.php:496
217
- msgid "Only display the button on mobile devices"
218
- msgstr "N’affichez le bouton que sur les appareils mobiles"
219
-
220
- #: admin/class-whatsappme-admin.php:502
221
- msgid "Left"
222
- msgstr "Gauche"
223
-
224
- #: admin/class-whatsappme-admin.php:504
225
- msgid "Right"
226
- msgstr "Droite"
227
-
228
- #: admin/class-whatsappme-admin.php:514
229
- msgid "Select an image"
230
- msgstr "Sélectionner une image"
231
-
232
- #: admin/class-whatsappme-admin.php:515
233
- msgid "Select button image"
234
- msgstr "Sélectionnez l’image du bouton"
235
-
236
- #: admin/class-whatsappme-admin.php:515
237
- msgid "Use image"
238
- msgstr "Utiliser l’image"
239
-
240
- #: admin/class-whatsappme-admin.php:516
241
- msgid "Remove"
242
- msgstr "Supprimer"
243
-
244
- #: admin/class-whatsappme-admin.php:517
245
- msgid "The image will alternate with WhatsApp logo"
246
- msgstr "L’image alternera avec le logo WhatsApp"
247
-
248
- #: admin/class-whatsappme-admin.php:521
249
- msgid "💬 Need help?"
250
- msgstr "💬 besoin d’aide?"
251
-
252
- #: admin/class-whatsappme-admin.php:522
253
- msgid "Short text shown next to WhatsApp button"
254
- msgstr "Texte court affiché à côté du bouton WhatsApp"
255
-
256
- #: admin/class-whatsappme-admin.php:526
257
- msgid "seconds"
258
- msgstr "secondes"
259
-
260
- #: admin/class-whatsappme-admin.php:527
261
- msgid "Time since the page is opened until the WhatsApp button is displayed"
262
- msgstr ""
263
- "Temps depuis que la page est ouverte jusqu’à ce que le bouton WhatsApp soit "
264
- "affiché"
265
-
266
- #: admin/class-whatsappme-admin.php:533
267
- msgid "Open <em>WhatsApp Web</em> directly on desktop"
268
- msgstr "Ouvrez <em>WhatsApp Web</em> directement sur le bureau"
269
-
270
- #: admin/class-whatsappme-admin.php:537
271
- msgid ""
272
- "Hello 👋\n"
273
- "Can we help you?"
274
- msgstr ""
275
- "Bonjour 👋\n"
276
- "Comment peut-on vous aider ?"
277
-
278
- #: admin/class-whatsappme-admin.php:538
279
- msgid "Define a text to encourage users to contact by WhatsApp"
280
- msgstr ""
281
- "Définir un texte pour encourager les utilisateurs à contacter par WhatsApp"
282
-
283
- #: admin/class-whatsappme-admin.php:540
284
- #, php-format
285
- msgid "Add links, images, videos and more with %s"
286
- msgstr "Ajoutez des liens, des images, des vidéos et plus encore avec %s"
287
-
288
- #: admin/class-whatsappme-admin.php:546
289
- msgid "Hi *{SITE}*! I need more info about {TITLE} {URL}"
290
- msgstr "Salut *{SITE}*! J'ai besoin de plus d'informations sur {TITLE} {URL}"
291
-
292
- #: admin/class-whatsappme-admin.php:547
293
- msgid "Predefined text for the first message the user will send you"
294
- msgstr "Texte prédéfini pour le premier message que l’utilisateur vous enverra"
295
-
296
- #: admin/class-whatsappme-admin.php:552
297
- msgid "Text of the start WhatsApp button on Chat Window"
298
- msgstr "Texte de démarrage du bouton WhatsApp sur la fenêtre du chat"
299
-
300
- #: admin/class-whatsappme-admin.php:556
301
- msgid "seconds (0 disabled)"
302
- msgstr "secondes (0 désactivé)"
303
-
304
- #: admin/class-whatsappme-admin.php:557
305
- msgid "Chat Window is automatically displayed after delay"
306
- msgstr "La fenêtre de chat est automatiquement affichée après le retard"
307
-
308
- #: admin/class-whatsappme-admin.php:563
309
- msgid ""
310
- "Display a notification balloon instead of opening the Chat Window for a "
311
- "\"less intrusive\" mode"
312
- msgstr ""
313
- "Afficher une bulle de notification à la place de la fenêtre de discussion "
314
- "pour un mode \"moins intrusif\""
315
-
316
- #: admin/class-whatsappme-admin.php:569
317
- msgid "No"
318
- msgstr "Non"
319
-
320
- #: admin/class-whatsappme-admin.php:571
321
- msgid "Yes"
322
- msgstr "Oui"
323
-
324
- #: admin/class-whatsappme-admin.php:573
325
- msgid "Auto (detects device dark mode)"
326
- msgstr "Auto (détecte le mode sombre de l’appareil)"
327
-
328
- #: admin/class-whatsappme-admin.php:639
329
- msgid "Support and Help"
330
- msgstr "Soutien et Aide"
331
-
332
- #: admin/class-whatsappme-admin.php:643
333
- #, php-format
334
- msgid ""
335
- "If you need help, first review our <a href=\"%1$s\" rel=\"external\" target="
336
- "\"_blank\">documentation</a> and if you don't find a solution check the <a "
337
- "href=\"%2$s\" rel=\"external\" target=\"_blank\">free plugin support forum</"
338
- "a> or buy our <a href=\"%3$s\" rel=\"external\" target=\"_blank\">premium "
339
- "support</a>."
340
- msgstr ""
341
- "Si vous avez besoin d’aide, passez d’abord en revue notre <a href=\"%1$s\" "
342
- "rel=\"external\" target=\"_blank\">documentation</a> et si vous ne trouvez "
343
- "pas de solution, vérifiez le <a href=\"%2$s\" rel=\"external\" target="
344
- "\"_blank\">forum de support plugin gratuit</a> ou achetez notre support <a "
345
- "href=\"%3$s\" rel=\"external\" target=\"_blank\">premium.</a>"
346
-
347
- #: admin/class-whatsappme-admin.php:652
348
- msgid "If you like WAme 😍"
349
- msgstr "Si vous aimez WAme 😍"
350
-
351
- #: admin/class-whatsappme-admin.php:655
352
- #, php-format
353
- msgid "Please leave us a %s rating. We'll thank you."
354
- msgstr "Merci de nous laisser une note de %s. Nous vous remercierons."
355
-
356
- #: admin/class-whatsappme-admin.php:659
357
- #, php-format
358
- msgid "Subscribe to our newsletter and visit our blog at %s."
359
- msgstr "Abonnez-vous à notre newsletter et visitez notre blog à %s."
360
-
361
- #: admin/class-whatsappme-admin.php:663
362
- #, php-format
363
- msgid "Follow %s on twitter."
364
- msgstr "Suivez %s sur twitter."
365
-
366
- #: admin/class-whatsappme-admin.php:670
367
- msgid "Styles and Variables"
368
- msgstr "Styles et variables"
369
-
370
- #: admin/class-whatsappme-admin.php:672
371
- msgid ""
372
- "You can use formatting styles like in WhatsApp: _<em>italic</em>_ "
373
- "*<strong>bold</strong>* ~<del>strikethrough</del>~."
374
- msgstr ""
375
- "Vous pouvez utiliser des styles de mise en forme comme dans WhatsApp :"
376
- "_<em>italic</em>_ *<strong>bold</strong>* ~<del>strikethrough</del>~."
377
-
378
- #: admin/class-whatsappme-admin.php:673
379
- msgid ""
380
- "You can use dynamic variables that will be replaced by the values of the "
381
- "page the user visits:"
382
- msgstr ""
383
- "Vous pouvez utiliser des variables dynamiques qui seront remplacées par les "
384
- "valeurs de la page que l’utilisateur visite :"
385
-
386
- #: admin/class-whatsappme-admin.php:677
387
- msgid "Page Title"
388
- msgstr "Titre de la page"
389
-
390
- #: admin/class-whatsappme-admin.php:697
391
- msgid "Settings"
392
- msgstr "Réglages"
393
-
394
- #: admin/class-whatsappme-admin.php:766
395
- msgid "WAme chat"
396
- msgstr "WAme chat"
397
-
398
- #: admin/class-whatsappme-admin.php:843
399
- msgid "Can use vars"
400
- msgstr "Peut utiliser vars"
401
-
402
- #: admin/class-whatsappme-admin.php:845
403
- msgid "to leave it blank use"
404
- msgstr "pour le laisser vide utiliser"
405
-
406
- #: admin/class-whatsappme-admin.php:853
407
- msgid "Default visibility"
408
- msgstr "Visibilité par défaut"
409
-
410
- #: admin/class-whatsappme-admin.php:912
411
- msgid "You can use vars"
412
- msgstr "Vous pouvez utiliser vars"
413
-
414
- #: admin/class-whatsappme-admin.php:913
415
- msgid "Show Help"
416
- msgstr "Afficher Aide"
417
-
418
- #: admin/class-whatsappme-wooadmin.php:128
419
- msgid "Shop"
420
- msgstr "Boutique"
421
-
422
- #: admin/class-whatsappme-wooadmin.php:129
423
- msgid "Product Page"
424
- msgstr "Page de produit"
425
-
426
- #: admin/class-whatsappme-wooadmin.php:130
427
- msgid "Cart"
428
- msgstr "Panier"
429
-
430
- #: admin/class-whatsappme-wooadmin.php:131
431
- msgid "Checkout"
432
- msgstr "Validation de la commande"
433
-
434
- #: admin/class-whatsappme-wooadmin.php:132
435
- msgid "My Account"
436
- msgstr "Mon compte"
437
-
438
- #: admin/class-whatsappme-wooadmin.php:148
439
- msgid "Call to Action for Products"
440
- msgstr "Appel à l’action pour les produits"
441
-
442
- #: admin/class-whatsappme-wooadmin.php:149
443
- msgid "Call to Action for Products on Sale"
444
- msgstr "Appel à l’action pour les produits en vente"
445
-
446
- #: admin/class-whatsappme-wooadmin.php:150
447
- msgid "Message for Products"
448
- msgstr "Message pour les produits"
449
-
450
- #: admin/class-whatsappme-wooadmin.php:192
451
- msgid "WooCommerce"
452
- msgstr "WooCommerce"
453
-
454
- #: admin/class-whatsappme-wooadmin.php:196
455
- msgid "Product Chat Window"
456
- msgstr "Fenêtre de chat de produit"
457
-
458
- #: admin/class-whatsappme-wooadmin.php:198
459
- msgid ""
460
- "You can define other different texts for the Chat Window on the product "
461
- "pages."
462
- msgstr ""
463
- "Vous pouvez définir d’autres textes différents pour la fenêtre de chat sur "
464
- "les pages de produits."
465
-
466
- #: admin/class-whatsappme-wooadmin.php:222
467
- msgid ""
468
- "This *{PRODUCT}* can be yours for only *{PRICE}*!\n"
469
- "If you have any questions, ask us."
470
- msgstr ""
471
- "Ce *{PRODUCT}* peut être le vôtre pour seulement*{PRICE}*!\n"
472
- "Si vous avez des questions, posez-nous."
473
-
474
- #: admin/class-whatsappme-wooadmin.php:224
475
- msgid "Define a text for your products to encourage customers to contact"
476
- msgstr ""
477
- "Définissez un texte pour vos produits afin d’encourager les clients à "
478
- "contacter"
479
-
480
- #: admin/class-whatsappme-wooadmin.php:229
481
- msgid ""
482
- "Save {DISCOUNT}! This *{PRODUCT}* can be yours for only ~{REGULAR}~ *{PRICE}"
483
- "*.\n"
484
- "If you have any questions, ask us."
485
- msgstr ""
486
- "Enregistrer {DISCOUNT}! Ce *{PRODUCT}* peut être le vôtre pour seulement "
487
- "~{REGULAR}~ *{PRICE}*.\n"
488
- "Si vous avez des questions, posez-nous."
489
-
490
- #: admin/class-whatsappme-wooadmin.php:231
491
- msgid ""
492
- "Define a text for your products on sale to encourage customers to contact"
493
- msgstr ""
494
- "Définissez un texte pour vos produits en vente afin d’encourager les clients "
495
- "à contacter"
496
-
497
- #: admin/class-whatsappme-wooadmin.php:236
498
- msgid ""
499
- "*Hi {SITE}!*\n"
500
- "I have a question about *{PRODUCT} ({SKU})*"
501
- msgstr ""
502
- "*Salut {SITE}!*\n"
503
- "J'ai une question au sujet de *{PRODUCT} ({SKU})*"
504
-
505
- #: admin/class-whatsappme-wooadmin.php:237
506
- msgid "Predefined text for the first message the client will send you"
507
- msgstr "Texte prédéfini pour le premier message que le client vous enverra"
508
-
509
- #: admin/class-whatsappme-wooadmin.php:272
510
- msgid "<strong>WooCommerce</strong>, in product pages you can also use:"
511
- msgstr ""
512
- "<strong>WooCommerce</strong>, dans les pages de produits, vous pouvez "
513
- "également utiliser:"
514
-
515
- #: admin/class-whatsappme-wooadmin.php:274
516
- msgid "Product Name"
517
- msgstr "Nom du produit"
518
-
519
- #: admin/class-whatsappme-wooadmin.php:278
520
- msgid ""
521
- "For the <strong>Call to Action for Products on Sale</strong>, you can also "
522
- "use:"
523
- msgstr ""
524
- "Pour <strong>l’appel à l’action pour les produits en vente</strong>, vous "
525
- "pouvez également utiliser:"
526
-
527
- #. Name of the plugin
528
- msgid "VVAme chat"
529
- msgstr "VVAme chat"
530
-
531
- #. Description of the plugin
532
- msgid ""
533
- "Connects a WordPress chat with WhatsApp. The best solution for marketing and "
534
- "support. Stop losing customers and increase your sales."
535
- msgstr ""
536
- "Connecte un chat WordPress avec WhatsApp. La meilleure solution pour le "
537
- "marketing et le support. Ne perdez plus de clients et augmentez vos ventes."
538
-
539
- #. URI of the plugin
540
- msgid "https://wame.chat"
541
- msgstr "https://wame.chat"
542
-
543
- #. Author of the plugin
544
- msgid "Creame"
545
- msgstr "Creame"
546
-
547
- #. Author URI of the plugin
548
- msgid "https://crea.me"
549
- msgstr "https://crea.me"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/creame-whatsapp-me.pot CHANGED
@@ -1,8 +1,8 @@
1
  #, fuzzy
2
  msgid ""
3
  msgstr ""
4
- "Project-Id-Version: WAme chat\n"
5
- "POT-Creation-Date: 2020-03-19 17:17+0100\n"
6
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
7
  "Last-Translator: Your Name <you@example.com>\n"
8
  "Language-Team: Creame <hola@crea.me>\n"
@@ -14,473 +14,574 @@ msgstr ""
14
  "X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html_x:1,2c;esc_html__;"
17
- "esc_attr_e;esc_attr_x:1,2c;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;"
18
- "_x:1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2\n"
19
  "X-Poedit-Basepath: ..\n"
20
- "X-Generator: Poedit 1.8.7.1\n"
21
  "X-Poedit-SearchPath-0: .\n"
 
22
 
23
- #: admin/class-whatsappme-admin.php:99
24
- msgid "General"
 
25
  msgstr ""
26
 
27
- #: admin/class-whatsappme-admin.php:100
28
- msgid "Advanced"
29
  msgstr ""
30
 
31
- #: admin/class-whatsappme-admin.php:117 admin/class-whatsappme-admin.php:551
32
- #: public/class-whatsappme-public.php:102
33
- msgid "Open chat"
34
  msgstr ""
35
 
36
- #: admin/class-whatsappme-admin.php:240 admin/class-whatsappme-admin.php:832
37
- msgid "Telephone"
38
  msgstr ""
39
 
40
- #: admin/class-whatsappme-admin.php:241 admin/class-whatsappme-admin.php:840
41
- msgid "Message"
42
  msgstr ""
43
 
44
- #: admin/class-whatsappme-admin.php:242 admin/class-whatsappme-admin.php:494
45
- msgid "Mobile Only"
46
  msgstr ""
47
 
48
- #: admin/class-whatsappme-admin.php:243 admin/class-whatsappme-admin.php:500
49
  msgid "Position on Screen"
50
  msgstr ""
51
 
52
- #: admin/class-whatsappme-admin.php:244
53
  msgid "Image"
54
  msgstr ""
55
 
56
- #: admin/class-whatsappme-admin.php:245
57
  msgid "Tooltip"
58
  msgstr ""
59
 
60
- #: admin/class-whatsappme-admin.php:246
61
  msgid "Button Delay"
62
  msgstr ""
63
 
64
- #: admin/class-whatsappme-admin.php:247 admin/class-whatsappme-admin.php:531
 
 
 
 
65
  msgid "WhatsApp Web"
66
  msgstr ""
67
 
68
- #: admin/class-whatsappme-admin.php:250 admin/class-whatsappme-admin.php:836
69
  msgid "Call to Action"
70
  msgstr ""
71
 
72
- #: admin/class-whatsappme-admin.php:251
73
  msgid "Start WhatsApp Button"
74
  msgstr ""
75
 
76
- #: admin/class-whatsappme-admin.php:252
 
 
 
 
 
 
 
 
 
 
 
 
77
  msgid "Chat Delay"
78
  msgstr ""
79
 
80
- #: admin/class-whatsappme-admin.php:253 admin/class-whatsappme-admin.php:561
81
- msgid "Notification Balloon"
82
  msgstr ""
83
 
84
- #: admin/class-whatsappme-admin.php:254 admin/class-whatsappme-admin.php:567
85
- msgid "Dark Mode"
86
  msgstr ""
87
 
88
- #: admin/class-whatsappme-admin.php:263
89
  msgid "Global"
90
  msgstr ""
91
 
92
- #: admin/class-whatsappme-admin.php:268
93
  msgid "Front Page"
94
  msgstr ""
95
 
96
- #: admin/class-whatsappme-admin.php:269
97
  msgid "Blog Page"
98
  msgstr ""
99
 
100
- #: admin/class-whatsappme-admin.php:270
101
  msgid "404 Page"
102
  msgstr ""
103
 
104
- #: admin/class-whatsappme-admin.php:271
105
  msgid "Search Results"
106
  msgstr ""
107
 
108
- #: admin/class-whatsappme-admin.php:272
109
  msgid "Archives"
110
  msgstr ""
111
 
112
- #: admin/class-whatsappme-admin.php:273
113
  msgid "Date Archives"
114
  msgstr ""
115
 
116
- #: admin/class-whatsappme-admin.php:274
117
  msgid "Author Archives"
118
  msgstr ""
119
 
120
- #: admin/class-whatsappme-admin.php:275
121
  msgid "Singular"
122
  msgstr ""
123
 
124
- #: admin/class-whatsappme-admin.php:276
125
  msgid "Page"
126
  msgstr ""
127
 
128
- #: admin/class-whatsappme-admin.php:277
129
  msgid "Post"
130
  msgstr ""
131
 
132
- #: admin/class-whatsappme-admin.php:376
133
  msgid "Settings saved"
134
  msgstr ""
135
 
136
- #: admin/class-whatsappme-admin.php:422
137
  msgid "Button"
138
  msgstr ""
139
 
140
- #: admin/class-whatsappme-admin.php:423
141
  msgid ""
142
  "Set the contact number and where you want the WhatsApp button to be "
143
  "displayed."
144
  msgstr ""
145
 
146
- #: admin/class-whatsappme-admin.php:427
147
  msgid "Chat Window"
148
  msgstr ""
149
 
150
- #: admin/class-whatsappme-admin.php:429
151
  msgid ""
152
  "If you define a \"Call to Action\" a window will be displayed simulating a "
153
  "chat before launching WhatsApp."
154
  msgstr ""
155
 
156
- #: admin/class-whatsappme-admin.php:430
157
  msgid ""
158
  "You can introduce yourself, offer help or even make promotions to your users."
159
  msgstr ""
160
 
161
- #: admin/class-whatsappme-admin.php:435
162
- msgid "Advanced Visibility Settings"
 
 
 
 
 
 
 
 
 
 
163
  msgstr ""
164
 
165
- #: admin/class-whatsappme-admin.php:436
166
  msgid ""
167
  "From here you can configure on which pages the WhatsApp button will be "
168
  "visible."
169
  msgstr ""
170
 
171
- #: admin/class-whatsappme-admin.php:437
172
  msgid "Restore default visibility"
173
  msgstr ""
174
 
175
- #: admin/class-whatsappme-admin.php:445
176
  msgid "Custom Post Types"
177
  msgstr ""
178
 
179
- #: admin/class-whatsappme-admin.php:471 admin/class-whatsappme-admin.php:607
180
- #: admin/class-whatsappme-admin.php:849
181
  msgid "Show"
182
  msgstr ""
183
 
184
- #: admin/class-whatsappme-admin.php:473 admin/class-whatsappme-admin.php:609
185
- #: admin/class-whatsappme-admin.php:851
186
  msgid "Hide"
187
  msgstr ""
188
 
189
- #: admin/class-whatsappme-admin.php:475
190
  msgid "Inherit"
191
  msgstr ""
192
 
193
- #: admin/class-whatsappme-admin.php:485
194
  msgid ""
195
- "Contact phone number <strong>(the button will not be shown if it's empty)</"
196
- "strong>"
197
  msgstr ""
198
 
199
- #: admin/class-whatsappme-admin.php:487
200
  #, php-format
201
  msgid "Add unlimited numbers with %1$s or multiple contacts with %2$s"
202
  msgstr ""
203
 
204
- #: admin/class-whatsappme-admin.php:496
205
  msgid "Only display the button on mobile devices"
206
  msgstr ""
207
 
208
- #: admin/class-whatsappme-admin.php:502
209
  msgid "Left"
210
  msgstr ""
211
 
212
- #: admin/class-whatsappme-admin.php:504
213
  msgid "Right"
214
  msgstr ""
215
 
216
- #: admin/class-whatsappme-admin.php:514
217
  msgid "Select an image"
218
  msgstr ""
219
 
220
- #: admin/class-whatsappme-admin.php:515
221
  msgid "Select button image"
222
  msgstr ""
223
 
224
- #: admin/class-whatsappme-admin.php:515
225
  msgid "Use image"
226
  msgstr ""
227
 
228
- #: admin/class-whatsappme-admin.php:516
229
  msgid "Remove"
230
  msgstr ""
231
 
232
- #: admin/class-whatsappme-admin.php:517
233
  msgid "The image will alternate with WhatsApp logo"
234
  msgstr ""
235
 
236
- #: admin/class-whatsappme-admin.php:521
237
  msgid "💬 Need help?"
238
  msgstr ""
239
 
240
- #: admin/class-whatsappme-admin.php:522
241
  msgid "Short text shown next to WhatsApp button"
242
  msgstr ""
243
 
244
- #: admin/class-whatsappme-admin.php:526
245
  msgid "seconds"
246
  msgstr ""
247
 
248
- #: admin/class-whatsappme-admin.php:527
249
  msgid "Time since the page is opened until the WhatsApp button is displayed"
250
  msgstr ""
251
 
252
- #: admin/class-whatsappme-admin.php:533
253
  msgid "Open <em>WhatsApp Web</em> directly on desktop"
254
  msgstr ""
255
 
256
- #: admin/class-whatsappme-admin.php:537
257
  msgid ""
258
  "Hello 👋\n"
259
  "Can we help you?"
260
  msgstr ""
261
 
262
- #: admin/class-whatsappme-admin.php:538
263
  msgid "Define a text to encourage users to contact by WhatsApp"
264
  msgstr ""
265
 
266
- #: admin/class-whatsappme-admin.php:540
267
  #, php-format
268
  msgid "Add links, images, videos and more with %s"
269
  msgstr ""
270
 
271
- #: admin/class-whatsappme-admin.php:546
272
  msgid "Hi *{SITE}*! I need more info about {TITLE} {URL}"
273
  msgstr ""
274
 
275
- #: admin/class-whatsappme-admin.php:547
276
  msgid "Predefined text for the first message the user will send you"
277
  msgstr ""
278
 
279
- #: admin/class-whatsappme-admin.php:552
280
  msgid "Text of the start WhatsApp button on Chat Window"
281
  msgstr ""
282
 
283
- #: admin/class-whatsappme-admin.php:556
284
  msgid "seconds (0 disabled)"
285
  msgstr ""
286
 
287
- #: admin/class-whatsappme-admin.php:557
288
- msgid "Chat Window is automatically displayed after delay"
 
 
 
 
289
  msgstr ""
290
 
291
- #: admin/class-whatsappme-admin.php:563
292
  msgid ""
293
  "Display a notification balloon instead of opening the Chat Window for a "
294
  "\"less intrusive\" mode"
295
  msgstr ""
296
 
297
- #: admin/class-whatsappme-admin.php:569
298
  msgid "No"
299
  msgstr ""
300
 
301
- #: admin/class-whatsappme-admin.php:571
302
  msgid "Yes"
303
  msgstr ""
304
 
305
- #: admin/class-whatsappme-admin.php:573
306
  msgid "Auto (detects device dark mode)"
307
  msgstr ""
308
 
309
- #: admin/class-whatsappme-admin.php:639
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  msgid "Support and Help"
311
  msgstr ""
312
 
313
- #: admin/class-whatsappme-admin.php:643
314
  #, php-format
315
  msgid ""
316
- "If you need help, first review our <a href=\"%1$s\" rel=\"external\" target="
317
- "\"_blank\">documentation</a> and if you don't find a solution check the <a "
318
- "href=\"%2$s\" rel=\"external\" target=\"_blank\">free plugin support forum</"
319
- "a> or buy our <a href=\"%3$s\" rel=\"external\" target=\"_blank\">premium "
320
- "support</a>."
321
  msgstr ""
322
 
323
- #: admin/class-whatsappme-admin.php:652
324
- msgid "If you like WAme 😍"
325
  msgstr ""
326
 
327
- #: admin/class-whatsappme-admin.php:655
328
  #, php-format
329
  msgid "Please leave us a %s rating. We'll thank you."
330
  msgstr ""
331
 
332
- #: admin/class-whatsappme-admin.php:659
333
  #, php-format
334
  msgid "Subscribe to our newsletter and visit our blog at %s."
335
  msgstr ""
336
 
337
- #: admin/class-whatsappme-admin.php:663
338
  #, php-format
339
  msgid "Follow %s on twitter."
340
  msgstr ""
341
 
342
- #: admin/class-whatsappme-admin.php:670
343
  msgid "Styles and Variables"
344
  msgstr ""
345
 
346
- #: admin/class-whatsappme-admin.php:672
347
  msgid ""
348
- "You can use formatting styles like in WhatsApp: _<em>italic</em>_ "
349
- "*<strong>bold</strong>* ~<del>strikethrough</del>~."
350
  msgstr ""
351
 
352
- #: admin/class-whatsappme-admin.php:673
353
  msgid ""
354
  "You can use dynamic variables that will be replaced by the values of the "
355
  "page the user visits:"
356
  msgstr ""
357
 
358
- #: admin/class-whatsappme-admin.php:677
359
  msgid "Page Title"
360
  msgstr ""
361
 
362
- #: admin/class-whatsappme-admin.php:697
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
363
  msgid "Settings"
364
  msgstr ""
365
 
366
- #: admin/class-whatsappme-admin.php:766
367
- msgid "WAme chat"
 
 
 
 
 
 
 
 
368
  msgstr ""
369
 
370
- #: admin/class-whatsappme-admin.php:843
 
 
 
 
 
 
 
 
371
  msgid "Can use vars"
372
  msgstr ""
373
 
374
- #: admin/class-whatsappme-admin.php:845
375
  msgid "to leave it blank use"
376
  msgstr ""
377
 
378
- #: admin/class-whatsappme-admin.php:853
379
  msgid "Default visibility"
380
  msgstr ""
381
 
382
- #: admin/class-whatsappme-admin.php:912
383
  msgid "You can use vars"
384
  msgstr ""
385
 
386
- #: admin/class-whatsappme-admin.php:913
387
- msgid "Show Help"
388
- msgstr ""
389
-
390
- #: admin/class-whatsappme-wooadmin.php:128
391
  msgid "Shop"
392
  msgstr ""
393
 
394
- #: admin/class-whatsappme-wooadmin.php:129
395
  msgid "Product Page"
396
  msgstr ""
397
 
398
- #: admin/class-whatsappme-wooadmin.php:130
399
  msgid "Cart"
400
  msgstr ""
401
 
402
- #: admin/class-whatsappme-wooadmin.php:131
403
  msgid "Checkout"
404
  msgstr ""
405
 
406
- #: admin/class-whatsappme-wooadmin.php:132
407
  msgid "My Account"
408
  msgstr ""
409
 
410
- #: admin/class-whatsappme-wooadmin.php:148
411
  msgid "Call to Action for Products"
412
  msgstr ""
413
 
414
- #: admin/class-whatsappme-wooadmin.php:149
415
  msgid "Call to Action for Products on Sale"
416
  msgstr ""
417
 
418
- #: admin/class-whatsappme-wooadmin.php:150
419
  msgid "Message for Products"
420
  msgstr ""
421
 
422
- #: admin/class-whatsappme-wooadmin.php:192
423
  msgid "WooCommerce"
424
  msgstr ""
425
 
426
- #: admin/class-whatsappme-wooadmin.php:196
427
  msgid "Product Chat Window"
428
  msgstr ""
429
 
430
- #: admin/class-whatsappme-wooadmin.php:198
431
  msgid ""
432
  "You can define other different texts for the Chat Window on the product "
433
  "pages."
434
  msgstr ""
435
 
436
- #: admin/class-whatsappme-wooadmin.php:222
437
  msgid ""
438
  "This *{PRODUCT}* can be yours for only *{PRICE}*!\n"
439
  "If you have any questions, ask us."
440
  msgstr ""
441
 
442
- #: admin/class-whatsappme-wooadmin.php:224
443
  msgid "Define a text for your products to encourage customers to contact"
444
  msgstr ""
445
 
446
- #: admin/class-whatsappme-wooadmin.php:229
447
  msgid ""
448
  "Save {DISCOUNT}! This *{PRODUCT}* can be yours for only ~{REGULAR}~ *{PRICE}"
449
  "*.\n"
450
  "If you have any questions, ask us."
451
  msgstr ""
452
 
453
- #: admin/class-whatsappme-wooadmin.php:231
454
  msgid ""
455
  "Define a text for your products on sale to encourage customers to contact"
456
  msgstr ""
457
 
458
- #: admin/class-whatsappme-wooadmin.php:236
459
  msgid ""
460
  "*Hi {SITE}!*\n"
461
  "I have a question about *{PRODUCT} ({SKU})*"
462
  msgstr ""
463
 
464
- #: admin/class-whatsappme-wooadmin.php:237
465
  msgid "Predefined text for the first message the client will send you"
466
  msgstr ""
467
 
468
- #: admin/class-whatsappme-wooadmin.php:272
469
  msgid "<strong>WooCommerce</strong>, in product pages you can also use:"
470
  msgstr ""
471
 
472
- #: admin/class-whatsappme-wooadmin.php:274
473
  msgid "Product Name"
474
  msgstr ""
475
 
476
- #: admin/class-whatsappme-wooadmin.php:278
477
  msgid ""
478
  "For the <strong>Call to Action for Products on Sale</strong>, you can also "
479
  "use:"
480
  msgstr ""
481
 
482
- #. Name of the plugin
483
- msgid "VVAme chat"
 
 
484
  msgstr ""
485
 
486
  #. Description of the plugin
@@ -490,7 +591,7 @@ msgid ""
490
  msgstr ""
491
 
492
  #. URI of the plugin
493
- msgid "https://wame.chat"
494
  msgstr ""
495
 
496
  #. Author of the plugin
1
  #, fuzzy
2
  msgid ""
3
  msgstr ""
4
+ "Project-Id-Version: Join.chat\n"
5
+ "POT-Creation-Date: 2020-05-07 09:31+0000\n"
6
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
7
  "Last-Translator: Your Name <you@example.com>\n"
8
  "Language-Team: Creame <hola@crea.me>\n"
14
  "X-Textdomain-Support: yesX-Generator: Poedit 1.6.4\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e;esc_html_e;esc_html_x:1,2c;esc_html__;"
17
+ "esc_attr_e;esc_attr_x:1,2c;esc_attr__;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_x:"
18
+ "1,2c;_n:1,2;_n_noop:1,2;__ngettext:1,2;__ngettext_noop:1,2;_c,_nc:4c,1,2\n"
19
  "X-Poedit-Basepath: ..\n"
20
+ "X-Generator: Loco https://localise.biz/\n"
21
  "X-Poedit-SearchPath-0: .\n"
22
+ "Language: "
23
 
24
+ #: public/class-joinchat-public.php:103 admin/class-joinchat-admin.php:119
25
+ #: admin/class-joinchat-admin.php:569
26
+ msgid "Open chat"
27
  msgstr ""
28
 
29
+ #: public/class-joinchat-public.php:316
30
+ msgid "Close"
31
  msgstr ""
32
 
33
+ #: admin/class-joinchat-admin.php:100
34
+ msgid "General"
 
35
  msgstr ""
36
 
37
+ #: admin/class-joinchat-admin.php:101
38
+ msgid "Visibility"
39
  msgstr ""
40
 
41
+ #: admin/class-joinchat-admin.php:243 admin/class-joinchat-admin.php:901
42
+ msgid "Telephone"
43
  msgstr ""
44
 
45
+ #: admin/class-joinchat-admin.php:244 admin/class-joinchat-admin.php:909
46
+ msgid "Message"
47
  msgstr ""
48
 
49
+ #: admin/class-joinchat-admin.php:245 admin/class-joinchat-admin.php:518
50
  msgid "Position on Screen"
51
  msgstr ""
52
 
53
+ #: admin/class-joinchat-admin.php:246
54
  msgid "Image"
55
  msgstr ""
56
 
57
+ #: admin/class-joinchat-admin.php:247
58
  msgid "Tooltip"
59
  msgstr ""
60
 
61
+ #: admin/class-joinchat-admin.php:248
62
  msgid "Button Delay"
63
  msgstr ""
64
 
65
+ #: admin/class-joinchat-admin.php:249 admin/class-joinchat-admin.php:512
66
+ msgid "Mobile Only"
67
+ msgstr ""
68
+
69
+ #: admin/class-joinchat-admin.php:250 admin/class-joinchat-admin.php:549
70
  msgid "WhatsApp Web"
71
  msgstr ""
72
 
73
+ #: admin/class-joinchat-admin.php:253 admin/class-joinchat-admin.php:905
74
  msgid "Call to Action"
75
  msgstr ""
76
 
77
+ #: admin/class-joinchat-admin.php:254
78
  msgid "Start WhatsApp Button"
79
  msgstr ""
80
 
81
+ #: admin/class-joinchat-admin.php:255
82
+ msgid "Theme Color"
83
+ msgstr ""
84
+
85
+ #: admin/class-joinchat-admin.php:256 admin/class-joinchat-admin.php:594
86
+ msgid "Dark Mode"
87
+ msgstr ""
88
+
89
+ #: admin/class-joinchat-admin.php:257 admin/class-joinchat-admin.php:604
90
+ msgid "Logo"
91
+ msgstr ""
92
+
93
+ #: admin/class-joinchat-admin.php:260
94
  msgid "Chat Delay"
95
  msgstr ""
96
 
97
+ #: admin/class-joinchat-admin.php:261
98
+ msgid "Page Views"
99
  msgstr ""
100
 
101
+ #: admin/class-joinchat-admin.php:262 admin/class-joinchat-admin.php:584
102
+ msgid "Notification Balloon"
103
  msgstr ""
104
 
105
+ #: admin/class-joinchat-admin.php:271
106
  msgid "Global"
107
  msgstr ""
108
 
109
+ #: admin/class-joinchat-admin.php:276
110
  msgid "Front Page"
111
  msgstr ""
112
 
113
+ #: admin/class-joinchat-admin.php:277
114
  msgid "Blog Page"
115
  msgstr ""
116
 
117
+ #: admin/class-joinchat-admin.php:278
118
  msgid "404 Page"
119
  msgstr ""
120
 
121
+ #: admin/class-joinchat-admin.php:279
122
  msgid "Search Results"
123
  msgstr ""
124
 
125
+ #: admin/class-joinchat-admin.php:280
126
  msgid "Archives"
127
  msgstr ""
128
 
129
+ #: admin/class-joinchat-admin.php:281
130
  msgid "Date Archives"
131
  msgstr ""
132
 
133
+ #: admin/class-joinchat-admin.php:282
134
  msgid "Author Archives"
135
  msgstr ""
136
 
137
+ #: admin/class-joinchat-admin.php:283
138
  msgid "Singular"
139
  msgstr ""
140
 
141
+ #: admin/class-joinchat-admin.php:284
142
  msgid "Page"
143
  msgstr ""
144
 
145
+ #: admin/class-joinchat-admin.php:285
146
  msgid "Post"
147
  msgstr ""
148
 
149
+ #: admin/class-joinchat-admin.php:386
150
  msgid "Settings saved"
151
  msgstr ""
152
 
153
+ #: admin/class-joinchat-admin.php:433
154
  msgid "Button"
155
  msgstr ""
156
 
157
+ #: admin/class-joinchat-admin.php:434
158
  msgid ""
159
  "Set the contact number and where you want the WhatsApp button to be "
160
  "displayed."
161
  msgstr ""
162
 
163
+ #: admin/class-joinchat-admin.php:438
164
  msgid "Chat Window"
165
  msgstr ""
166
 
167
+ #: admin/class-joinchat-admin.php:440
168
  msgid ""
169
  "If you define a \"Call to Action\" a window will be displayed simulating a "
170
  "chat before launching WhatsApp."
171
  msgstr ""
172
 
173
+ #: admin/class-joinchat-admin.php:441
174
  msgid ""
175
  "You can introduce yourself, offer help or even make promotions to your users."
176
  msgstr ""
177
 
178
+ #: admin/class-joinchat-admin.php:447
179
+ msgid ""
180
+ "If it's defined a \"Call to Action\", the Chat Window can be displayed "
181
+ "automatically if conditions are met."
182
+ msgstr ""
183
+
184
+ #: admin/class-joinchat-admin.php:448 admin/class-joinchat-admin.php:982
185
+ msgid "Show Help"
186
+ msgstr ""
187
+
188
+ #: admin/class-joinchat-admin.php:453
189
+ msgid "Visibility Settings"
190
  msgstr ""
191
 
192
+ #: admin/class-joinchat-admin.php:454
193
  msgid ""
194
  "From here you can configure on which pages the WhatsApp button will be "
195
  "visible."
196
  msgstr ""
197
 
198
+ #: admin/class-joinchat-admin.php:455
199
  msgid "Restore default visibility"
200
  msgstr ""
201
 
202
+ #: admin/class-joinchat-admin.php:463
203
  msgid "Custom Post Types"
204
  msgstr ""
205
 
206
+ #: admin/class-joinchat-admin.php:489 admin/class-joinchat-admin.php:645
207
+ #: admin/class-joinchat-admin.php:918
208
  msgid "Show"
209
  msgstr ""
210
 
211
+ #: admin/class-joinchat-admin.php:491 admin/class-joinchat-admin.php:647
212
+ #: admin/class-joinchat-admin.php:920
213
  msgid "Hide"
214
  msgstr ""
215
 
216
+ #: admin/class-joinchat-admin.php:493
217
  msgid "Inherit"
218
  msgstr ""
219
 
220
+ #: admin/class-joinchat-admin.php:503
221
  msgid ""
222
+ "Contact phone number <strong>(the button will not be shown if it's empty)"
223
+ "</strong>"
224
  msgstr ""
225
 
226
+ #: admin/class-joinchat-admin.php:505
227
  #, php-format
228
  msgid "Add unlimited numbers with %1$s or multiple contacts with %2$s"
229
  msgstr ""
230
 
231
+ #: admin/class-joinchat-admin.php:514
232
  msgid "Only display the button on mobile devices"
233
  msgstr ""
234
 
235
+ #: admin/class-joinchat-admin.php:520
236
  msgid "Left"
237
  msgstr ""
238
 
239
+ #: admin/class-joinchat-admin.php:522
240
  msgid "Right"
241
  msgstr ""
242
 
243
+ #: admin/class-joinchat-admin.php:532
244
  msgid "Select an image"
245
  msgstr ""
246
 
247
+ #: admin/class-joinchat-admin.php:533
248
  msgid "Select button image"
249
  msgstr ""
250
 
251
+ #: admin/class-joinchat-admin.php:533
252
  msgid "Use image"
253
  msgstr ""
254
 
255
+ #: admin/class-joinchat-admin.php:534
256
  msgid "Remove"
257
  msgstr ""
258
 
259
+ #: admin/class-joinchat-admin.php:535
260
  msgid "The image will alternate with WhatsApp logo"
261
  msgstr ""
262
 
263
+ #: admin/class-joinchat-admin.php:539
264
  msgid "💬 Need help?"
265
  msgstr ""
266
 
267
+ #: admin/class-joinchat-admin.php:540
268
  msgid "Short text shown next to WhatsApp button"
269
  msgstr ""
270
 
271
+ #: admin/class-joinchat-admin.php:544
272
  msgid "seconds"
273
  msgstr ""
274
 
275
+ #: admin/class-joinchat-admin.php:545
276
  msgid "Time since the page is opened until the WhatsApp button is displayed"
277
  msgstr ""
278
 
279
+ #: admin/class-joinchat-admin.php:551
280
  msgid "Open <em>WhatsApp Web</em> directly on desktop"
281
  msgstr ""
282
 
283
+ #: admin/class-joinchat-admin.php:555
284
  msgid ""
285
  "Hello 👋\n"
286
  "Can we help you?"
287
  msgstr ""
288
 
289
+ #: admin/class-joinchat-admin.php:556
290
  msgid "Define a text to encourage users to contact by WhatsApp"
291
  msgstr ""
292
 
293
+ #: admin/class-joinchat-admin.php:558
294
  #, php-format
295
  msgid "Add links, images, videos and more with %s"
296
  msgstr ""
297
 
298
+ #: admin/class-joinchat-admin.php:564
299
  msgid "Hi *{SITE}*! I need more info about {TITLE} {URL}"
300
  msgstr ""
301
 
302
+ #: admin/class-joinchat-admin.php:565
303
  msgid "Predefined text for the first message the user will send you"
304
  msgstr ""
305
 
306
+ #: admin/class-joinchat-admin.php:570
307
  msgid "Text of the start WhatsApp button on Chat Window"
308
  msgstr ""
309
 
310
+ #: admin/class-joinchat-admin.php:574
311
  msgid "seconds (0 disabled)"
312
  msgstr ""
313
 
314
+ #: admin/class-joinchat-admin.php:575
315
+ msgid "Chat Window auto displays after delay"
316
+ msgstr ""
317
+
318
+ #: admin/class-joinchat-admin.php:580
319
+ msgid "Chat Window auto displays from this number of page views"
320
  msgstr ""
321
 
322
+ #: admin/class-joinchat-admin.php:586
323
  msgid ""
324
  "Display a notification balloon instead of opening the Chat Window for a "
325
  "\"less intrusive\" mode"
326
  msgstr ""
327
 
328
+ #: admin/class-joinchat-admin.php:596
329
  msgid "No"
330
  msgstr ""
331
 
332
+ #: admin/class-joinchat-admin.php:598
333
  msgid "Yes"
334
  msgstr ""
335
 
336
+ #: admin/class-joinchat-admin.php:600
337
  msgid "Auto (detects device dark mode)"
338
  msgstr ""
339
 
340
+ #: admin/class-joinchat-admin.php:606
341
+ msgid "Remove \"Powered by Join.chat\" link"
342
+ msgstr ""
343
+
344
+ #: admin/class-joinchat-admin.php:608
345
+ #, php-format
346
+ msgid "Included with all our %1$sadd-ons%2$s"
347
+ msgstr ""
348
+
349
+ #: admin/class-joinchat-admin.php:673 admin/class-joinchat-admin.php:766
350
+ msgctxt "url lang slug (only avaible for spanish \"es\")"
351
+ msgid "en"
352
+ msgstr ""
353
+
354
+ #: admin/class-joinchat-admin.php:678
355
  msgid "Support and Help"
356
  msgstr ""
357
 
358
+ #: admin/class-joinchat-admin.php:681
359
  #, php-format
360
  msgid ""
361
+ "If you need help, first review our <a href=\"%1$s\" target=\"_blank\">"
362
+ "documentation</a> and if you don't find a solution check the <a "
363
+ "href=\"%2$s\" target=\"_blank\">free plugin support forum</a> or buy our <a "
364
+ "href=\"%3$s\" target=\"_blank\">premium support</a>."
 
365
  msgstr ""
366
 
367
+ #: admin/class-joinchat-admin.php:686
368
+ msgid "If you like Join.chat 😍"
369
  msgstr ""
370
 
371
+ #: admin/class-joinchat-admin.php:689
372
  #, php-format
373
  msgid "Please leave us a %s rating. We'll thank you."
374
  msgstr ""
375
 
376
+ #: admin/class-joinchat-admin.php:693
377
  #, php-format
378
  msgid "Subscribe to our newsletter and visit our blog at %s."
379
  msgstr ""
380
 
381
+ #: admin/class-joinchat-admin.php:697
382
  #, php-format
383
  msgid "Follow %s on twitter."
384
  msgstr ""
385
 
386
+ #: admin/class-joinchat-admin.php:704
387
  msgid "Styles and Variables"
388
  msgstr ""
389
 
390
+ #: admin/class-joinchat-admin.php:706
391
  msgid ""
392
+ "You can use formatting styles like in WhatsApp: _<em>italic</em>_ *<strong>"
393
+ "bold</strong>* ~<del>strikethrough</del>~."
394
  msgstr ""
395
 
396
+ #: admin/class-joinchat-admin.php:707
397
  msgid ""
398
  "You can use dynamic variables that will be replaced by the values of the "
399
  "page the user visits:"
400
  msgstr ""
401
 
402
+ #: admin/class-joinchat-admin.php:711
403
  msgid "Page Title"
404
  msgstr ""
405
 
406
+ #: admin/class-joinchat-admin.php:716
407
+ msgid "Triggers"
408
+ msgstr ""
409
+
410
+ #: admin/class-joinchat-admin.php:718
411
+ msgid ""
412
+ "Chat Window with a Call to Action (CTA) can be displayed automatically after "
413
+ "a defined delay time and from a number of page views."
414
+ msgstr ""
415
+
416
+ #: admin/class-joinchat-admin.php:719
417
+ msgid ""
418
+ "When the user close Chat Window or open WhatsApp, that CTA will not "
419
+ "automatically show again."
420
+ msgstr ""
421
+
422
+ #: admin/class-joinchat-admin.php:720
423
+ msgid ""
424
+ "You can also interact with Join.chat in your pages adding some CSS classes "
425
+ "to your HTML:"
426
+ msgstr ""
427
+
428
+ #: admin/class-joinchat-admin.php:722
429
+ msgid "to show Chat Window or open WhatsApp on click."
430
+ msgstr ""
431
+
432
+ #: admin/class-joinchat-admin.php:723
433
+ msgid "to hide Chat Window on click."
434
+ msgstr ""
435
+
436
+ #: admin/class-joinchat-admin.php:724
437
+ msgid ""
438
+ "To show Chat Window when an HTML element appears on screen when user scrolls:"
439
+ msgstr ""
440
+
441
+ #: admin/class-joinchat-admin.php:726
442
+ msgid "only show if it's an not seen CTA."
443
+ msgstr ""
444
+
445
+ #: admin/class-joinchat-admin.php:727
446
+ msgid "to show allways."
447
+ msgstr ""
448
+
449
+ #: admin/class-joinchat-admin.php:748
450
  msgid "Settings"
451
  msgstr ""
452
 
453
+ #: admin/class-joinchat-admin.php:768
454
+ msgid "Documentation"
455
+ msgstr ""
456
+
457
+ #: admin/class-joinchat-admin.php:769
458
+ msgid "Add-ons"
459
+ msgstr ""
460
+
461
+ #: admin/class-joinchat-admin.php:770
462
+ msgid "Support"
463
  msgstr ""
464
 
465
+ #: admin/class-joinchat-admin.php:801
466
+ msgid "Join.chat Settings"
467
+ msgstr ""
468
+
469
+ #: admin/class-joinchat-admin.php:842
470
+ msgid "Join.chat"
471
+ msgstr ""
472
+
473
+ #: admin/class-joinchat-admin.php:912
474
  msgid "Can use vars"
475
  msgstr ""
476
 
477
+ #: admin/class-joinchat-admin.php:914
478
  msgid "to leave it blank use"
479
  msgstr ""
480
 
481
+ #: admin/class-joinchat-admin.php:922
482
  msgid "Default visibility"
483
  msgstr ""
484
 
485
+ #: admin/class-joinchat-admin.php:981
486
  msgid "You can use vars"
487
  msgstr ""
488
 
489
+ #: admin/class-joinchat-wooadmin.php:128
 
 
 
 
490
  msgid "Shop"
491
  msgstr ""
492
 
493
+ #: admin/class-joinchat-wooadmin.php:129
494
  msgid "Product Page"
495
  msgstr ""
496
 
497
+ #: admin/class-joinchat-wooadmin.php:130
498
  msgid "Cart"
499
  msgstr ""
500
 
501
+ #: admin/class-joinchat-wooadmin.php:131
502
  msgid "Checkout"
503
  msgstr ""
504
 
505
+ #: admin/class-joinchat-wooadmin.php:132
506
  msgid "My Account"
507
  msgstr ""
508
 
509
+ #: admin/class-joinchat-wooadmin.php:148
510
  msgid "Call to Action for Products"
511
  msgstr ""
512
 
513
+ #: admin/class-joinchat-wooadmin.php:149
514
  msgid "Call to Action for Products on Sale"
515
  msgstr ""
516
 
517
+ #: admin/class-joinchat-wooadmin.php:150
518
  msgid "Message for Products"
519
  msgstr ""
520
 
521
+ #: admin/class-joinchat-wooadmin.php:192
522
  msgid "WooCommerce"
523
  msgstr ""
524
 
525
+ #: admin/class-joinchat-wooadmin.php:196
526
  msgid "Product Chat Window"
527
  msgstr ""
528
 
529
+ #: admin/class-joinchat-wooadmin.php:198
530
  msgid ""
531
  "You can define other different texts for the Chat Window on the product "
532
  "pages."
533
  msgstr ""
534
 
535
+ #: admin/class-joinchat-wooadmin.php:222
536
  msgid ""
537
  "This *{PRODUCT}* can be yours for only *{PRICE}*!\n"
538
  "If you have any questions, ask us."
539
  msgstr ""
540
 
541
+ #: admin/class-joinchat-wooadmin.php:224
542
  msgid "Define a text for your products to encourage customers to contact"
543
  msgstr ""
544
 
545
+ #: admin/class-joinchat-wooadmin.php:229
546
  msgid ""
547
  "Save {DISCOUNT}! This *{PRODUCT}* can be yours for only ~{REGULAR}~ *{PRICE}"
548
  "*.\n"
549
  "If you have any questions, ask us."
550
  msgstr ""
551
 
552
+ #: admin/class-joinchat-wooadmin.php:231
553
  msgid ""
554
  "Define a text for your products on sale to encourage customers to contact"
555
  msgstr ""
556
 
557
+ #: admin/class-joinchat-wooadmin.php:236
558
  msgid ""
559
  "*Hi {SITE}!*\n"
560
  "I have a question about *{PRODUCT} ({SKU})*"
561
  msgstr ""
562
 
563
+ #: admin/class-joinchat-wooadmin.php:237
564
  msgid "Predefined text for the first message the client will send you"
565
  msgstr ""
566
 
567
+ #: admin/class-joinchat-wooadmin.php:272
568
  msgid "<strong>WooCommerce</strong>, in product pages you can also use:"
569
  msgstr ""
570
 
571
+ #: admin/class-joinchat-wooadmin.php:274
572
  msgid "Product Name"
573
  msgstr ""
574
 
575
+ #: admin/class-joinchat-wooadmin.php:278
576
  msgid ""
577
  "For the <strong>Call to Action for Products on Sale</strong>, you can also "
578
  "use:"
579
  msgstr ""
580
 
581
+ #: includes/class-joinchat.php:300
582
+ msgid ""
583
+ "<strong>WAme</strong> now is <strong>Join.chat</strong>. Please, deactivate "
584
+ "and re-activate plugin to migrate settings."
585
  msgstr ""
586
 
587
  #. Description of the plugin
591
  msgstr ""
592
 
593
  #. URI of the plugin
594
+ msgid "https://join.chat"
595
  msgstr ""
596
 
597
  #. Author of the plugin
public/class-joinchat-public.php ADDED
@@ -0,0 +1,431 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * The public-facing functionality of the plugin.
5
+ *
6
+ * Defines the plugin name, version, and two examples hooks for how to
7
+ * enqueue the public-facing stylesheet and JavaScript.
8
+ *
9
+ * @since 1.0.0
10
+ * @since 3.0.0 Added $show property and more hooks
11
+ * @package JoinChat
12
+ * @subpackage JoinChat/public
13
+ * @author Creame <hola@crea.me>
14
+ */
15
+ class JoinChatPublic {
16
+
17
+ /**
18
+ * The ID of this plugin.
19
+ *
20
+ * @since 1.0.0
21
+ * @access private
22
+ * @var string $plugin_name The ID of this plugin.
23
+ */
24
+ private $plugin_name;
25
+
26
+ /**
27
+ * The version of this plugin.
28
+ *
29
+ * @since 1.0.0
30
+ * @access private
31
+ * @var string $version The current version of this plugin.
32
+ */
33
+ private $version;
34
+
35
+ /**
36
+ * The setings of this plugin.
37
+ *
38
+ * @since 1.0.0
39
+ * @access private
40
+ * @var array $settings The current settings of this plugin.
41
+ */
42
+ private $settings;
43
+
44
+ /**
45
+ * Show WhatsApp button in front.
46
+ *
47
+ * @since 3.0.0
48
+ * @access private
49
+ * @var bool $show Show button on front.
50
+ */
51
+ private $show;
52
+
53
+ /**
54
+ * Initialize the class and set its properties.
55
+ *
56
+ * @since 1.0.0
57
+ * @since 2.0.0 Added visibility setting
58
+ * @since 2.1.0 Added message_badge
59
+ * @since 2.3.0 Added button_delay and whatsapp_web settings, message_delay in seconds
60
+ * @param string $plugin_name The name of the plugin.
61
+ * @param string $version The version of this plugin.
62
+ * @return void
63
+ */
64
+ public function __construct( $plugin_name, $version ) {
65
+
66
+ $this->plugin_name = $plugin_name;
67
+ $this->version = $version;
68
+
69
+ // Updated in get_settings() at 'wp' hook
70
+ $this->show = false;
71
+ $this->settings = array();
72
+
73
+ }
74
+
75
+ /**
76
+ * Get global settings and current post settings and prepare
77
+ *
78
+ * @since 1.0.0
79
+ * @since 2.0.0 Check visibility
80
+ * @since 2.2.0 Post settings can also change "telephone". Added 'whastapp_web' setting
81
+ * @since 2.3.0 Fix global $post incorrect post id on loops. WPML integration.
82
+ * @since 3.0.0 New filters.
83
+ * @return void
84
+ */
85
+ public function get_settings() {
86
+
87
+ // If use "global $post;" take first post in loop on archive pages
88
+ $obj = get_queried_object();
89
+
90
+ $default_settings = array_merge(
91
+ array(
92
+ 'telephone' => '',
93
+ 'mobile_only' => 'no',
94
+ 'button_image' => '',
95
+ 'button_tip' => '',
96
+ 'button_delay' => 3,
97
+ 'whatsapp_web' => 'no',
98
+ 'message_text' => '',
99
+ 'message_views' => 2,
100
+ 'message_delay' => 10,
101
+ 'message_badge' => 'no',
102
+ 'message_send' => '',
103
+ 'message_start' => __( 'Open chat', 'creame-whatsapp-me' ),
104
+ 'position' => 'right',
105
+ 'visibility' => array( 'all' => 'yes' ),
106
+ 'color' => '#25d366',
107
+ 'dark_mode' => 'no',
108
+ ),
109
+ apply_filters( 'joinchat_extra_settings', array() )
110
+ );
111
+
112
+ $settings = $default_settings;
113
+ $show = false;
114
+
115
+ $site_settings = get_option( 'joinchat' );
116
+
117
+ if ( is_array( $site_settings ) ) {
118
+ // Clean unused saved settings
119
+ $settings = array_intersect_key( $site_settings, $default_settings );
120
+ // Merge defaults with saved settings
121
+ $settings = array_merge( $default_settings, $settings );
122
+ // miliseconds (<v2.3) to seconds
123
+ if ( $settings['message_delay'] > 120 ) {
124
+ $settings['message_delay'] = round( $settings['message_delay'] / 1000 );
125
+ }
126
+
127
+ // Load WPML/Polylang translated strings
128
+ $settings_i18n = JoinChatUtil::settings_i18n();
129
+
130
+ foreach ( $settings_i18n as $key => $label ) {
131
+ $settings[ $key ] = $settings[ $key ] ? apply_filters( 'wpml_translate_single_string', $settings[ $key ], 'Join.chat', $label ) : '';
132
+ }
133
+
134
+ // Filter for site settings (can be overriden by post settings)
135
+ $settings = apply_filters( 'joinchat_get_settings_site', $settings, $obj );
136
+
137
+ // Post custom settings override site settings
138
+ $post_settings = is_a( $obj, 'WP_Post' ) ? get_post_meta( $obj->ID, '_joinchat', true ) : '';
139
+
140
+ if ( is_array( $post_settings ) ) {
141
+ $settings = array_merge( $settings, $post_settings );
142
+
143
+ // Allow override general settings with empty string with "{}"
144
+ $settings['message_text'] = preg_match( '/^\{\s*\}$/', $settings['message_text'] ) ? '' : $settings['message_text'];
145
+ $settings['message_send'] = preg_match( '/^\{\s*\}$/', $settings['message_send'] ) ? '' : $settings['message_send'];
146
+ }
147
+
148
+ // Prepare settings
149
+ $settings['telephone'] = preg_replace( '/^0+|\D/', '', $settings['telephone'] );
150
+ $settings['mobile_only'] = 'yes' == $settings['mobile_only'];
151
+ $settings['whatsapp_web'] = 'yes' == $settings['whatsapp_web'];
152
+ $settings['message_badge'] = 'yes' == $settings['message_badge'] && '' != $settings['message_text'];
153
+ $settings['message_send'] = JoinChatUtil::replace_variables( $settings['message_send'] );
154
+ // Set true to link http://web.whatsapp.com instead http://api.whatsapp.com
155
+ $settings['whatsapp_web'] = apply_filters( 'joinchat_whatsapp_web', 'yes' == $settings['whatsapp_web'] );
156
+
157
+ // Only show if there is a phone number
158
+ if ( '' != $settings['telephone'] ) {
159
+ if ( isset( $settings['view'] ) && 'yes' == $settings['view'] ) {
160
+ $show = true;
161
+ } elseif ( isset( $settings['view'] ) && 'no' == $settings['view'] ) {
162
+ $show = false;
163
+ } else {
164
+ $show = $this->check_visibility( $settings['visibility'] );
165
+ }
166
+ }
167
+ // Unset post 'view' setting
168
+ unset( $settings['view'] );
169
+ }
170
+
171
+ // Apply filters to final settings after site and post settings
172
+ $this->settings = apply_filters( 'joinchat_get_settings', $settings, $obj );
173
+ // Apply filters to alter 'show' value
174
+ $this->show = apply_filters( 'joinchat_show', $show, $this->settings, $obj );
175
+
176
+ // Set a simple CTA hash, empty '' if no CTA (for javascript store viewed CTAs)
177
+ $this->settings['message_hash'] = ltrim( hash( 'crc32', $this->settings['message_text'] ), '0' );
178
+
179
+ // Ensure not show if not phone
180
+ if ( '' == $this->settings['telephone'] ) {
181
+ $this->show = false;
182
+ }
183
+ }
184
+
185
+ /**
186
+ * Enqueue the stylesheets for the public-facing side of the site.
187
+ *
188
+ * @since 1.0.0
189
+ * @since 2.2.2 minified
190
+ * @return void
191
+ */
192
+ public function enqueue_styles() {
193
+
194
+ if ( $this->show ) {
195
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
196
+ $color = $this->settings['color'];
197
+ list($r, $g, $b) = sscanf( $color, '#%02x%02x%02x' );
198
+
199
+ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . "css/{$this->plugin_name}{$min}.css", array(), $this->version, 'all' );
200
+ wp_add_inline_style( $this->plugin_name, apply_filters( 'joinchat_inline_style', ".joinchat{ --red:$r; --green:$g; --blue:$b; }", $color ) );
201
+ }
202
+
203
+ }
204
+
205
+ /**
206
+ * Enqueue the JavaScript for the public-facing side of the site.
207
+ *
208
+ * @since 1.0.0
209
+ * @since 2.2.2 minified
210
+ * @return void
211
+ */
212
+ public function enqueue_scripts() {
213
+
214
+ if ( $this->show ) {
215
+ $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
216
+ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . "js/{$this->plugin_name}{$min}.js", array( 'jquery' ), $this->version, true );
217
+ }
218
+
219
+ }
220
+
221
+ /**
222
+ * Outputs WhatsApp button html and his settings on footer
223
+ *
224
+ * @since 1.0.0
225
+ * @since 3.2.0 Capture and filter output
226
+ * @return void
227
+ */
228
+ public function footer_html() {
229
+ global $wp;
230
+
231
+ if ( $this->show ) {
232
+
233
+ // Clean unnecessary settings on front
234
+ $excluded_fields = apply_filters(
235
+ 'joinchat_excluded_fields',
236
+ array(
237
+ 'visibility',
238
+ 'position',
239
+ 'button_tip',
240
+ 'button_image',
241
+ 'message_start',
242
+ 'message_text',
243
+ 'color',
244
+ 'dark_mode',
245
+ )
246
+ );
247
+
248
+ $data = array_diff_key( $this->settings, array_flip( $excluded_fields ) );
249
+
250
+ $copy = apply_filters( 'joinchat_copy', 'Powered by' );
251
+
252
+ $powered_url = urlencode( home_url( $wp->request ) );
253
+ $powered_site = urlencode( get_bloginfo( 'name' ) );
254
+ $powered_link = "https://join.chat/powered/?site={$powered_site}&url={$powered_url}";
255
+
256
+ // Set custom img tag and bypass default image logic
257
+ $image = apply_filters( 'joinchat_image', null );
258
+
259
+ if ( is_null( $image ) && $this->settings['button_image'] ) {
260
+ $img_path = get_attached_file( $this->settings['button_image'] );
261
+
262
+ if ( apply_filters( 'joinchat_image_original', JoinChatUtil::is_animated_gif( $img_path ) ) ) {
263
+ $image = '<img src="' . wp_get_attachment_url( $this->settings['button_image'] ) . '" alt="">';
264
+ } elseif ( is_array( JoinChatUtil::thumb( $img_path, 58, 58 ) ) ) {
265
+ $thumb = JoinChatUtil::thumb( $img_path, 58, 58 );
266
+ $thumb2 = JoinChatUtil::thumb( $img_path, 116, 116 );
267
+ $thumb3 = JoinChatUtil::thumb( $img_path, 174, 174 );
268
+ $image = "<img src=\"{$thumb['url']}\" srcset=\"{$thumb2['url']} 2x, {$thumb3['url']} 3x\" alt=\"\">";
269
+ }
270
+ }
271
+
272
+ $joinchat_classes = 'joinchat--' . $this->settings['position'];
273
+ if ( 'no' !== $this->settings['dark_mode'] ) {
274
+ $joinchat_classes .= 'auto' === $this->settings['dark_mode'] ? ' joinchat--dark-auto' : ' joinchat--dark';
275
+ }
276
+
277
+ $box_content = '';
278
+ if ( $this->settings['message_text'] ) {
279
+ $box_content = '<div class="joinchat__message">' . JoinChatUtil::formated_message( $this->settings['message_text'] ) . '</div>';
280
+ }
281
+ $box_content = apply_filters( 'joinchat_content', $box_content, $this->settings );
282
+
283
+ ob_start();
284
+ ?>
285
+ <div class="joinchat <?php echo apply_filters( 'joinchat_classes', $joinchat_classes ); ?>" data-settings="<?php echo esc_attr( json_encode( $data ) ); ?>">
286
+ <div class="joinchat__button">
287
+ <div class="joinchat__button__open"></div>
288
+ <?php if ( $image ) : ?>
289
+ <div class="joinchat__button__image"><?php echo $image; ?></div>
290
+ <?php endif; ?>
291
+ <?php if ( $this->settings['message_start'] ) : ?>
292
+ <div class="joinchat__button__sendtext"><?php echo $this->settings['message_start']; ?></div>
293
+ <?php endif; ?>
294
+ <?php if ( $this->settings['message_text'] ) : ?>
295
+ <svg class="joinchat__button__send" viewbox="0 0 400 400" stroke-linecap="round" stroke-width="33">
296
+ <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"/>
297
+ <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"/>
298
+ </svg>
299
+ <?php endif; ?>
300
+ <?php if ( $this->settings['message_badge'] ) : ?>
301
+ <div class="joinchat__badge">1</div>
302
+ <?php endif; ?>
303
+ <?php if ( $this->settings['button_tip'] ) : ?>
304
+ <div class="joinchat__tooltip"><div><?php echo $this->settings['button_tip']; ?></div></div>
305
+ <?php endif; ?>
306
+ </div>
307
+ <?php if ( $box_content ) : ?>
308
+ <div class="joinchat__box">
309
+ <div class="joinchat__header">
310
+ <?php if ( $copy ) : ?>
311
+ <a class="joinchat__copy" href="<?php echo $powered_link; ?>" rel="nofollow noopener" target="_blank">
312
+ <?php echo $copy; ?> <svg viewbox="0 0 1424 318"><title>Join.chat</title><path d="M170.93 7c1.395 0 3.255.583 5.58 1.75 2.325 1.165 3.487 2.331 3.487 3.497l-.013.532-.03.662c-.042.827-.115 2.012-.22 3.554l-.574 8.06c-.418 6.108-.837 14.2-1.255 24.275-.415 9.985-.645 20.527-.69 31.626l.002 31.293.027 5.908c.027 4.503.072 9.813.136 15.928l.265 23.666c.127 12.388.19 22.877.19 31.466 0 21.982-5.813 42.824-17.44 62.525-11.628 19.701-27.876 35.67-48.743 47.905S67.997 318 43.289 318c-13.912 0-24.605-2.748-32.08-8.243-7.475-5.496-11.212-13.22-11.212-23.175 0-7.258 2.336-13.48 7.008-18.664 4.671-5.185 10.952-7.777 18.842-7.777 6.852 0 13.081 1.97 18.688 5.91 5.412 3.805 9.664 7.947 12.754 12.428l.326.482a96.787 96.787 0 0010.278 12.91c3.738 3.94 7.164 5.91 10.278 5.91 3.945 0 7.164-2.023 9.655-6.066 2.449-3.975 4.496-11.704 6.143-23.19l.086-.607c1.634-11.63 2.465-27.476 2.491-47.537v-116.21l.103-.075.001-27.831c0-1.537-.206-2.557-.618-3.06l-.08-.089c-.413-.414-1.377-.829-2.892-1.243l-.595-.156-11.856-2.099c-1.86-.233-2.79-2.449-2.79-6.647 0-3.731.93-5.947 2.79-6.647 26.968-10.495 56.145-26.587 87.531-48.277 1.163-.7 2.093-1.049 2.79-1.049zm1205 43c3.926 0 5.992.835 6.199 2.505 1.24 9.605 2.066 21.819 2.48 36.642h.488c3.02-.005 8.54-.058 16.557-.156 7.836-.097 13.55-.149 17.144-.156h.832c1.653 0 2.79.678 3.41 2.035s.929 4.019.929 7.986-.31 6.524-.93 7.673c-.62 1.148-1.756 1.722-3.409 1.722h-1.912c-15.123-.008-26.056-.113-32.8-.313v62.01c0 13.78 1.705 23.279 5.114 28.499 3.41 5.22 8.73 7.829 15.961 7.829 1.447 0 2.996-.313 4.65-.94 1.652-.626 2.685-.94 3.098-.94 1.86 0 3.72.993 5.58 2.976 1.859 1.984 2.479 3.706 1.859 5.168-4.133 10.648-11.468 19.886-22.005 27.716-10.538 7.83-22.625 11.744-36.262 11.744-16.116 0-28.41-4.854-36.881-14.563-3.314-3.798-5.98-8.164-7.998-13.097l-.422.42-.568.56c-17.407 17.12-32.986 25.68-46.738 25.68-18.674 0-31.745-13.069-39.215-39.206-4.98 12.348-11.982 21.97-21.007 28.864-9.026 6.895-19.244 10.342-30.656 10.342-11.826 0-21.526-4.168-29.1-12.503-7.572-8.335-11.359-18.574-11.359-30.717 0-9.467 1.66-17.133 4.98-22.999 3.32-5.865 9.025-10.959 17.117-15.281 13.14-6.924 35.318-13.848 66.536-20.771l1-.221v-10.617c-.072-10.763-1.731-19.264-4.977-25.503-3.32-6.38-7.884-9.57-13.694-9.57-2.82 0-4.466 1.551-4.94 4.653l-.04.287-2.178 14.818-.088.638c-1.512 10.59-5.217 18.557-11.116 23.904-6.017 5.454-13.486 8.181-22.408 8.181-5.187 0-9.544-1.543-13.072-4.63-3.527-3.088-5.29-7.307-5.29-12.658 0-10.702 8.766-21.712 26.298-33.032S1214.6 88 1237.007 88c41.082 0 61.829 15.23 62.24 45.688l.01.928v57.47c.019 4.635.226 8.426.622 11.372.415 3.087.986 5.454 1.712 7.1.726 1.647 1.66 2.676 2.8 3.088 1.142.411 2.335.411 3.58 0 1.245-.412 2.8-1.235 4.668-2.47.682-.507 1.224-.806 1.625-.896-.622-4.09-.932-8.452-.932-13.086v-85.811c0-1.462-.207-2.401-.62-2.819-.413-.417-1.446-.835-3.1-1.252l-11.157-1.566c-1.653-.209-2.479-2.297-2.479-6.264 0-4.384.826-6.681 2.48-6.89 15.909-3.758 29.03-8.664 39.36-14.72 10.331-6.054 20.662-14.51 30.993-25.367 1.653-1.67 4.029-2.505 7.128-2.505zM290.13 88c27.5 0 49.688 7.203 66.563 21.61 16.875 14.406 25.312 33.958 25.312 58.655 0 25.726-9.01 45.947-27.031 60.662S313.255 251 283.88 251c-27.5 0-49.688-7.203-66.563-21.61-16.874-14.406-25.312-33.958-25.312-58.655 0-25.726 9.01-45.947 27.031-60.662S260.755 88 290.13 88zm588.15 0c18.56 0 33.407 4.116 44.542 12.348 11.136 8.233 16.704 17.803 16.704 28.71 0 6.175-2.166 11.269-6.496 15.282s-9.898 6.02-16.703 6.02c-12.992 0-24.024-8.541-33.098-25.623-5.568-10.496-9.847-17.34-12.837-20.53s-6.238-4.785-9.743-4.785c-7.424 0-11.136 5.454-11.136 16.362 0 13.583 3.093 28.247 9.28 43.992 6.186 15.744 13.92 28.247 23.199 37.508 8.042 8.027 16.497 12.04 25.364 12.04 7.63 0 15.363-3.293 23.2-9.879 1.443-1.029 3.505-.617 6.186 1.235 2.68 1.852 3.712 3.602 3.093 5.248-5.155 12.349-14.744 22.948-28.767 31.797-14.022 8.85-30.21 13.275-48.563 13.275-23.303 0-42.377-7.41-57.225-22.227-14.847-14.818-22.271-34.164-22.271-58.038 0-24.491 8.97-44.403 26.911-59.736C827.86 95.666 850.647 88 878.28 88zm-402.36-2.78c1.228 0 2.864.52 4.91 1.56 2.044 1.039 3.067 2.079 3.067 3.119 0 .832-.205 4.055-.614 9.67-.409 5.616-.818 13.415-1.227 23.398-.385 9.395-.589 19.344-.611 29.845l-.002 1.975v74.247l.004.246c.076 2.265 1.221 3.624 3.436 4.077l.241.045 10.43 2.184.135.022c.142.028.277.074.405.135.125-.045.257-.076.394-.093l10.534-2.174.244-.045c2.316-.467 3.474-1.9 3.474-4.301v-81.921c-.024-1.298-.23-2.14-.617-2.529-.414-.414-1.446-.828-3.099-1.242l-10.534-1.863-.148-.023c-1.554-.305-2.331-2.263-2.331-5.876 0-3.312.826-5.278 2.479-5.899 21.069-8.28 45.856-22.561 74.36-42.846.827-.62 1.653-.931 2.48-.931 1.239 0 2.891.517 4.957 1.552s3.098 2.07 3.098 3.105v.07c-.013.815-.22 4.828-.62 12.039a392.8 392.8 0 00-.619 21.733c4.544-10.142 11.722-18.784 21.534-25.925 9.811-7.14 21.12-10.711 33.927-10.711 16.318 0 29.177 4.657 38.575 13.971 9.399 9.315 14.098 22.355 14.098 39.12v88.42c.08 2.335 1.318 3.702 3.714 4.102l10.534 2.174.136.022c1.562.313 2.343 2.582 2.343 6.808 0 4.347-.826 6.52-2.479 6.52h-.08c-1.25-.017-7.576-.38-18.975-1.087-11.67-.724-21.947-1.086-30.829-1.086s-18.848.362-29.9 1.086c-11.05.725-17.092 1.087-18.125 1.087-1.652 0-2.478-2.173-2.478-6.52 0-3.933.826-6.21 2.478-6.83l8.366-2.174.303-.078c1.476-.394 2.408-.834 2.795-1.319.413-.517.62-1.5.62-2.95v-61.884c-.066-14.105-2.079-24.007-6.04-29.706-4.028-5.796-11.206-8.693-21.534-8.693-3.098 0-5.37.31-6.816.931v99.636c.025 1.294.231 2.183.617 2.666.413.518 1.446.983 3.098 1.397l8.366 2.174.152.063c1.551.701 2.326 2.957 2.326 6.767 0 4.347-.826 6.52-2.478 6.52h-.085c-1.243-.018-7.205-.38-17.886-1.087-10.948-.724-20.862-1.086-29.744-1.086s-19.21.362-30.984 1.086c-11.774.725-18.177 1.087-19.21 1.087-.165 0-.32-.022-.469-.065-.107.032-.22.052-.337.06l-.127.005h-.08c-1.238-.017-7.5-.38-18.788-1.092-11.555-.728-21.73-1.092-30.525-1.092-8.794 0-19.02.364-30.678 1.092S397.483 249 396.461 249c-1.637 0-2.455-2.184-2.455-6.551 0-4.246.773-6.527 2.32-6.841l.134-.022 10.431-2.184.241-.045c2.215-.453 3.36-1.812 3.436-4.077l.004-.246v-82.046l-.002-.267c-.024-1.304-.228-2.15-.611-2.54-.384-.39-1.306-.78-2.768-1.17l-.3-.079-10.43-1.871-.147-.024c-1.539-.306-2.308-2.273-2.308-5.904 0-3.327.818-5.303 2.454-5.927 23.725-9.359 49.393-23.71 77.003-43.05 1.023-.625 1.84-.937 2.455-.937zM1014.74 10c1.24 0 2.892.513 4.957 1.538 2.066 1.025 3.099 2.05 3.099 3.076 0 .82-.207 3.999-.62 9.535-.413 5.537-.826 13.227-1.24 23.07-.412 9.843-.619 20.3-.619 31.374v42.756l.391-.674c5.136-8.727 12.235-16.09 21.298-22.088 9.295-6.152 19.83-9.228 31.603-9.228 16.318 0 29.177 4.614 38.575 13.842 9.399 9.228 14.098 22.146 14.098 38.757v87.599c.08 2.312 1.318 3.667 3.714 4.063l10.534 2.153.136.022c1.562.31 2.343 2.559 2.343 6.746 0 4.306-.826 6.459-2.479 6.459h-.08c-1.25-.017-7.576-.376-18.975-1.077-11.67-.717-21.947-1.076-30.829-1.076s-18.848.359-29.9 1.076c-11.05.718-17.092 1.077-18.125 1.077-1.652 0-2.478-2.153-2.478-6.46 0-3.896.826-6.151 2.478-6.767l8.366-2.153.303-.077c1.476-.39 2.408-.826 2.795-1.307.413-.512.62-1.487.62-2.922v-61.31c-.066-13.974-2.08-23.784-6.04-29.43-4.028-5.742-11.206-8.613-21.534-8.613-3.098 0-5.37.308-6.816.923v98.711c.025 1.282.231 2.163.617 2.641.413.513 1.446.974 3.098 1.384l8.366 2.153.152.063c1.551.695 2.326 2.93 2.326 6.705 0 4.306-.826 6.459-2.478 6.459h-.085c-1.243-.018-7.205-.376-17.886-1.077-10.948-.717-20.862-1.076-29.744-1.076s-19.21.359-30.984 1.076c-11.774.718-18.177 1.077-19.21 1.077-1.653 0-2.479-2.153-2.479-6.46 0-4.306.826-6.561 2.479-6.767l10.534-2.153.244-.044c2.316-.463 3.474-1.883 3.474-4.262V70.624c-.026-1.277-.232-2.106-.617-2.489-.414-.41-1.446-.82-3.099-1.23l-10.534-1.846-.148-.023c-1.554-.302-2.331-2.242-2.331-5.821 0-3.281.826-5.23 2.479-5.844 23.96-9.228 49.884-23.377 77.77-42.448 1.032-.615 1.858-.923 2.478-.923zM271.77 99.927c-7.676 0-11.514 6.807-11.514 20.42 0 16.503 3.734 38.213 11.203 65.131 7.468 26.919 14.52 43.679 21.159 50.28 3.112 3.093 6.327 4.64 9.646 4.64 7.676 0 11.514-6.807 11.514-20.42 0-16.502-3.734-38.213-11.203-65.131-7.468-26.919-14.52-43.678-21.159-50.279-3.112-3.094-6.327-4.641-9.646-4.641zm939.17 64.935c-6.093 0-9.14 4.29-9.14 12.873 0 8.378 2.364 15.837 7.092 22.375 4.727 6.54 9.823 9.809 15.286 9.809 2.196 0 4.012-.646 5.45-1.937l.223-.209v-22.228c-.114-5.728-2.318-10.681-6.615-14.86-3.992-3.882-8.09-5.823-12.292-5.823zM450.63.002c10.302 0 18.802 3.439 25.499 10.317 6.697 6.877 10.045 15.422 10.045 25.635 0 10.212-3.4 18.757-10.2 25.635-6.593 6.878-15.042 10.317-25.344 10.317-10.303 0-18.803-3.44-25.5-10.317-6.696-6.878-10.045-15.423-10.045-25.635 0-10.213 3.349-18.758 10.045-25.635C431.827 3.441 440.327.002 450.63.002zm297.39 249c8.835 0 16.17-2.736 22.008-8.208 5.995-5.472 8.992-12.236 8.992-20.292s-2.958-14.82-8.874-20.292-13.291-8.208-22.126-8.208-16.21 2.736-22.126 8.208-8.874 12.236-8.874 20.292 2.958 14.82 8.874 20.292 13.291 8.208 22.126 8.208z"/></svg>
313
+ </a>
314
+ <?php endif; ?>
315
+ <div class="joinchat__close" title="<?php _e( 'Close', 'creame-whatsapp-me' ); ?>"></div>
316
+ </div>
317
+ <div class="joinchat__box__scroll">
318
+ <div class="joinchat__box__content">
319
+ <?php echo $box_content; ?>
320
+ </div>
321
+ </div>
322
+ </div>
323
+ <?php endif; ?>
324
+ <svg height="0" width="0"><defs><clipPath id="joinchat__message__peak"><path d="M17 25V0C17 12.877 6.082 14.9 1.031 15.91c-1.559.31-1.179 2.272.004 2.272C9.609 18.182 17 18.088 17 25z"/></clipPath></defs></svg>
325
+ </div>
326
+ <?php
327
+ $html_output = ob_get_clean();
328
+
329
+ echo apply_filters( 'joinchat_html_output', $html_output, $this->settings );
330
+ }
331
+ }
332
+
333
+ /**
334
+ * Check visibility on current page
335
+ *
336
+ * @since 2.0.0
337
+ * @since 3.0.0 Added filter to 'joinchat_visibility'
338
+ * @param array $options array of visibility settings
339
+ * @return boolean is visible or not on current page
340
+ */
341
+ public function check_visibility( $options ) {
342
+
343
+ // Custom visibility, bypass all checks if not null
344
+ $visibility = apply_filters( 'joinchat_visibility', null, $options );
345
+ if ( ! is_null( $visibility ) ) {
346
+ return $visibility;
347
+ }
348
+
349
+ $global = isset( $options['all'] ) ? 'yes' == $options['all'] : true;
350
+
351
+ // Check front page
352
+ if ( is_front_page() ) {
353
+ return isset( $options['front_page'] ) ? 'yes' == $options['front_page'] : $global;
354
+ }
355
+
356
+ // Check blog page
357
+ if ( is_home() ) {
358
+ return isset( $options['blog_page'] ) ? 'yes' == $options['blog_page'] : $global;
359
+ }
360
+
361
+ // Check 404 page
362
+ if ( is_404() ) {
363
+ return isset( $options['404_page'] ) ? 'yes' == $options['404_page'] : $global;
364
+ }
365
+
366
+ // Check Custom Post Types
367
+ if ( is_array( $options ) ) {
368
+ foreach ( $options as $cpt => $view ) {
369
+ if ( substr( $cpt, 0, 4 ) == 'cpt_' ) {
370
+ $cpt = substr( $cpt, 4 );
371
+ if ( is_singular( $cpt ) || is_post_type_archive( $cpt ) ) {
372
+ return 'yes' == $view;
373
+ }
374
+ }
375
+ }
376
+ }
377
+
378
+ // Search results
379
+ if ( is_search() ) {
380
+ return isset( $options['search'] ) ? 'yes' == $options['search'] : $global;
381
+ }
382
+
383
+ // Check archives
384
+ if ( is_archive() ) {
385
+
386
+ // Date archive
387
+ if ( isset( $options['date'] ) && is_date() ) {
388
+ return 'yes' == $options['date'];
389
+ }
390
+
391
+ // Author archive
392
+ if ( isset( $options['author'] ) && is_author() ) {
393
+ return 'yes' == $options['author'];
394
+ }
395
+
396
+ return isset( $options['archive'] ) ? 'yes' == $options['archive'] : $global;
397
+ }
398
+
399
+ // Check singular
400
+ if ( is_singular() ) {
401
+
402
+ // Page
403
+ if ( isset( $options['page'] ) && is_page() ) {
404
+ return 'yes' == $options['page'];
405
+ }
406
+
407
+ // Post (or other custom posts)
408
+ if ( isset( $options['post'] ) && is_single() ) {
409
+ return 'yes' == $options['post'];
410
+ }
411
+
412
+ return isset( $options['singular'] ) ? 'yes' == $options['singular'] : $global;
413
+ }
414
+
415
+ return $global;
416
+ }
417
+
418
+ /**
419
+ * Hide on Elementor preview mode.
420
+ * Set 'show' false when is editing on Elementor
421
+ *
422
+ * @since 2.2.3
423
+ * @param object /Elementor/Preview instance
424
+ */
425
+ public function elementor_preview_disable( $elementor_preview ) {
426
+
427
+ $this->show = apply_filters( 'joinchat_elementor_preview_show', false );
428
+
429
+ }
430
+
431
+ }
public/{class-whatsappme-woopublic.php → class-joinchat-woopublic.php} RENAMED
@@ -4,29 +4,29 @@
4
  * The public-facing functionality of the WooCommerce integration.
5
  *
6
  * @since 3.0.0
7
- * @package WhatsAppMe
8
- * @subpackage WhatsAppMe/admin
9
  * @author Creame <hola@crea.me>
10
  */
11
- class WhatsAppMe_WooPublic {
12
 
13
  /**
14
  * Initialize all hooks
15
  *
16
  * @since 3.0.0
17
- * @param array $whatsappme WhatsAppMe object.
18
  * @return void
19
  */
20
- public function init( $whatsappme ) {
21
 
22
- $loader = $whatsappme->get_loader();
23
 
24
- $loader->add_filter( 'whatsappme_extra_settings', $this, 'woo_settings' );
25
- $loader->add_filter( 'whatsappme_settings_i18n', $this, 'settings_i18n' );
26
- $loader->add_filter( 'whatsappme_get_settings_site', $this, 'product_settings' );
27
- $loader->add_filter( 'whatsappme_visibility', $this, 'visibility', 10, 2 );
28
- $loader->add_filter( 'whatsappme_variable_replacements', $this, 'replacements' );
29
- $loader->add_filter( 'whatsappme_excluded_fields', $this, 'excluded_fields' );
30
 
31
  }
32
 
@@ -166,6 +166,7 @@ class WhatsAppMe_WooPublic {
166
 
167
  $excluded = array(
168
  'message_text_product',
 
169
  'message_send_product',
170
  );
171
 
4
  * The public-facing functionality of the WooCommerce integration.
5
  *
6
  * @since 3.0.0
7
+ * @package JoinChat
8
+ * @subpackage JoinChat/admin
9
  * @author Creame <hola@crea.me>
10
  */
11
+ class JoinChatWooPublic {
12
 
13
  /**
14
  * Initialize all hooks
15
  *
16
  * @since 3.0.0
17
+ * @param array $joinchat JoinChat object.
18
  * @return void
19
  */
20
+ public function init( $joinchat ) {
21
 
22
+ $loader = $joinchat->get_loader();
23
 
24
+ $loader->add_filter( 'joinchat_extra_settings', $this, 'woo_settings' );
25
+ $loader->add_filter( 'joinchat_settings_i18n', $this, 'settings_i18n' );
26
+ $loader->add_filter( 'joinchat_get_settings_site', $this, 'product_settings' );
27
+ $loader->add_filter( 'joinchat_visibility', $this, 'visibility', 10, 2 );
28
+ $loader->add_filter( 'joinchat_variable_replacements', $this, 'replacements' );
29
+ $loader->add_filter( 'joinchat_excluded_fields', $this, 'excluded_fields' );
30
 
31
  }
32
 
166
 
167
  $excluded = array(
168
  'message_text_product',
169
+ 'message_text_on_sale',
170
  'message_send_product',
171
  );
172
 
public/class-whatsappme-public.php DELETED
@@ -1,428 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * The public-facing functionality of the plugin.
5
- *
6
- * Defines the plugin name, version, and two examples hooks for how to
7
- * enqueue the public-facing stylesheet and JavaScript.
8
- *
9
- * @since 1.0.0
10
- * @since 3.0.0 Added $show property and more hooks
11
- * @package WhatsAppMe
12
- * @subpackage WhatsAppMe/public
13
- * @author Creame <hola@crea.me>
14
- */
15
- class WhatsAppMe_Public {
16
-
17
- /**
18
- * The ID of this plugin.
19
- *
20
- * @since 1.0.0
21
- * @access private
22
- * @var string $plugin_name The ID of this plugin.
23
- */
24
- private $plugin_name;
25
-
26
- /**
27
- * The version of this plugin.
28
- *
29
- * @since 1.0.0
30
- * @access private
31
- * @var string $version The current version of this plugin.
32
- */
33
- private $version;
34
-
35
- /**
36
- * The setings of this plugin.
37
- *
38
- * @since 1.0.0
39
- * @access private
40
- * @var array $settings The current settings of this plugin.
41
- */
42
- private $settings;
43
-
44
- /**
45
- * Show WhatsApp button in front.
46
- *
47
- * @since 3.0.0
48
- * @access private
49
- * @var bool $show Show button on front.
50
- */
51
- private $show;
52
-
53
- /**
54
- * Initialize the class and set its properties.
55
- *
56
- * @since 1.0.0
57
- * @since 2.0.0 Added visibility setting
58
- * @since 2.1.0 Added message_badge
59
- * @since 2.3.0 Added button_delay and whatsapp_web settings, message_delay in seconds
60
- * @param string $plugin_name The name of the plugin.
61
- * @param string $version The version of this plugin.
62
- * @return void
63
- */
64
- public function __construct( $plugin_name, $version ) {
65
-
66
- $this->plugin_name = $plugin_name;
67
- $this->version = $version;
68
-
69
- // Updated in get_settings() at 'wp' hook
70
- $this->show = false;
71
- $this->settings = array();
72
-
73
- }
74
-
75
- /**
76
- * Get global settings and current post settings and prepare
77
- *
78
- * @since 1.0.0
79
- * @since 2.0.0 Check visibility
80
- * @since 2.2.0 Post settings can also change "telephone". Added 'whastapp_web' setting
81
- * @since 2.3.0 Fix global $post incorrect post id on loops. WPML integration.
82
- * @since 3.0.0 New filters.
83
- * @return void
84
- */
85
- public function get_settings() {
86
-
87
- // If use "global $post;" take first post in loop on archive pages
88
- $obj = get_queried_object();
89
-
90
- $default_settings = array_merge(
91
- array(
92
- 'telephone' => '',
93
- 'mobile_only' => 'no',
94
- 'button_image' => '',
95
- 'button_tip' => '',
96
- 'button_delay' => 3,
97
- 'whatsapp_web' => 'no',
98
- 'message_text' => '',
99
- 'message_delay' => 10,
100
- 'message_badge' => 'no',
101
- 'message_send' => '',
102
- 'message_start' => __( 'Open chat', 'creame-whatsapp-me' ),
103
- 'position' => 'right',
104
- 'visibility' => array( 'all' => 'yes' ),
105
- 'dark_mode' => 'no',
106
- ),
107
- apply_filters( 'whatsappme_extra_settings', array() )
108
- );
109
-
110
- $settings = $default_settings;
111
- $show = false;
112
-
113
- $site_settings = get_option( 'whatsappme' );
114
-
115
- if ( is_array( $site_settings ) ) {
116
- // Clean unused saved settings
117
- $settings = array_intersect_key( $site_settings, $default_settings );
118
- // Merge defaults with saved settings
119
- $settings = array_merge( $default_settings, $settings );
120
- // miliseconds (<v2.3) to seconds
121
- if ( $settings['message_delay'] > 120 ) {
122
- $settings['message_delay'] = round( $settings['message_delay'] / 1000 );
123
- }
124
-
125
- // Load WPML/Polylang translated strings
126
- $settings_i18n = WhatsAppMe_Util::settings_i18n();
127
-
128
- foreach ( $settings_i18n as $key => $label ) {
129
- $settings[ $key ] = $settings[ $key ] ? apply_filters( 'wpml_translate_single_string', $settings[ $key ], 'WhatsApp me', $label ) : '';
130
- }
131
-
132
- // Filter for site settings (can be overriden by post settings)
133
- $settings = apply_filters( 'whatsappme_get_settings_site', $settings, $obj );
134
-
135
- // Post custom settings override site settings
136
- $post_settings = is_a( $obj, 'WP_Post' ) ? get_post_meta( $obj->ID, '_whatsappme', true ) : '';
137
-
138
- if ( is_array( $post_settings ) ) {
139
- // Move old 'hide' to new 'view' field
140
- if ( isset( $post_settings['hide'] ) ) {
141
- $post_settings['view'] = 'no';
142
- unset( $post_settings['hide'] );
143
- }
144
-
145
- $settings = array_merge( $settings, $post_settings );
146
-
147
- // Allow override general settings with empty string with "{}"
148
- $settings['message_text'] = preg_match( '/^\{\s*\}$/', $settings['message_text'] ) ? '' : $settings['message_text'];
149
- $settings['message_send'] = preg_match( '/^\{\s*\}$/', $settings['message_send'] ) ? '' : $settings['message_send'];
150
- }
151
-
152
- // Prepare settings
153
- $settings['telephone'] = preg_replace( '/^0+|\D/', '', $settings['telephone'] );
154
- $settings['mobile_only'] = 'yes' == $settings['mobile_only'];
155
- $settings['whatsapp_web'] = 'yes' == $settings['whatsapp_web'];
156
- $settings['message_badge'] = 'yes' == $settings['message_badge'] && '' != $settings['message_text'];
157
- $settings['position'] = 'right' == $settings['position'] ? 'right' : 'left';
158
- $settings['dark_mode'] = in_array( $settings['dark_mode'], array( 'no', 'yes', 'auto' ) ) ? $settings['dark_mode'] : 'no';
159
- $settings['message_send'] = WhatsAppMe_Util::replace_variables( $settings['message_send'] );
160
- // Set true to link http://web.whatsapp.com instead http://api.whatsapp.com
161
- $settings['whatsapp_web'] = apply_filters( 'whatsappme_whatsapp_web', 'yes' == $settings['whatsapp_web'] );
162
-
163
- // Only show if there is a phone number
164
- if ( '' != $settings['telephone'] ) {
165
- if ( isset( $settings['view'] ) && 'yes' == $settings['view'] ) {
166
- $show = true;
167
- } elseif ( isset( $settings['view'] ) && 'no' == $settings['view'] ) {
168
- $show = false;
169
- } else {
170
- $show = $this->check_visibility( $settings['visibility'] );
171
- }
172
- }
173
- // Unset post 'view' setting
174
- unset( $settings['view'] );
175
- }
176
-
177
- // Apply filters to final settings after site and post settings
178
- $this->settings = apply_filters( 'whatsappme_get_settings', $settings, $obj );
179
- // Apply filters to alter 'show' value
180
- $this->show = apply_filters( 'whatsappme_show', $show, $this->settings, $obj );
181
-
182
- // Ensure not show if not phone
183
- if ( '' == $this->settings['telephone'] ) {
184
- $this->show = false;
185
- }
186
- }
187
-
188
- /**
189
- * Enqueue the stylesheets for the public-facing side of the site.
190
- *
191
- * @since 1.0.0
192
- * @since 2.2.2 minified
193
- * @return void
194
- */
195
- public function enqueue_styles() {
196
-
197
- if ( $this->show ) {
198
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
199
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . "css/{$this->plugin_name}{$min}.css", array(), $this->version, 'all' );
200
- }
201
-
202
- }
203
-
204
- /**
205
- * Enqueue the JavaScript for the public-facing side of the site.
206
- *
207
- * @since 1.0.0
208
- * @since 2.2.2 minified
209
- * @return void
210
- */
211
- public function enqueue_scripts() {
212
-
213
- if ( $this->show ) {
214
- $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
215
- wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . "js/{$this->plugin_name}{$min}.js", array( 'jquery' ), $this->version, true );
216
- }
217
-
218
- }
219
-
220
- /**
221
- * Outputs WhatsApp button html and his settings on footer
222
- *
223
- * @since 1.0.0
224
- * @since 3.2.0 Capture and filter output
225
- * @return void
226
- */
227
- public function footer_html() {
228
- global $wp;
229
-
230
- if ( $this->show ) {
231
-
232
- // Clean unnecessary settings on front
233
- $excluded_fields = apply_filters(
234
- 'whatsappme_excluded_fields',
235
- array(
236
- 'visibility',
237
- 'position',
238
- 'button_tip',
239
- 'button_image',
240
- 'message_start',
241
- 'dark_mode',
242
- )
243
- );
244
-
245
- $data = array_diff_key( $this->settings, array_flip( $excluded_fields ) );
246
-
247
- $copy = apply_filters( 'whatsappme_copy', 'Powered by' );
248
-
249
- $powered_url = urlencode( home_url( $wp->request ) );
250
- $powered_site = urlencode( get_bloginfo( 'name' ) );
251
- $powered_link = "https://wame.chat/powered/?site={$powered_site}&url={$powered_url}";
252
-
253
- // Set custom img tag and bypass default image logic
254
- $image = apply_filters( 'whatsappme_image', null );
255
-
256
- if ( is_null( $image ) && $this->settings['button_image'] ) {
257
- $img_path = get_attached_file( $this->settings['button_image'] );
258
-
259
- if ( apply_filters( 'whatsappme_image_original', WhatsAppMe_Util::is_animated_gif( $img_path ) ) ) {
260
- $image = '<img src="' . wp_get_attachment_url( $this->settings['button_image'] ) . '" alt="">';
261
- } elseif ( is_array( WhatsAppMe_Util::thumb( $img_path, 58, 58 ) ) ) {
262
- $thumb = WhatsAppMe_Util::thumb( $img_path, 58, 58 );
263
- $thumb2 = WhatsAppMe_Util::thumb( $img_path, 116, 116 );
264
- $thumb3 = WhatsAppMe_Util::thumb( $img_path, 174, 174 );
265
- $image = "<img src=\"{$thumb['url']}\" srcset=\"{$thumb2['url']} 2x, {$thumb3['url']} 3x\" alt=\"\">";
266
- }
267
- }
268
-
269
- $whatsappme_classes = 'whatsappme--' . $this->settings['position'];
270
- $whatsappme_classes .= isset( $_SERVER['HTTP_ACCEPT'] ) && strpos( $_SERVER['HTTP_ACCEPT'], 'image/webp' ) !== false ? ' whatsappme--webp' : '';
271
- if ( 'no' !== $this->settings['dark_mode'] ) {
272
- $whatsappme_classes .= 'auto' === $this->settings['dark_mode'] ? ' whatsappme--dark-auto' : ' whatsappme--dark';
273
- }
274
-
275
- if ( $this->settings['message_text'] ) {
276
- $box_content = '<div class="whatsappme__message">' . WhatsAppMe_Util::formated_message( $this->settings['message_text'] ) . '</div>';
277
- } else {
278
- $box_content = '';
279
- }
280
-
281
- ob_start();
282
-
283
- // load SVGs
284
- echo file_get_contents( __DIR__ . '/images/svgs.php' );
285
- ?>
286
- <div class="whatsappme <?php echo apply_filters( 'whatsappme_classes', $whatsappme_classes ); ?>" data-settings="<?php echo esc_attr( json_encode( $data ) ); ?>">
287
- <div class="whatsappme__button">
288
- <svg class="whatsappme__button__open"><use xlink:href="#wame_svg__logo"></use></svg>
289
- <?php if ( $image ) : ?>
290
- <div class="whatsappme__button__image"><?php echo $image; ?></div>
291
- <?php endif; ?>
292
- <?php if ( $this->settings['message_start'] ) : ?>
293
- <div class="whatsappme__button__sendtext"><?php echo $this->settings['message_start']; ?></div>
294
- <?php endif; ?>
295
- <?php if ( $this->settings['message_text'] ) : ?>
296
- <svg class="whatsappme__button__send" viewbox="0 0 400 400" stroke-linecap="round" stroke-width="33">
297
- <path class="wame_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"/>
298
- <path class="wame_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"/>
299
- </svg>
300
- <?php endif; ?>
301
- <?php if ( $this->settings['message_badge'] ) : ?>
302
- <div class="whatsappme__badge">1</div>
303
- <?php endif; ?>
304
- <?php if ( $this->settings['button_tip'] ) : ?>
305
- <div class="whatsappme__tooltip"><div><?php echo $this->settings['button_tip']; ?></div></div>
306
- <?php endif; ?>
307
- </div>
308
- <div class="whatsappme__box">
309
- <div class="whatsappme__header">
310
- <svg><use xlink:href="#wame_svg__whatsapp"></use></svg>
311
- <div class="whatsappme__close"><svg><use xlink:href="#wame_svg__close"></use></svg></div>
312
- </div>
313
- <div class="whatsappme__box__scroll">
314
- <div class="whatsappme__box__content">
315
- <?php echo apply_filters( 'whatsappme_content', $box_content, $this->settings ); ?>
316
- </div>
317
- </div>
318
- <?php if ( $copy ) : ?>
319
- <div class="whatsappme__copy"><?php echo $copy; ?> <a href="<?php echo $powered_link; ?>" rel="nofollow noopener" target="_blank"><svg><use xlink:href="#wame_svg__wame"></use></svg></a></div>
320
- <?php endif; ?>
321
- </div>
322
- </div>
323
- <?php
324
- $html_output = ob_get_clean();
325
-
326
- echo apply_filters( 'whatsappme_html_output', $html_output, $this->settings );
327
- }
328
- }
329
-
330
- /**
331
- * Check visibility on current page
332
- *
333
- * @since 2.0.0
334
- * @since 3.0.0 Added filter to 'whatsappme_visibility'
335
- * @param array $options array of visibility settings
336
- * @return boolean is visible or not on current page
337
- */
338
- public function check_visibility( $options ) {
339
-
340
- // Custom visibility, bypass all checks if not null
341
- $visibility = apply_filters( 'whatsappme_visibility', null, $options );
342
- if ( ! is_null( $visibility ) ) {
343
- return $visibility;
344
- }
345
-
346
- $global = isset( $options['all'] ) ? 'yes' == $options['all'] : true;
347
-
348
- // Check front page
349
- if ( is_front_page() ) {
350
- return isset( $options['front_page'] ) ? 'yes' == $options['front_page'] : $global;
351
- }
352
-
353
- // Check blog page
354
- if ( is_home() ) {
355
- return isset( $options['blog_page'] ) ? 'yes' == $options['blog_page'] : $global;
356
- }
357
-
358
- // Check 404 page
359
- if ( is_404() ) {
360
- return isset( $options['404_page'] ) ? 'yes' == $options['404_page'] : $global;
361
- }
362
-
363
- // Check Custom Post Types
364
- if ( is_array( $options ) ) {
365
- foreach ( $options as $cpt => $view ) {
366
- if ( substr( $cpt, 0, 4 ) == 'cpt_' ) {
367
- $cpt = substr( $cpt, 4 );
368
- if ( is_singular( $cpt ) || is_post_type_archive( $cpt ) ) {
369
- return 'yes' == $view;
370
- }
371
- }
372
- }
373
- }
374
-
375
- // Search results
376
- if ( is_search() ) {
377
- return isset( $options['search'] ) ? 'yes' == $options['search'] : $global;
378
- }
379
-
380
- // Check archives
381
- if ( is_archive() ) {
382
-
383
- // Date archive
384
- if ( isset( $options['date'] ) && is_date() ) {
385
- return 'yes' == $options['date'];
386
- }
387
-
388
- // Author archive
389
- if ( isset( $options['author'] ) && is_author() ) {
390
- return 'yes' == $options['author'];
391
- }
392
-
393
- return isset( $options['archive'] ) ? 'yes' == $options['archive'] : $global;
394
- }
395
-
396
- // Check singular
397
- if ( is_singular() ) {
398
-
399
- // Page
400
- if ( isset( $options['page'] ) && is_page() ) {
401
- return 'yes' == $options['page'];
402
- }
403
-
404
- // Post (or other custom posts)
405
- if ( isset( $options['post'] ) && is_single() ) {
406
- return 'yes' == $options['post'];
407
- }
408
-
409
- return isset( $options['singular'] ) ? 'yes' == $options['singular'] : $global;
410
- }
411
-
412
- return $global;
413
- }
414
-
415
- /**
416
- * Hide on Elementor preview mode.
417
- * Set 'show' false when is editing on Elementor
418
- *
419
- * @since 2.2.3
420
- * @param object /Elementor/Preview instance
421
- */
422
- public function elementor_preview_disable( $elementor_preview ) {
423
-
424
- $this->show = apply_filters( 'whatsappme_elementor_preview_show', false );
425
-
426
- }
427
-
428
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/css/joinchat.css ADDED
@@ -0,0 +1,601 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .joinchat {
2
+ --bottom: 20px;
3
+ --sep: 20px;
4
+ --header: 70px;
5
+ --red: 37;
6
+ --green: 211;
7
+ --blue: 102;
8
+ --rgb: var(--red), var(--green), var(--blue);
9
+ --color: rgb(var(--rgb));
10
+ --dark: rgb(calc(var(--red) - 75), calc(var(--green) - 75), calc(var(--blue) - 75));
11
+ --hover: rgb(calc(var(--red) + 50), calc(var(--green) + 50), calc(var(--blue) + 50));
12
+ --bg: rgba(var(--rgb), 0.04);
13
+ --tolerance: 210;
14
+ --bw: calc((var(--red)*0.2126 + var(--green)*0.7152 + var(--blue)*0.0722 - var(--tolerance))*-100000);
15
+ --text: rgba(var(--bw), var(--bw), var(--bw), min(0.9, max(0.7, var(--bw))));
16
+ --msg: var(--color);
17
+
18
+ position: fixed;
19
+ z-index: 1000;
20
+ right: var(--sep);
21
+ bottom: var(--bottom);
22
+ color: var(--text);
23
+ font: normal normal normal 16px/1.625em -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
24
+ letter-spacing: 0;
25
+ transform: scale3d(0, 0, 0);
26
+ transition: transform 0.3s ease-in-out;
27
+ -webkit-user-select: none;
28
+ -ms-user-select: none;
29
+ user-select: none;
30
+ -webkit-font-smoothing: antialiased;
31
+ }
32
+
33
+ .joinchat *,
34
+ .joinchat *::before,
35
+ .joinchat *::after {
36
+ box-sizing: border-box;
37
+ }
38
+
39
+ .joinchat--show {
40
+ transform: scale3d(1, 1, 1);
41
+ transition: transform 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
42
+ }
43
+
44
+ .joinchat.joinchat--left {
45
+ right: auto;
46
+ left: var(--sep);
47
+ }
48
+
49
+ @media (max-width: 480px), (orientation: landscape) and (max-width: 767px) {
50
+ .joinchat {
51
+ --bottom: 6px;
52
+ --sep: 6px;
53
+ --header: 55px;
54
+ }
55
+ }
56
+
57
+ .joinchat.joinchat--dark {
58
+ --msg: var(--dark);
59
+ }
60
+
61
+ @media (color-index: 48) {
62
+ .joinchat.joinchat--dark-auto {
63
+ --msg: var(--dark);
64
+ }
65
+ }
66
+
67
+ @media (prefers-color-scheme: dark) {
68
+ .joinchat.joinchat--dark-auto {
69
+ --msg: var(--dark);
70
+ }
71
+ }
72
+
73
+ .joinchat__button {
74
+ display: flex;
75
+ flex-direction: row;
76
+ position: absolute;
77
+ z-index: 2;
78
+ bottom: 8px;
79
+ right: 8px;
80
+ height: 60px;
81
+ min-width: 60px;
82
+ max-width: 95vw;
83
+ background: #25d366;
84
+ color: inherit;
85
+ border-radius: 30px;
86
+ box-shadow: 1px 6px 24px 0 rgba(7, 94, 84, 0.24);
87
+ cursor: pointer;
88
+ transition: background 0.2s linear;
89
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
90
+ will-change: background-color, width;
91
+ }
92
+
93
+ .joinchat__button:hover {
94
+ background: #128c7e;
95
+ transition: background 1.5s linear;
96
+ }
97
+
98
+ .joinchat__button:active {
99
+ background: #128c7e;
100
+ transition: none;
101
+ }
102
+
103
+ .joinchat--chatbox .joinchat__button {
104
+ background: var(--color);
105
+ transition: background 0.2s linear;
106
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
107
+ }
108
+
109
+ .joinchat--chatbox .joinchat__button:hover,
110
+ .joinchat--chatbox .joinchat__button:active {
111
+ background: var(--hover);
112
+ }
113
+
114
+ [dir=rtl] .joinchat__button {
115
+ flex-direction: row-reverse;
116
+ }
117
+
118
+ .joinchat--left .joinchat__button {
119
+ right: auto;
120
+ left: 8px;
121
+ flex-direction: row-reverse;
122
+ }
123
+
124
+ [dir=rtl] .joinchat--left .joinchat__button {
125
+ flex-direction: row;
126
+ }
127
+
128
+ .joinchat__button__open {
129
+ width: 60px;
130
+ height: 60px;
131
+ background: rgba(0, 0, 0, 0) 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") center no-repeat;
132
+ background-size: 36px;
133
+ }
134
+
135
+ .joinchat--chatbox .joinchat__button__open {
136
+ display: none;
137
+ }
138
+
139
+ .joinchat__button__image {
140
+ position: absolute;
141
+ top: 1px;
142
+ right: 1px;
143
+ width: 58px;
144
+ height: 58px;
145
+ border-radius: 50%;
146
+ overflow: hidden;
147
+ opacity: 0;
148
+ }
149
+
150
+ .joinchat__button__image img {
151
+ display: block;
152
+ width: 100%;
153
+ height: 100%;
154
+ object-fit: cover;
155
+ }
156
+
157
+ .joinchat--show .joinchat__button__image {
158
+ animation: joinchat_image_loop 20s linear 5s infinite normal both;
159
+ }
160
+
161
+ .joinchat--image .joinchat__button__image {
162
+ opacity: 1;
163
+ animation: none;
164
+ }
165
+
166
+ .joinchat--chatbox .joinchat__button__image {
167
+ display: none;
168
+ }
169
+
170
+ .joinchat__button__send {
171
+ display: none;
172
+ width: 60px;
173
+ height: 60px;
174
+ max-width: 60px;
175
+ padding: 12px 11px 12px 13px;
176
+ margin: 0;
177
+ flex-shrink: 0;
178
+ }
179
+
180
+ .joinchat--chatbox .joinchat__button__send {
181
+ display: block;
182
+ }
183
+
184
+ .joinchat__button__send path {
185
+ fill: none !important;
186
+ stroke: var(--text) !important;
187
+ }
188
+
189
+ .joinchat__button__send .joinchat_svg__plain {
190
+ stroke-dasharray: 1097;
191
+ stroke-dashoffset: 1097;
192
+ animation: joinchat_plain 6s 0.2s ease-in-out infinite;
193
+ }
194
+
195
+ .joinchat__button__send .joinchat_svg__chat {
196
+ stroke-dasharray: 1020;
197
+ stroke-dashoffset: 1020;
198
+ animation: joinchat_chat 6s 3.2s ease-in-out infinite;
199
+ }
200
+
201
+ .joinchat__button__sendtext {
202
+ padding: 0;
203
+ max-width: 0;
204
+ font-weight: 600;
205
+ line-height: 60px;
206
+ white-space: nowrap;
207
+ opacity: 0;
208
+ overflow: hidden;
209
+ transition: none;
210
+ }
211
+
212
+ .joinchat--chatbox .joinchat__button__sendtext {
213
+ padding: 0 4px 0 24px;
214
+ max-width: 200px;
215
+ opacity: 1;
216
+ transition: max-width 0.2s linear, opacity 0.4s ease-out 0.2s;
217
+ }
218
+
219
+ .joinchat--chatbox.joinchat--left .joinchat__button__sendtext {
220
+ padding: 0 24px 0 4px;
221
+ }
222
+
223
+ .joinchat__badge {
224
+ position: absolute;
225
+ top: -4px;
226
+ right: -4px;
227
+ width: 20px;
228
+ height: 20px;
229
+ border: none;
230
+ border-radius: 50%;
231
+ background: #e82c0c;
232
+ font-size: 12px;
233
+ font-weight: 600;
234
+ line-height: 20px;
235
+ text-align: center;
236
+ box-shadow: none;
237
+ opacity: 0;
238
+ pointer-events: none;
239
+ }
240
+
241
+ .joinchat__badge.joinchat__badge--in {
242
+ animation: joinchat_badge_in 500ms cubic-bezier(0.27, 0.9, 0.41, 1.28) 1 both;
243
+ }
244
+
245
+ .joinchat__badge.joinchat__badge--out {
246
+ animation: joinchat_badge_out 400ms cubic-bezier(0.215, 0.61, 0.355, 1) 1 both;
247
+ }
248
+
249
+ .joinchat__tooltip {
250
+ position: absolute;
251
+ top: 14px;
252
+ right: 76px;
253
+ max-width: calc(100vw - 105px);
254
+ height: 32px;
255
+ padding: 0 14px;
256
+ border: none;
257
+ border-radius: 16px;
258
+ background: #fff;
259
+ color: rgba(0, 0, 0, 0.8);
260
+ line-height: 31px;
261
+ white-space: nowrap;
262
+ opacity: 0;
263
+ filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.4));
264
+ transform: translateZ(0);
265
+ pointer-events: none;
266
+ }
267
+
268
+ .joinchat__tooltip::after {
269
+ content: '';
270
+ display: block;
271
+ position: absolute;
272
+ top: 10px;
273
+ right: -6px;
274
+ border: 8px solid transparent;
275
+ border-width: 6px 0 6px 8px;
276
+ border-left-color: white;
277
+ }
278
+
279
+ .joinchat__tooltip div {
280
+ overflow: hidden;
281
+ text-overflow: ellipsis;
282
+ }
283
+
284
+ .joinchat--tooltip .joinchat__tooltip {
285
+ animation: joinchat_tootlip 20s linear 5s 1 normal both;
286
+ }
287
+
288
+ .joinchat--chatbox .joinchat__tooltip {
289
+ display: none;
290
+ }
291
+
292
+ .joinchat--left .joinchat__tooltip {
293
+ right: auto;
294
+ left: 76px;
295
+ }
296
+
297
+ .joinchat--left .joinchat__tooltip::after {
298
+ left: -6px;
299
+ right: auto;
300
+ border-color: transparent;
301
+ border-width: 6px 8px 6px 0;
302
+ border-right-color: white;
303
+ }
304
+
305
+ .joinchat__box {
306
+ display: flex;
307
+ flex-direction: column;
308
+ position: absolute;
309
+ bottom: 0;
310
+ right: 0;
311
+ z-index: 1;
312
+ width: calc(100vw - var(--sep)*2);
313
+ max-width: 400px;
314
+ min-height: 170px;
315
+ max-height: calc(100vh - var(--bottom) - var(--sep));
316
+ border-radius: 32px;
317
+ background: transparent;
318
+ box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.5);
319
+ overflow: hidden;
320
+ transform: scale3d(0, 0, 0);
321
+ opacity: 0;
322
+ transition: opacity 400ms ease-out, transform 0ms linear 300ms;
323
+ }
324
+
325
+ .joinchat--chatbox .joinchat__box {
326
+ opacity: 1;
327
+ transform: scale3d(1, 1, 1);
328
+ transition: opacity 200ms ease-out, transform 0ms linear;
329
+ }
330
+
331
+ .joinchat--left .joinchat__box {
332
+ right: auto;
333
+ left: 0;
334
+ }
335
+
336
+ .joinchat__header {
337
+ flex-shrink: 0;
338
+ height: var(--header);
339
+ line-height: var(--header);
340
+ padding: 0 26px;
341
+ margin: 0;
342
+ background: var(--color);
343
+ }
344
+
345
+ .joinchat--dark .joinchat__header {
346
+ background: var(--dark);
347
+ }
348
+
349
+ .joinchat__copy {
350
+ font-size: 11px;
351
+ line-height: 18px;
352
+ color: inherit !important;
353
+ text-decoration: none !important;
354
+ fill: currentColor;
355
+ opacity: 0.7;
356
+ }
357
+
358
+ .joinchat__copy svg {
359
+ display: inline-block;
360
+ width: auto;
361
+ height: 18px;
362
+ vertical-align: -26%;
363
+ }
364
+
365
+ .joinchat__copy:hover,
366
+ .joinchat__copy:active {
367
+ color: inherit !important;
368
+ text-decoration: none !important;
369
+ opacity: 0.9;
370
+ }
371
+
372
+ .joinchat__close {
373
+ position: absolute;
374
+ top: 18px;
375
+ right: 24px;
376
+ width: 34px;
377
+ height: 34px;
378
+ border-radius: 50%;
379
+ background: rgba(0, 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") center no-repeat;
380
+ background-size: 12px;
381
+ cursor: pointer;
382
+ transition: background-color 300ms ease-out;
383
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
384
+ }
385
+
386
+ .joinchat__close:hover {
387
+ background-color: rgba(0, 0, 0, 0.6);
388
+ }
389
+
390
+ [dir=rtl] .joinchat__close {
391
+ right: auto;
392
+ left: 24px;
393
+ }
394
+
395
+ .joinchat__box__scroll {
396
+ padding: 20px 0 80px 0;
397
+ background: #fff linear-gradient(0deg, var(--bg), var(--bg));
398
+ overflow-x: hidden;
399
+ overflow-y: auto;
400
+ will-change: scroll-position;
401
+ }
402
+
403
+ .joinchat__box__scroll::-webkit-scrollbar {
404
+ width: 5px;
405
+ background: rgba(0, 0, 0, 0);
406
+ }
407
+
408
+ .joinchat__box__scroll::-webkit-scrollbar-thumb {
409
+ border-radius: 3px;
410
+ background: rgba(0, 0, 0, 0);
411
+ }
412
+
413
+ .joinchat__box__scroll:hover::-webkit-scrollbar-thumb {
414
+ background: rgba(0, 0, 0, 0.2);
415
+ }
416
+
417
+ .joinchat--blur .joinchat__box__scroll {
418
+ background: rgba(var(--rgb), 0.2);
419
+ -webkit-backdrop-filter: blur(10px);
420
+ backdrop-filter: blur(10px);
421
+ }
422
+
423
+ .joinchat--dark .joinchat__box__scroll {
424
+ background: #1a1a1a;
425
+ }
426
+
427
+ @supports (-webkit-overflow-scrolling: touch) {
428
+ .joinchat__box__scroll {
429
+ overflow-y: scroll;
430
+ -webkit-overflow-scrolling: touch;
431
+ }
432
+ }
433
+
434
+ @media (max-width: 480px), (orientation: landscape) and (max-width: 767px) {
435
+ .joinchat__close {
436
+ top: 13px;
437
+ width: 28px;
438
+ height: 28px;
439
+ }
440
+
441
+ .joinchat__box__scroll {
442
+ padding: 15px 0 70px 0;
443
+ }
444
+ }
445
+
446
+ @media (color-index: 48) {
447
+ .joinchat--dark-auto .joinchat__box__scroll {
448
+ background: #1a1a1a;
449
+ }
450
+
451
+ .joinchat--dark-auto .joinchat__header {
452
+ background: var(--dark);
453
+ }
454
+ }
455
+
456
+ @media (prefers-color-scheme: dark) {
457
+ .joinchat--dark-auto .joinchat__box__scroll {
458
+ background: #1a1a1a;
459
+ }
460
+
461
+ .joinchat--dark-auto .joinchat__header {
462
+ background: var(--dark);
463
+ }
464
+ }
465
+
466
+ .joinchat__message {
467
+ position: relative;
468
+ min-height: 60px;
469
+ padding: 17px 20px;
470
+ margin: 0 26px 26px;
471
+ border-radius: 32px;
472
+ background: #fff;
473
+ color: #4a4a4a;
474
+ filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
475
+ transform: translateZ(0);
476
+ }
477
+
478
+ .joinchat__message::before {
479
+ content: '';
480
+ display: block;
481
+ position: absolute;
482
+ bottom: 20px;
483
+ left: -15px;
484
+ width: 17px;
485
+ height: 25px;
486
+ background: inherit;
487
+ -webkit-clip-path: url(#joinchat__message__peak);
488
+ clip-path: url(#joinchat__message__peak);
489
+ }
490
+
491
+ .joinchat--dark .joinchat__message {
492
+ background: #505050;
493
+ color: #d8d8d8;
494
+ }
495
+
496
+ @media (color-index: 48) {
497
+ .joinchat--dark-auto .joinchat__message {
498
+ background: #505050;
499
+ color: #d8d8d8;
500
+ }
501
+ }
502
+
503
+ @media (prefers-color-scheme: dark) {
504
+ .joinchat--dark-auto .joinchat__message {
505
+ background: #505050;
506
+ color: #d8d8d8;
507
+ }
508
+ }
509
+
510
+ @media (max-width: 480px), (orientation: landscape) and (max-width: 767px) {
511
+ .joinchat__message {
512
+ padding: 18px 16px;
513
+ line-height: 24px;
514
+ margin: 0 20px 20px;
515
+ }
516
+ }
517
+
518
+ @keyframes joinchat_badge_in {
519
+ from {
520
+ opacity: 0;
521
+ transform: translateY(50px);
522
+ }
523
+
524
+ to {
525
+ opacity: 1;
526
+ transform: translateY(0);
527
+ }
528
+ }
529
+
530
+ @keyframes joinchat_badge_out {
531
+ from {
532
+ opacity: 1;
533
+ transform: translateY(0);
534
+ }
535
+
536
+ to {
537
+ opacity: 0;
538
+ transform: translateY(-20px);
539
+ }
540
+ }
541
+
542
+ @keyframes joinchat_plain {
543
+ 0%,
544
+ 50%,
545
+ 100% {
546
+ stroke-dashoffset: 1097;
547
+ }
548
+
549
+ 5%,
550
+ 45% {
551
+ stroke-dashoffset: 0;
552
+ }
553
+ }
554
+
555
+ @keyframes joinchat_chat {
556
+ 0%,
557
+ 50%,
558
+ 100% {
559
+ stroke-dashoffset: 1020;
560
+ }
561
+
562
+ 5%,
563
+ 45% {
564
+ stroke-dashoffset: 0;
565
+ }
566
+ }
567
+
568
+ @keyframes joinchat_image_loop {
569
+ 0% {
570
+ opacity: 0;
571
+ }
572
+
573
+ 3%,
574
+ 20% {
575
+ opacity: 1;
576
+ }
577
+
578
+ 25%,
579
+ 100% {
580
+ opacity: 0;
581
+ }
582
+ }
583
+
584
+ @keyframes joinchat_tootlip {
585
+ 0% {
586
+ opacity: 0;
587
+ transform: scaleY(0);
588
+ }
589
+
590
+ 1%,
591
+ 20% {
592
+ opacity: 1;
593
+ transform: scaleY(1);
594
+ }
595
+
596
+ 25%,
597
+ 100% {
598
+ opacity: 0;
599
+ transform: scaleY(1);
600
+ }
601
+ }
public/css/joinchat.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .joinchat{--bottom:20px;--sep:20px;--header:70px;--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(0.9,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:60px;min-width:60px;max-width:95vw;background:#25d366;color:inherit;border-radius:30px;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:60px;height:60px;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:36px}.joinchat--chatbox .joinchat__button__open{display:none}.joinchat__button__image{position:absolute;top:1px;right:1px;width:58px;height:58px;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:60px;height:60px;max-width:60px;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:60px;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;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;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}.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);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{flex-shrink:0;height:var(--header);line-height:var(--header);padding:0 26px;margin:0;background:var(--color)}.joinchat--dark .joinchat__header{background:var(--dark)}.joinchat__copy{font-size:11px;line-height:18px;color:inherit!important;text-decoration:none!important;fill:currentColor;opacity:.7}.joinchat__copy svg{display:inline-block;width:auto;height:18px;vertical-align:-26%}.joinchat__copy:active,.joinchat__copy:hover{color:inherit!important;text-decoration:none!important;opacity:.9}.joinchat__close{position:absolute;top:18px;right:24px;width:34px;height:34px;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 80px;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__close{top:13px;width:28px;height:28px}.joinchat__box__scroll{padding:15px 0 70px}}@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/css/whatsappme.css DELETED
@@ -1,638 +0,0 @@
1
- @font-face {
2
- font-family: 'WAmeIcons';
3
- src: url('data:font/woff;base64,d09GRgABAAAAAARgAAsAAAAABBQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIFgGNtYXAAAAFoAAAAVAAAAFQXVtKIZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAHQAAAB0gkciwGhlYWQAAAI4AAAANgAAADYVuuUSaGhlYQAAAnAAAAAkAAAAJAbCA8dobXR4AAAClAAAABgAAAAYDgACM2xvY2EAAAKsAAAADgAAAA4AYgBAbWF4cAAAArwAAAAgAAAAIAAIAAVuYW1lAAAC3AAAAWIAAAFicC7V7nBvc3QAAARAAAAAIAAAACAAAwAAAAMDVQGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QEDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkB//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQEzAM0DAALNAAIAAAkBEQMA/jMBzf8AAgAAAAEBAADNAs0CzQACAAABEQECzf4zAs3+AAEAAAABAAAAAQAAtqSnv18PPPUACwQAAAAAANnOUKQAAAAA2c5QpAAAAAADAALNAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAMAAAEAAAAAAAAAAAAAAAAAAAAGBAAAAAAAAAAAAAAAAgAAAAQAATMEAAEAAAAAAAAKABQAHgAsADoAAAABAAAABgADAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEABAAAAAEAAAAAAAIABwBFAAEAAAAAAAMABAAtAAEAAAAAAAQABABaAAEAAAAAAAUACwAMAAEAAAAAAAYABAA5AAEAAAAAAAoAGgBmAAMAAQQJAAEACAAEAAMAAQQJAAIADgBMAAMAAQQJAAMACAAxAAMAAQQJAAQACABeAAMAAQQJAAUAFgAXAAMAAQQJAAYACAA9AAMAAQQJAAoANACAd2FtZQB3AGEAbQBlVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwd2FtZQB3AGEAbQBld2FtZQB3AGEAbQBlUmVndWxhcgBSAGUAZwB1AGwAYQByd2FtZQB3AGEAbQBlRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==') format('woff');
4
- }
5
-
6
- .whatsappme {
7
- position: fixed;
8
- z-index: 1000;
9
- right: 20px;
10
- bottom: 20px;
11
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
12
- font-size: 16px;
13
- line-height: 1.625em;
14
- color: #262626;
15
- transform: scale3d(0, 0, 0);
16
- transition: transform .3s ease-in-out;
17
- user-select: none;
18
- -ms-user-select: none;
19
- -moz-user-select: none;
20
- -webkit-user-select: none;
21
- }
22
-
23
- .whatsappme *,
24
- .whatsappme *:before,
25
- .whatsappme *:after {
26
- box-sizing: border-box;
27
- }
28
-
29
- .whatsappme svg,
30
- .whatsappme svg path {
31
- fill: currentColor !important;
32
- }
33
-
34
- .whatsappme.whatsappme--show {
35
- transform: scale3d(1, 1, 1);
36
- transition: transform .5s cubic-bezier(0.18, 0.89, 0.32, 1.28);
37
- }
38
-
39
- .whatsappme__button {
40
- display: -ms-flexbox;
41
- display: -webkit-flex;
42
- display: flex;
43
- position: absolute;
44
- z-index: 2;
45
- bottom: 8px;
46
- right: 8px;
47
- height: 60px;
48
- min-width: 60px;
49
- max-width: 95vw;
50
- background-color: #25D366;
51
- color: #fff;
52
- border-radius: 30px;
53
- box-shadow: 1px 6px 24px 0 rgba(7, 94, 84, .24);
54
- cursor: pointer;
55
- transition: background-color 0.2s linear;
56
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
57
- }
58
-
59
- .whatsappme__button:hover {
60
- background-color: #128C7E;
61
- transition: background-color 1.5s linear;
62
- }
63
-
64
- .whatsappme--chatbox .whatsappme__button {
65
- background-color: #128C7E;
66
- transition: background-color 0.2s linear;
67
- }
68
-
69
- .whatsappme--chatbox .whatsappme__button:hover {
70
- background-color: #075E54;
71
- }
72
-
73
- .whatsappme__button:active {
74
- background-color: #075E54;
75
- transition: none;
76
- }
77
-
78
-
79
- /* iOS styles */
80
- @supports (-webkit-overflow-scrolling: touch) {
81
- .whatsappme--chatbox .whatsappme__button {
82
- background-color: #34B7F1;
83
- }
84
-
85
- .whatsappme--chatbox .whatsappme__button:hover,
86
- .whatsappme__button:active {
87
- background-color: #228bb9;
88
- }
89
- }
90
-
91
- .whatsappme__button svg {
92
- width: 36px;
93
- height: 36px;
94
- margin: 12px 12px;
95
- }
96
-
97
- .whatsappme__button .whatsappme__button__send {
98
- margin: 12px 11px 12px 13px;
99
- }
100
-
101
- .whatsappme__button__image {
102
- position: absolute;
103
- top: 1px;
104
- right: 1px;
105
- width: 58px;
106
- height: 58px;
107
- border-radius: 50%;
108
- overflow: hidden;
109
- opacity: 0;
110
- }
111
-
112
- .whatsappme__button__image img {
113
- display: block;
114
- width: 100%;
115
- height: 100%;
116
- object-fit: cover;
117
- }
118
-
119
- .whatsappme--show .whatsappme__button__image {
120
- animation: wame_image_loop 20s linear 5s infinite normal both;
121
- }
122
-
123
- .whatsappme--image .whatsappme__button__image {
124
- opacity: 1;
125
- animation: none;
126
- }
127
-
128
- .whatsappme__button__sendtext {
129
- padding: 0;
130
- max-width: 0;
131
- font-weight: 600;
132
- line-height: 60px;
133
- white-space: nowrap;
134
- opacity: 0;
135
- overflow: hidden;
136
- transition: none;
137
- }
138
-
139
- .whatsappme--chatbox .whatsappme__button__sendtext {
140
- padding: 0 4px 0 24px;
141
- max-width: 200px;
142
- opacity: 1;
143
- transition: max-width 0.2s linear, opacity 0.4s ease-out 0.2s;
144
- }
145
-
146
- .whatsappme__badge {
147
- position: absolute;
148
- top: -4px;
149
- right: -4px;
150
- width: 20px;
151
- height: 20px;
152
- border: none;
153
- border-radius: 50%;
154
- background: #e82c0c;
155
- font-size: 12px;
156
- font-weight: 600;
157
- line-height: 20px;
158
- text-align: center;
159
- box-shadow: none;
160
- opacity: 0;
161
- pointer-events: none;
162
- }
163
-
164
- .whatsappme__badge.whatsappme__badge--in {
165
- animation: wame_badge_in 500ms cubic-bezier(0.27, 0.9, 0.41, 1.28) 1 both;
166
- }
167
-
168
- .whatsappme__badge.whatsappme__badge--out {
169
- animation: wame_badge_out 400ms cubic-bezier(0.215, 0.61, 0.355, 1) 1 both;
170
- }
171
-
172
- .whatsappme--chatbox .whatsappme__button {
173
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
174
- }
175
-
176
- .whatsappme .whatsappme__button__send path {
177
- fill: none !important;
178
- stroke: #fff !important;
179
- }
180
-
181
- .whatsappme .whatsappme__button__send .wame_svg__plain {
182
- stroke-dasharray: 1097;
183
- stroke-dashoffset: 1097;
184
- animation: wame_plain 6s 0.2s ease-in-out infinite;
185
- }
186
-
187
- .whatsappme .whatsappme__button__send .wame_svg__chat {
188
- stroke-dasharray: 1020;
189
- stroke-dashoffset: 1020;
190
- animation: wame_chat 6s 3.2s ease-in-out infinite;
191
- }
192
-
193
- .whatsappme__tooltip {
194
- position: absolute;
195
- top: 14px;
196
- right: 76px;
197
- max-width: calc(100vw - 105px);
198
- height: 32px;
199
- padding: 0 14px;
200
- border: none;
201
- border-radius: 16px;
202
- background: #fff;
203
- color: #075E54;
204
- line-height: 31px;
205
- white-space: nowrap;
206
- box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.4);
207
- opacity: 0;
208
- }
209
-
210
- .whatsappme__tooltip::after {
211
- font: normal normal 400 20px/1em WAmeIcons;
212
- content: '\e900';
213
- position: absolute;
214
- top: 6px;
215
- right: -12px;
216
- color: #fff;
217
- text-align: right;
218
- text-shadow: 2px 1px 3px rgba(0, 0, 0, .4);
219
- }
220
-
221
- .whatsappme__tooltip div {
222
- overflow: hidden;
223
- text-overflow: ellipsis;
224
- }
225
-
226
- .whatsappme--tooltip .whatsappme__tooltip {
227
- animation: wame_tootlip 20s linear 5s 1 normal both;
228
- }
229
-
230
- .whatsappme__button__open,
231
- .whatsappme--chatbox .whatsappme__button__send {
232
- display: block;
233
- }
234
-
235
- .whatsappme__button__send,
236
- .whatsappme--chatbox .whatsappme__button__open,
237
- .whatsappme--chatbox .whatsappme__button__image,
238
- .whatsappme--chatbox .whatsappme__tooltip {
239
- display: none;
240
- }
241
-
242
- .whatsappme__box {
243
- position: absolute;
244
- bottom: 0;
245
- right: 0;
246
- z-index: 1;
247
- width: calc(100vw - 40px);
248
- max-width: 400px;
249
- min-height: 270px;
250
- border-radius: 32px;
251
- background: #ede4dd url(../images/background.png) center repeat-y;
252
- background-size: 100% auto;
253
- box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .5);
254
- overflow: hidden;
255
- transform: scale3d(0, 0, 0);
256
- opacity: 0;
257
- transition: opacity 400ms ease-out, transform 0ms linear 300ms;
258
- }
259
-
260
- .whatsappme--webp .whatsappme__box {
261
- background-image: url(../images/background.webp);
262
- }
263
-
264
- .whatsappme--chatbox .whatsappme__box {
265
- opacity: 1;
266
- transform: scale3d(1, 1, 1);
267
- transition: opacity 200ms ease-out, transform 0ms linear;
268
- }
269
-
270
- .whatsappme__header {
271
- float: none;
272
- display: block;
273
- position: static;
274
- width: 100%;
275
- height: 70px;
276
- padding: 0 26px;
277
- margin: 0;
278
- background-color: #2e8c7d;
279
- color: rgba(255, 255, 255, .5);
280
- }
281
-
282
- .whatsappme__header svg {
283
- width: 120px;
284
- height: 100%;
285
- }
286
-
287
- .whatsappme__close {
288
- display: -ms-flexbox;
289
- display: -webkit-flex;
290
- display: flex;
291
- position: absolute;
292
- top: 18px;
293
- right: 24px;
294
- width: 34px;
295
- height: 34px;
296
- border-radius: 50%;
297
- background: #000;
298
- color: #fff;
299
- text-align: center;
300
- opacity: .4;
301
- cursor: pointer;
302
- transition: opacity 300ms ease-out;
303
- -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
304
- }
305
-
306
- .whatsappme__close:hover {
307
- opacity: .6;
308
- }
309
-
310
- .whatsappme__close svg {
311
- display: block;
312
- width: 12px;
313
- height: 12px;
314
- margin: auto;
315
- }
316
-
317
- .whatsappme__box__scroll {
318
- max-height: calc(100vh - 100px);
319
- padding: 20px 0 80px 0;
320
- overflow: hidden auto;
321
- }
322
-
323
- .whatsappme__box__scroll::-webkit-scrollbar {
324
- width: 5px;
325
- background: rgba(0, 0, 0, 0);
326
- }
327
-
328
- .whatsappme__box__scroll::-webkit-scrollbar-thumb {
329
- border-radius: 3px;
330
- background: rgba(0, 0, 0, 0);
331
- }
332
-
333
- .whatsappme__box__scroll:hover::-webkit-scrollbar-thumb {
334
- background: rgba(0, 0, 0, 0.2);
335
- }
336
-
337
-
338
- .whatsappme__message {
339
- position: relative;
340
- min-height: 80px;
341
- padding: 20px;
342
- margin: 0 26px 26px;
343
- border-radius: 32px;
344
- background-color: #fff;
345
- color: #4A4A4A;
346
- box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
347
- }
348
-
349
- .whatsappme__message:before {
350
- content: '';
351
- display: block;
352
- position: absolute;
353
- bottom: 30px;
354
- left: -18px;
355
- width: 18px;
356
- height: 18px;
357
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA1CAYAAADlE3NNAAAEr0lEQVRo3t2aT0gjVxzHf++9mcn8zWhW6bpELWzcogFNaRar7a4tBNy2WATbHpacpdZ6redeZE+9CL02B1ktXsRD/xwsilhoSwsqag/xYK09hCQlmCiTf28vGRnGmZhE183MFx5vmGQy7zO/P/P7PYLAHUIAQCqDAwDPxMREG3IpHL+zs/MZcgkYAgAMAIwOl8lkYm6xGgYAFgAEAGgZHx9/vVwun7nJJTkAEAGgdW9v73NKKXWLSzIA4AEAGQDazs/P/3ALnNEl1a2trY9oRW6wmu6SEgC0ZrPZn9wCp2dIHgCU1dXVtymlZafDIatEksvlfqYGueG9xgOAcnBw8JSa5GR3vIi1aDTaUSwWj5wOZ3RHPUN6U6nUN9RCTnZHDwDI+/v745TSkpPhrOpHcWlpqbdcLieojZwGpseZMDo66svn87/RKnIaGAsAfCAQ8J6dnX1Pr5DjwABAzmazMVqDHAd2enr6La1RjgGLRCJqLpeL0TrUjFDGrMgCAD8/P38vn8//QutUs1pLT/fC5ubmQKFQOKANqNmspbuhBwDEZDL5BaX0lDaoZoK62NxZXFzs1DRthV5TrxrKGFue/v5+KZ1Of1kul5P0BtQUUAAgxOPx9wuFwl/0BvWq3O8C6vDw8F1N036gL0G3ZaVLUEdHRxFN036kL1E3DWMHxAEAPzc3dyedTk+XSqUdegu6CRijy5mBPLOzs2oikfhU07RFSmmG3qKuaxkdxuhy/MzMjDeRSHyiadrz2wYyClUBMh9bzRfAu7u7PX6//z1RFB9zHBcBALUZKoRqUMgEgyvHeHt7+353d/cjQRBGWJZ9jBDqaMYKHKpYBAEAXltbawsGg2FFUd7iOO4hIeQhQuiOEzpdOzCSTCaftLS0fEUIGXbiHiBjU5njVCr1sc/nW6wkDcduS1u1HKRUKv2KMR4ABwvbAWKMA+BwYbsasFgs/uMWuEtxd3x8/J3b4C4Ag8Hg83g8/iyfz//n5IRi1eZzla00HgA8oijyDMNwlFJCCGH0axiGQQAAXq+XyLLMeL1eRlEURpZlRpIkhud5oigK297eLvl8Prm1tVVSFEWSJEkWRVESBMGrqupriqLcFQThLsaYu612n6vUip4KMFv5HJssjhooEi5laoZh0NjYWNvw8PC9np6ejkAg8MDv9w+oqnrfxsNqhgNTh2wE1MGYChyyWGA9RYJVFWTM3MhwjMPhsDw9PT0QDocHOjs731RV9Y1rv+cMlb4Oiy3garWW1b2sPMfceZgHmZqa6pycnPywr6/vA47jfPXAWbU0xOCOqE44u2K8Wl9oBUfMa+rq6hIWFhbGBwcHn9pBohogcRWwRiCRTUiACQ6ZYpxY9JAkFAopy8vLM4FAYKyRrgA1GGf1JperLGgEM4cNG4vF3olGo18TQkT9JsRmAdQw66NsGlbn7Ibdd0um2XzOblz6/ZWVlX8JIb8PDQ090gFJDU+e2sBeZ1hBU9NcqvIQzDMFALq+vp7GGP85MjLyBCHE1tPO1LP4eq4FG/hqnlGyeSiwsbHxfygUOu7t7Y00059JUY3ZHFm8k1lT0cGfnJw8c0ojepWFzd6CMpnM3y8AJPEkZ9khO4IAAAAASUVORK5CYII=');
358
- background-size: 100%;
359
- }
360
-
361
- .whatsappme__message a {
362
- text-decoration: underline;
363
- color: #2e8c7d;
364
- }
365
-
366
- .whatsappme__copy {
367
- position: absolute;
368
- bottom: 9px;
369
- left: 28px;
370
- color: #2e8c7d;
371
- font-size: 11px;
372
- letter-spacing: 0.2px;
373
- line-height: 16px;
374
- opacity: 0.4;
375
- transition: opacity 0.25s;
376
- }
377
-
378
- .whatsappme__copy:hover {
379
- opacity: 0.8;
380
- transition: opacity 0.5s ease-out 0.5s;
381
- }
382
-
383
- .whatsappme__copy a,
384
- .whatsappme__copy a:hover,
385
- .whatsappme__copy a:active {
386
- color: inherit;
387
- text-decoration: none;
388
- }
389
-
390
- .whatsappme__copy svg {
391
- width: 40px;
392
- height: 10px;
393
- vertical-align: inherit;
394
- }
395
-
396
-
397
- /* Align left */
398
- .whatsappme--left {
399
- right: auto;
400
- left: 20px;
401
- }
402
-
403
- .whatsappme--left .whatsappme__button {
404
- right: auto;
405
- left: 8px;
406
- -ms-flex-direction: row-reverse;
407
- -webkit-flex-direction: row-reverse;
408
- flex-direction: row-reverse;
409
- }
410
-
411
- .whatsappme--left.whatsappme--chatbox .whatsappme__button__sendtext {
412
- padding: 0 24px 0 4px;
413
- }
414
-
415
- .whatsappme--left .whatsappme__tooltip {
416
- right: auto;
417
- left: 76px;
418
- }
419
-
420
- .whatsappme--left .whatsappme__tooltip::after {
421
- content: '\e901';
422
- left: -12px;
423
- right: auto;
424
- text-align: left;
425
- text-shadow: -2px 1px 3px rgba(0, 0, 0, .4);
426
- }
427
-
428
- .whatsappme--left .whatsappme__box {
429
- right: auto;
430
- left: 0;
431
- }
432
-
433
- .whatsappme--left .whatsappme__copy {
434
- left: auto;
435
- right: 28px;
436
- text-align: right;
437
- }
438
-
439
-
440
- /* Dark mode */
441
- .whatsappme--dark .whatsappme__header {
442
- background: #075e54;
443
- }
444
-
445
- .whatsappme--dark .whatsappme__box {
446
- background: #000;
447
- }
448
-
449
- .whatsappme--dark .whatsappme__message {
450
- background: #505050;
451
- color: #d8d8d8;
452
- }
453
-
454
- .whatsappme--dark .whatsappme__message:before {
455
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA1CAYAAADlE3NNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABVpJREFUeNrcmktv41QYhn2OHSdxkiZNkzZp0ia9UGibdBqSJqACYjGAhBgoArGhIMFixAJGbFkggTRiwRKJxYxGaH4B/4JlV/yArrpslzOZXHm/yCc6NbaTtGnHjqUjO871yftd3nNs1u/3FcaYMgMbt4wmV2ZjY9J+cMw5j8wKnAxGTJ14PF6aRTganUwm8wGfMajBQEjGlpeXj/gMhmQ7mUw2EonEHT5jhYR4esVi8ZjTNkOqqRjdSCTyKoVkt9tV+Iyp1lpbW/smGAzGe72ewmdJNcMwtgiOVBNd3e+qCUfS3traehAKhZKkmp/hZDBSrTU/P/8mqdbpdC75Mb+qJhSjvhbc29t7qKpqkLyyX+FkMJFrzzY3N79fXFx8R1bNz8oJsOdLS0sf7u7u/mwF8xMcs5R8Amujp23VarXHCEtDDkc/Knep7AcCgUSj0XgaDodzovT7Dc5OsR6U0g8ODp4sLCy8YReOfoCz9Y2MMV6tVh/l8/mjdrvt+gGaT8BIsQ5KfQhgjwuFwpetVmvkh2geBxO9rKXreqper/8FU3xvHDCvwTEb9zEAoyUD5NhTuJDquGBegrPNLwJDbn1WqVT+hNNfGpVjXoNjDs6jjVIfL5VKv2xsbPxIRtitKnoNjjktEdCJbDb7frlc/h3heIeg7Bq0F+GcoKgLt6PR6Pr29vZPq6ur39L5ScPwZcExh8ZMUF3MwRZhfu9jyvIDHV9HrduEc4IaJBCsU7ZYLH4NqO/gE4sEdV21bhqOOVTAnqmUglzaBdRXKysrx8IbThNqmnDMpaQPgTRNi2LO9Rby6TiTyXyKamjcFNR14ZgL2NCiwy4ZyWSyQq4CQPdisdjO4AU3DDUJHBsBReoMsx8FIQO3XoVKd9Pp9F1UwBIgB0BX6VXThmMO0w7FhOjJT8I5pJFDr9H0A+PtRCJxQIB0zY+AqAGL1ajb3rQxioEcZmHDMFYAs00+j0Dm5ubKgMnR4jWV75eh0Dhwdv6ujTxZz+VynwCmjuMSqtsaikGElBGqEJDTbNgrcLIbH/g7QH1cq9WeUOgJEFLHK8qMC2dVrY9Qy+7v7z9CCU9PMs3w0sYdvF4HJbyOEMx4MdyuAqdYFmI0xecbd/B+4YuLi3+bzeY5wtK3cMy8D0VWLIChUz+D9/sCefcQBWVx4g+2ubdFdvrimPZi3CZciACRd6+gOb9O93XgtVwK3aHatNwmh7S5aXhPAM8FaJ0R7SNEfRKRYOi6HiOvSS0Fg44jGGFyMvRTZODrGAArHJfggiag+OEBMw9VB0v2P6EszoZblupUujpDy3WAjSI65vFHpjH1WYZlW0FPLeA4h6qdImhhECZRWIYbfqkJEjQhdfNxwHyOuwC5+VEnb9q38aj0HUFAJwC5isq9nUqlKtiTiUgK8z0K1AonV0pNghKPucVrKiMUdJsOWYsYtzkWswyiCNAsHWa8ks/n34MxbwA+6DZrl+EU5fKNYTKkKp1nI5RjEwAyB0Bu81u4CUmwGvwtXf8+KhQKHyFvw3auiUl37Vm/xPrB7AohOQ1AVdqr0p9NYdwjE7+zs3MfVvFd6wzECucWKmzMQjKukqPCU756KsOpUspoJqS6vr7+eblcfkBVV7gqZrnf0mlBxw2GuVTJSYvMKAVVl5rwAvl42Gg0fkPlTRIgc7iZdNyCoUzpdcwF1ElBAaVLo4meXD88PPwDCsa4S4+yjt6Yo+sy7F5n956ONNrmoKnJC2k8Jxhz/8zcB87Pz/85OTn5FYL1b9s49kecG0fNrqSg+AO6kgD62dnZ36enpzXm8XucndZzrHmoW0YPPTH9nwADAK1QyP/ohXd8AAAAAElFTkSuQmCC');
456
- }
457
-
458
- .whatsappme--dark .whatsappme__copy {
459
- color: #25d366;
460
- }
461
-
462
- @media (prefers-color-scheme: dark) {
463
- .whatsappme--dark-auto .whatsappme__header {
464
- background: #075e54;
465
- }
466
-
467
- .whatsappme--dark-auto .whatsappme__box {
468
- background: #000;
469
- }
470
-
471
- .whatsappme--dark-auto .whatsappme__message {
472
- background: #505050;
473
- color: #d8d8d8;
474
- }
475
-
476
- .whatsappme--dark-auto .whatsappme__message:before {
477
- background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA1CAYAAADlE3NNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABVpJREFUeNrcmktv41QYhn2OHSdxkiZNkzZp0ia9UGibdBqSJqACYjGAhBgoArGhIMFixAJGbFkggTRiwRKJxYxGaH4B/4JlV/yArrpslzOZXHm/yCc6NbaTtGnHjqUjO871yftd3nNs1u/3FcaYMgMbt4wmV2ZjY9J+cMw5j8wKnAxGTJ14PF6aRTganUwm8wGfMajBQEjGlpeXj/gMhmQ7mUw2EonEHT5jhYR4esVi8ZjTNkOqqRjdSCTyKoVkt9tV+Iyp1lpbW/smGAzGe72ewmdJNcMwtgiOVBNd3e+qCUfS3traehAKhZKkmp/hZDBSrTU/P/8mqdbpdC75Mb+qJhSjvhbc29t7qKpqkLyyX+FkMJFrzzY3N79fXFx8R1bNz8oJsOdLS0sf7u7u/mwF8xMcs5R8Amujp23VarXHCEtDDkc/Knep7AcCgUSj0XgaDodzovT7Dc5OsR6U0g8ODp4sLCy8YReOfoCz9Y2MMV6tVh/l8/mjdrvt+gGaT8BIsQ5KfQhgjwuFwpetVmvkh2geBxO9rKXreqper/8FU3xvHDCvwTEb9zEAoyUD5NhTuJDquGBegrPNLwJDbn1WqVT+hNNfGpVjXoNjDs6jjVIfL5VKv2xsbPxIRtitKnoNjjktEdCJbDb7frlc/h3heIeg7Bq0F+GcoKgLt6PR6Pr29vZPq6ur39L5ScPwZcExh8ZMUF3MwRZhfu9jyvIDHV9HrduEc4IaJBCsU7ZYLH4NqO/gE4sEdV21bhqOOVTAnqmUglzaBdRXKysrx8IbThNqmnDMpaQPgTRNi2LO9Rby6TiTyXyKamjcFNR14ZgL2NCiwy4ZyWSyQq4CQPdisdjO4AU3DDUJHBsBReoMsx8FIQO3XoVKd9Pp9F1UwBIgB0BX6VXThmMO0w7FhOjJT8I5pJFDr9H0A+PtRCJxQIB0zY+AqAGL1ajb3rQxioEcZmHDMFYAs00+j0Dm5ubKgMnR4jWV75eh0Dhwdv6ujTxZz+VynwCmjuMSqtsaikGElBGqEJDTbNgrcLIbH/g7QH1cq9WeUOgJEFLHK8qMC2dVrY9Qy+7v7z9CCU9PMs3w0sYdvF4HJbyOEMx4MdyuAqdYFmI0xecbd/B+4YuLi3+bzeY5wtK3cMy8D0VWLIChUz+D9/sCefcQBWVx4g+2ubdFdvrimPZi3CZciACRd6+gOb9O93XgtVwK3aHatNwmh7S5aXhPAM8FaJ0R7SNEfRKRYOi6HiOvSS0Fg44jGGFyMvRTZODrGAArHJfggiag+OEBMw9VB0v2P6EszoZblupUujpDy3WAjSI65vFHpjH1WYZlW0FPLeA4h6qdImhhECZRWIYbfqkJEjQhdfNxwHyOuwC5+VEnb9q38aj0HUFAJwC5isq9nUqlKtiTiUgK8z0K1AonV0pNghKPucVrKiMUdJsOWYsYtzkWswyiCNAsHWa8ks/n34MxbwA+6DZrl+EU5fKNYTKkKp1nI5RjEwAyB0Bu81u4CUmwGvwtXf8+KhQKHyFvw3auiUl37Vm/xPrB7AohOQ1AVdqr0p9NYdwjE7+zs3MfVvFd6wzECucWKmzMQjKukqPCU756KsOpUspoJqS6vr7+eblcfkBVV7gqZrnf0mlBxw2GuVTJSYvMKAVVl5rwAvl42Gg0fkPlTRIgc7iZdNyCoUzpdcwF1ElBAaVLo4meXD88PPwDCsa4S4+yjt6Yo+sy7F5n956ONNrmoKnJC2k8Jxhz/8zcB87Pz/85OTn5FYL1b9s49kecG0fNrqSg+AO6kgD62dnZ36enpzXm8XucndZzrHmoW0YPPTH9nwADAK1QyP/ohXd8AAAAAElFTkSuQmCC');
478
- }
479
-
480
- .whatsappme--dark-auto .whatsappme__copy {
481
- color: #25d366;
482
- }
483
- }
484
-
485
-
486
- /* rtl */
487
- [dir=rtl] .whatsappme__close {
488
- right: auto;
489
- left: 24px;
490
- }
491
-
492
- [dir=rtl] .whatsappme__message:before {
493
- left: auto;
494
- right: -18px;
495
- transform: rotateY(180deg);
496
- }
497
-
498
- [dir=rtl] .whatsappme__button {
499
- -ms-flex-direction: row-reverse;
500
- -webkit-flex-direction: row-reverse;
501
- flex-direction: row-reverse;
502
- }
503
-
504
- [dir=rtl] .whatsappme--left .whatsappme__button {
505
- -ms-flex-direction: row;
506
- -webkit-flex-direction: row;
507
- flex-direction: row;
508
- }
509
-
510
- @media (max-width: 480px),
511
- (orientation: landscape) and (max-width: 767px) {
512
- .whatsappme {
513
- bottom: 6px;
514
- right: 6px;
515
- }
516
-
517
- .whatsappme--left {
518
- right: auto;
519
- left: 6px;
520
- }
521
-
522
- .whatsappme__box {
523
- width: calc(100vw - 12px);
524
- min-height: 0;
525
- }
526
-
527
- .whatsappme__header {
528
- height: 55px;
529
- }
530
-
531
- .whatsappme__close {
532
- top: 13px;
533
- width: 28px;
534
- height: 28px;
535
- }
536
-
537
- .whatsappme__box__scroll {
538
- max-height: calc(100vh - 67px);
539
- padding: 15px 0 70px 0;
540
- }
541
-
542
- .whatsappme__message {
543
- padding: 16px;
544
- margin: 0 20px 20px;
545
- line-height: 24px;
546
- }
547
- }
548
-
549
- @media (max-width: 360px) {
550
- .whatsappme__copy {
551
- width: 70px;
552
- }
553
- }
554
-
555
- @keyframes wame_badge_in {
556
- from {
557
- opacity: 0;
558
- transform: translateY(50px);
559
- }
560
-
561
- to {
562
- opacity: 1;
563
- transform: translateY(0);
564
- }
565
- }
566
-
567
- @keyframes wame_badge_out {
568
- from {
569
- opacity: 1;
570
- transform: translateY(0);
571
- }
572
-
573
- to {
574
- opacity: 0;
575
- transform: translateY(-20px);
576
- }
577
- }
578
-
579
- @keyframes wame_plain {
580
- 0%,
581
- 50%,
582
- 100% {
583
- stroke-dashoffset: 1097;
584
- }
585
-
586
- 5%,
587
- 45% {
588
- stroke-dashoffset: 0;
589
- }
590
- }
591
-
592
- @keyframes wame_chat {
593
- 0%,
594
- 50%,
595
- 100% {
596
- stroke-dashoffset: 1020;
597
- }
598
-
599
- 5%,
600
- 45% {
601
- stroke-dashoffset: 0;
602
- }
603
- }
604
-
605
- @keyframes wame_image_loop {
606
- 0% {
607
- opacity: 0;
608
- }
609
-
610
- 3%,
611
- 20% {
612
- opacity: 1;
613
- }
614
-
615
- 23%,
616
- 100% {
617
- opacity: 0;
618
- }
619
- }
620
-
621
- @keyframes wame_tootlip {
622
- 0% {
623
- opacity: 0;
624
- transform: scaleY(0);
625
- }
626
-
627
- 1%,
628
- 20% {
629
- opacity: 1;
630
- transform: scaleY(1);
631
- }
632
-
633
- 23%,
634
- 100% {
635
- opacity: 0;
636
- transform: scaleY(1);
637
- }
638
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/css/whatsappme.min.css DELETED
@@ -1 +0,0 @@
1
- @font-face{font-family:WAmeIcons;src:url(data:font/woff;base64,d09GRgABAAAAAARgAAsAAAAABBQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIFgGNtYXAAAAFoAAAAVAAAAFQXVtKIZ2FzcAAAAbwAAAAIAAAACAAAABBnbHlmAAABxAAAAHQAAAB0gkciwGhlYWQAAAI4AAAANgAAADYVuuUSaGhlYQAAAnAAAAAkAAAAJAbCA8dobXR4AAAClAAAABgAAAAYDgACM2xvY2EAAAKsAAAADgAAAA4AYgBAbWF4cAAAArwAAAAgAAAAIAAIAAVuYW1lAAAC3AAAAWIAAAFicC7V7nBvc3QAAARAAAAAIAAAACAAAwAAAAMDVQGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6QEDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEADgAAAAKAAgAAgACAAEAIOkB//3//wAAAAAAIOkA//3//wAB/+MXBAADAAEAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQEzAM0DAALNAAIAAAkBEQMA/jMBzf8AAgAAAAEBAADNAs0CzQACAAABEQECzf4zAs3+AAEAAAABAAAAAQAAtqSnv18PPPUACwQAAAAAANnOUKQAAAAA2c5QpAAAAAADAALNAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAMAAAEAAAAAAAAAAAAAAAAAAAAGBAAAAAAAAAAAAAAAAgAAAAQAATMEAAEAAAAAAAAKABQAHgAsADoAAAABAAAABgADAAEAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAADgCuAAEAAAAAAAEABAAAAAEAAAAAAAIABwBFAAEAAAAAAAMABAAtAAEAAAAAAAQABABaAAEAAAAAAAUACwAMAAEAAAAAAAYABAA5AAEAAAAAAAoAGgBmAAMAAQQJAAEACAAEAAMAAQQJAAIADgBMAAMAAQQJAAMACAAxAAMAAQQJAAQACABeAAMAAQQJAAUAFgAXAAMAAQQJAAYACAA9AAMAAQQJAAoANACAd2FtZQB3AGEAbQBlVmVyc2lvbiAxLjAAVgBlAHIAcwBpAG8AbgAgADEALgAwd2FtZQB3AGEAbQBld2FtZQB3AGEAbQBlUmVndWxhcgBSAGUAZwB1AGwAYQByd2FtZQB3AGEAbQBlRm9udCBnZW5lcmF0ZWQgYnkgSWNvTW9vbi4ARgBvAG4AdAAgAGcAZQBuAGUAcgBhAHQAZQBkACAAYgB5ACAASQBjAG8ATQBvAG8AbgAuAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==) format('woff')}.whatsappme{position:fixed;z-index:1000;right:20px;bottom:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;font-size:16px;line-height:1.625em;color:#262626;transform:scale3d(0,0,0);transition:transform .3s ease-in-out;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none}.whatsappme *,.whatsappme :after,.whatsappme :before{box-sizing:border-box}.whatsappme svg,.whatsappme svg path{fill:currentColor!important}.whatsappme.whatsappme--show{transform:scale3d(1,1,1);transition:transform .5s cubic-bezier(.18,.89,.32,1.28)}.whatsappme__button{display:-ms-flexbox;display:-webkit-flex;display:flex;position:absolute;z-index:2;bottom:8px;right:8px;height:60px;min-width:60px;max-width:95vw;background-color:#25d366;color:#fff;border-radius:30px;box-shadow:1px 6px 24px 0 rgba(7,94,84,.24);cursor:pointer;transition:background-color .2s linear;-webkit-tap-highlight-color:transparent}.whatsappme__button:hover{background-color:#128c7e;transition:background-color 1.5s linear}.whatsappme--chatbox .whatsappme__button{background-color:#128c7e;transition:background-color .2s linear}.whatsappme--chatbox .whatsappme__button:hover{background-color:#075e54}.whatsappme__button:active{background-color:#075e54;transition:none}@supports (-webkit-overflow-scrolling:touch){.whatsappme--chatbox .whatsappme__button{background-color:#34b7f1}.whatsappme--chatbox .whatsappme__button:hover,.whatsappme__button:active{background-color:#228bb9}}.whatsappme__button svg{width:36px;height:36px;margin:12px 12px}.whatsappme__button .whatsappme__button__send{margin:12px 11px 12px 13px}.whatsappme__button__image{position:absolute;top:1px;right:1px;width:58px;height:58px;border-radius:50%;overflow:hidden;opacity:0}.whatsappme__button__image img{display:block;width:100%;height:100%;object-fit:cover}.whatsappme--show .whatsappme__button__image{animation:wame_image_loop 20s linear 5s infinite normal both}.whatsappme--image .whatsappme__button__image{opacity:1;animation:none}.whatsappme__button__sendtext{padding:0;max-width:0;font-weight:600;line-height:60px;white-space:nowrap;opacity:0;overflow:hidden;transition:none}.whatsappme--chatbox .whatsappme__button__sendtext{padding:0 4px 0 24px;max-width:200px;opacity:1;transition:max-width .2s linear,opacity .4s ease-out .2s}.whatsappme__badge{position:absolute;top:-4px;right:-4px;width:20px;height:20px;border:none;border-radius:50%;background:#e82c0c;font-size:12px;font-weight:600;line-height:20px;text-align:center;box-shadow:none;opacity:0;pointer-events:none}.whatsappme__badge.whatsappme__badge--in{animation:wame_badge_in .5s cubic-bezier(.27,.9,.41,1.28) 1 both}.whatsappme__badge.whatsappme__badge--out{animation:wame_badge_out .4s cubic-bezier(.215,.61,.355,1) 1 both}.whatsappme--chatbox .whatsappme__button{box-shadow:0 1px 2px 0 rgba(0,0,0,.3)}.whatsappme .whatsappme__button__send path{fill:none!important;stroke:#fff!important}.whatsappme .whatsappme__button__send .wame_svg__plain{stroke-dasharray:1097;stroke-dashoffset:1097;animation:wame_plain 6s .2s ease-in-out infinite}.whatsappme .whatsappme__button__send .wame_svg__chat{stroke-dasharray:1020;stroke-dashoffset:1020;animation:wame_chat 6s 3.2s ease-in-out infinite}.whatsappme__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:#075e54;line-height:31px;white-space:nowrap;box-shadow:0 1px 4px 0 rgba(0,0,0,.4);opacity:0}.whatsappme__tooltip::after{font:normal normal 400 20px/1em WAmeIcons;content:'\e900';position:absolute;top:6px;right:-12px;color:#fff;text-align:right;text-shadow:2px 1px 3px rgba(0,0,0,.4)}.whatsappme__tooltip div{overflow:hidden;text-overflow:ellipsis}.whatsappme--tooltip .whatsappme__tooltip{animation:wame_tootlip 20s linear 5s 1 normal both}.whatsappme--chatbox .whatsappme__button__send,.whatsappme__button__open{display:block}.whatsappme--chatbox .whatsappme__button__image,.whatsappme--chatbox .whatsappme__button__open,.whatsappme--chatbox .whatsappme__tooltip,.whatsappme__button__send{display:none}.whatsappme__box{position:absolute;bottom:0;right:0;z-index:1;width:calc(100vw - 40px);max-width:400px;min-height:270px;border-radius:32px;background:#ede4dd url(../images/background.png) center repeat-y;background-size:100% auto;box-shadow:0 2px 6px 0 rgba(0,0,0,.5);overflow:hidden;transform:scale3d(0,0,0);opacity:0;transition:opacity .4s ease-out,transform 0s linear .3s}.whatsappme--webp .whatsappme__box{background-image:url(../images/background.webp)}.whatsappme--chatbox .whatsappme__box{opacity:1;transform:scale3d(1,1,1);transition:opacity .2s ease-out,transform 0s linear}.whatsappme__header{float:none;display:block;position:static;width:100%;height:70px;padding:0 26px;margin:0;background-color:#2e8c7d;color:rgba(255,255,255,.5)}.whatsappme__header svg{width:120px;height:100%}.whatsappme__close{display:-ms-flexbox;display:-webkit-flex;display:flex;position:absolute;top:18px;right:24px;width:34px;height:34px;border-radius:50%;background:#000;color:#fff;text-align:center;opacity:.4;cursor:pointer;transition:opacity .3s ease-out;-webkit-tap-highlight-color:transparent}.whatsappme__close:hover{opacity:.6}.whatsappme__close svg{display:block;width:12px;height:12px;margin:auto}.whatsappme__box__scroll{max-height:calc(100vh - 100px);padding:20px 0 80px 0;overflow:hidden auto}.whatsappme__box__scroll::-webkit-scrollbar{width:5px;background:rgba(0,0,0,0)}.whatsappme__box__scroll::-webkit-scrollbar-thumb{border-radius:3px;background:rgba(0,0,0,0)}.whatsappme__box__scroll:hover::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2)}.whatsappme__message{position:relative;min-height:80px;padding:20px;margin:0 26px 26px;border-radius:32px;background-color:#fff;color:#4a4a4a;box-shadow:0 1px 2px 0 rgba(0,0,0,.3)}.whatsappme__message:before{content:'';display:block;position:absolute;bottom:30px;left:-18px;width:18px;height:18px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA1CAYAAADlE3NNAAAEr0lEQVRo3t2aT0gjVxzHf++9mcn8zWhW6bpELWzcogFNaRar7a4tBNy2WATbHpacpdZ6redeZE+9CL02B1ktXsRD/xwsilhoSwsqag/xYK09hCQlmCiTf28vGRnGmZhE183MFx5vmGQy7zO/P/P7PYLAHUIAQCqDAwDPxMREG3IpHL+zs/MZcgkYAgAMAIwOl8lkYm6xGgYAFgAEAGgZHx9/vVwun7nJJTkAEAGgdW9v73NKKXWLSzIA4AEAGQDazs/P/3ALnNEl1a2trY9oRW6wmu6SEgC0ZrPZn9wCp2dIHgCU1dXVtymlZafDIatEksvlfqYGueG9xgOAcnBw8JSa5GR3vIi1aDTaUSwWj5wOZ3RHPUN6U6nUN9RCTnZHDwDI+/v745TSkpPhrOpHcWlpqbdcLieojZwGpseZMDo66svn87/RKnIaGAsAfCAQ8J6dnX1Pr5DjwABAzmazMVqDHAd2enr6La1RjgGLRCJqLpeL0TrUjFDGrMgCAD8/P38vn8//QutUs1pLT/fC5ubmQKFQOKANqNmspbuhBwDEZDL5BaX0lDaoZoK62NxZXFzs1DRthV5TrxrKGFue/v5+KZ1Of1kul5P0BtQUUAAgxOPx9wuFwl/0BvWq3O8C6vDw8F1N036gL0G3ZaVLUEdHRxFN036kL1E3DWMHxAEAPzc3dyedTk+XSqUdegu6CRijy5mBPLOzs2oikfhU07RFSmmG3qKuaxkdxuhy/MzMjDeRSHyiadrz2wYyClUBMh9bzRfAu7u7PX6//z1RFB9zHBcBALUZKoRqUMgEgyvHeHt7+353d/cjQRBGWJZ9jBDqaMYKHKpYBAEAXltbawsGg2FFUd7iOO4hIeQhQuiOEzpdOzCSTCaftLS0fEUIGXbiHiBjU5njVCr1sc/nW6wkDcduS1u1HKRUKv2KMR4ABwvbAWKMA+BwYbsasFgs/uMWuEtxd3x8/J3b4C4Ag8Hg83g8/iyfz//n5IRi1eZzla00HgA8oijyDMNwlFJCCGH0axiGQQAAXq+XyLLMeL1eRlEURpZlRpIkhud5oigK297eLvl8Prm1tVVSFEWSJEkWRVESBMGrqupriqLcFQThLsaYu612n6vUip4KMFv5HJssjhooEi5laoZh0NjYWNvw8PC9np6ejkAg8MDv9w+oqnrfxsNqhgNTh2wE1MGYChyyWGA9RYJVFWTM3MhwjMPhsDw9PT0QDocHOjs731RV9Y1rv+cMlb4Oiy3garWW1b2sPMfceZgHmZqa6pycnPywr6/vA47jfPXAWbU0xOCOqE44u2K8Wl9oBUfMa+rq6hIWFhbGBwcHn9pBohogcRWwRiCRTUiACQ6ZYpxY9JAkFAopy8vLM4FAYKyRrgA1GGf1JperLGgEM4cNG4vF3olGo18TQkT9JsRmAdQw66NsGlbn7Ibdd0um2XzOblz6/ZWVlX8JIb8PDQ090gFJDU+e2sBeZ1hBU9NcqvIQzDMFALq+vp7GGP85MjLyBCHE1tPO1LP4eq4FG/hqnlGyeSiwsbHxfygUOu7t7Y00059JUY3ZHFm8k1lT0cGfnJw8c0ojepWFzd6CMpnM3y8AJPEkZ9khO4IAAAAASUVORK5CYII=);background-size:100%}.whatsappme__message a{text-decoration:underline;color:#2e8c7d}.whatsappme__copy{position:absolute;bottom:9px;left:28px;color:#2e8c7d;font-size:11px;letter-spacing:.2px;line-height:16px;opacity:.4;transition:opacity .25s}.whatsappme__copy:hover{opacity:.8;transition:opacity .5s ease-out .5s}.whatsappme__copy a,.whatsappme__copy a:active,.whatsappme__copy a:hover{color:inherit;text-decoration:none}.whatsappme__copy svg{width:40px;height:10px;vertical-align:inherit}.whatsappme--left{right:auto;left:20px}.whatsappme--left .whatsappme__button{right:auto;left:8px;-ms-flex-direction:row-reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.whatsappme--left.whatsappme--chatbox .whatsappme__button__sendtext{padding:0 24px 0 4px}.whatsappme--left .whatsappme__tooltip{right:auto;left:76px}.whatsappme--left .whatsappme__tooltip::after{content:'\e901';left:-12px;right:auto;text-align:left;text-shadow:-2px 1px 3px rgba(0,0,0,.4)}.whatsappme--left .whatsappme__box{right:auto;left:0}.whatsappme--left .whatsappme__copy{left:auto;right:28px;text-align:right}.whatsappme--dark .whatsappme__header{background:#075e54}.whatsappme--dark .whatsappme__box{background:#000}.whatsappme--dark .whatsappme__message{background:#505050;color:#d8d8d8}.whatsappme--dark .whatsappme__message:before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA1CAYAAADlE3NNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABVpJREFUeNrcmktv41QYhn2OHSdxkiZNkzZp0ia9UGibdBqSJqACYjGAhBgoArGhIMFixAJGbFkggTRiwRKJxYxGaH4B/4JlV/yArrpslzOZXHm/yCc6NbaTtGnHjqUjO871yftd3nNs1u/3FcaYMgMbt4wmV2ZjY9J+cMw5j8wKnAxGTJ14PF6aRTganUwm8wGfMajBQEjGlpeXj/gMhmQ7mUw2EonEHT5jhYR4esVi8ZjTNkOqqRjdSCTyKoVkt9tV+Iyp1lpbW/smGAzGe72ewmdJNcMwtgiOVBNd3e+qCUfS3traehAKhZKkmp/hZDBSrTU/P/8mqdbpdC75Mb+qJhSjvhbc29t7qKpqkLyyX+FkMJFrzzY3N79fXFx8R1bNz8oJsOdLS0sf7u7u/mwF8xMcs5R8Amujp23VarXHCEtDDkc/Knep7AcCgUSj0XgaDodzovT7Dc5OsR6U0g8ODp4sLCy8YReOfoCz9Y2MMV6tVh/l8/mjdrvt+gGaT8BIsQ5KfQhgjwuFwpetVmvkh2geBxO9rKXreqper/8FU3xvHDCvwTEb9zEAoyUD5NhTuJDquGBegrPNLwJDbn1WqVT+hNNfGpVjXoNjDs6jjVIfL5VKv2xsbPxIRtitKnoNjjktEdCJbDb7frlc/h3heIeg7Bq0F+GcoKgLt6PR6Pr29vZPq6ur39L5ScPwZcExh8ZMUF3MwRZhfu9jyvIDHV9HrduEc4IaJBCsU7ZYLH4NqO/gE4sEdV21bhqOOVTAnqmUglzaBdRXKysrx8IbThNqmnDMpaQPgTRNi2LO9Rby6TiTyXyKamjcFNR14ZgL2NCiwy4ZyWSyQq4CQPdisdjO4AU3DDUJHBsBReoMsx8FIQO3XoVKd9Pp9F1UwBIgB0BX6VXThmMO0w7FhOjJT8I5pJFDr9H0A+PtRCJxQIB0zY+AqAGL1ajb3rQxioEcZmHDMFYAs00+j0Dm5ubKgMnR4jWV75eh0Dhwdv6ujTxZz+VynwCmjuMSqtsaikGElBGqEJDTbNgrcLIbH/g7QH1cq9WeUOgJEFLHK8qMC2dVrY9Qy+7v7z9CCU9PMs3w0sYdvF4HJbyOEMx4MdyuAqdYFmI0xecbd/B+4YuLi3+bzeY5wtK3cMy8D0VWLIChUz+D9/sCefcQBWVx4g+2ubdFdvrimPZi3CZciACRd6+gOb9O93XgtVwK3aHatNwmh7S5aXhPAM8FaJ0R7SNEfRKRYOi6HiOvSS0Fg44jGGFyMvRTZODrGAArHJfggiag+OEBMw9VB0v2P6EszoZblupUujpDy3WAjSI65vFHpjH1WYZlW0FPLeA4h6qdImhhECZRWIYbfqkJEjQhdfNxwHyOuwC5+VEnb9q38aj0HUFAJwC5isq9nUqlKtiTiUgK8z0K1AonV0pNghKPucVrKiMUdJsOWYsYtzkWswyiCNAsHWa8ks/n34MxbwA+6DZrl+EU5fKNYTKkKp1nI5RjEwAyB0Bu81u4CUmwGvwtXf8+KhQKHyFvw3auiUl37Vm/xPrB7AohOQ1AVdqr0p9NYdwjE7+zs3MfVvFd6wzECucWKmzMQjKukqPCU756KsOpUspoJqS6vr7+eblcfkBVV7gqZrnf0mlBxw2GuVTJSYvMKAVVl5rwAvl42Gg0fkPlTRIgc7iZdNyCoUzpdcwF1ElBAaVLo4meXD88PPwDCsa4S4+yjt6Yo+sy7F5n956ONNrmoKnJC2k8Jxhz/8zcB87Pz/85OTn5FYL1b9s49kecG0fNrqSg+AO6kgD62dnZ36enpzXm8XucndZzrHmoW0YPPTH9nwADAK1QyP/ohXd8AAAAAElFTkSuQmCC)}.whatsappme--dark .whatsappme__copy{color:#25d366}@media (prefers-color-scheme:dark){.whatsappme--dark-auto .whatsappme__header{background:#075e54}.whatsappme--dark-auto .whatsappme__box{background:#000}.whatsappme--dark-auto .whatsappme__message{background:#505050;color:#d8d8d8}.whatsappme--dark-auto .whatsappme__message:before{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAA1CAYAAADlE3NNAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABVpJREFUeNrcmktv41QYhn2OHSdxkiZNkzZp0ia9UGibdBqSJqACYjGAhBgoArGhIMFixAJGbFkggTRiwRKJxYxGaH4B/4JlV/yArrpslzOZXHm/yCc6NbaTtGnHjqUjO871yftd3nNs1u/3FcaYMgMbt4wmV2ZjY9J+cMw5j8wKnAxGTJ14PF6aRTganUwm8wGfMajBQEjGlpeXj/gMhmQ7mUw2EonEHT5jhYR4esVi8ZjTNkOqqRjdSCTyKoVkt9tV+Iyp1lpbW/smGAzGe72ewmdJNcMwtgiOVBNd3e+qCUfS3traehAKhZKkmp/hZDBSrTU/P/8mqdbpdC75Mb+qJhSjvhbc29t7qKpqkLyyX+FkMJFrzzY3N79fXFx8R1bNz8oJsOdLS0sf7u7u/mwF8xMcs5R8Amujp23VarXHCEtDDkc/Knep7AcCgUSj0XgaDodzovT7Dc5OsR6U0g8ODp4sLCy8YReOfoCz9Y2MMV6tVh/l8/mjdrvt+gGaT8BIsQ5KfQhgjwuFwpetVmvkh2geBxO9rKXreqper/8FU3xvHDCvwTEb9zEAoyUD5NhTuJDquGBegrPNLwJDbn1WqVT+hNNfGpVjXoNjDs6jjVIfL5VKv2xsbPxIRtitKnoNjjktEdCJbDb7frlc/h3heIeg7Bq0F+GcoKgLt6PR6Pr29vZPq6ur39L5ScPwZcExh8ZMUF3MwRZhfu9jyvIDHV9HrduEc4IaJBCsU7ZYLH4NqO/gE4sEdV21bhqOOVTAnqmUglzaBdRXKysrx8IbThNqmnDMpaQPgTRNi2LO9Rby6TiTyXyKamjcFNR14ZgL2NCiwy4ZyWSyQq4CQPdisdjO4AU3DDUJHBsBReoMsx8FIQO3XoVKd9Pp9F1UwBIgB0BX6VXThmMO0w7FhOjJT8I5pJFDr9H0A+PtRCJxQIB0zY+AqAGL1ajb3rQxioEcZmHDMFYAs00+j0Dm5ubKgMnR4jWV75eh0Dhwdv6ujTxZz+VynwCmjuMSqtsaikGElBGqEJDTbNgrcLIbH/g7QH1cq9WeUOgJEFLHK8qMC2dVrY9Qy+7v7z9CCU9PMs3w0sYdvF4HJbyOEMx4MdyuAqdYFmI0xecbd/B+4YuLi3+bzeY5wtK3cMy8D0VWLIChUz+D9/sCefcQBWVx4g+2ubdFdvrimPZi3CZciACRd6+gOb9O93XgtVwK3aHatNwmh7S5aXhPAM8FaJ0R7SNEfRKRYOi6HiOvSS0Fg44jGGFyMvRTZODrGAArHJfggiag+OEBMw9VB0v2P6EszoZblupUujpDy3WAjSI65vFHpjH1WYZlW0FPLeA4h6qdImhhECZRWIYbfqkJEjQhdfNxwHyOuwC5+VEnb9q38aj0HUFAJwC5isq9nUqlKtiTiUgK8z0K1AonV0pNghKPucVrKiMUdJsOWYsYtzkWswyiCNAsHWa8ks/n34MxbwA+6DZrl+EU5fKNYTKkKp1nI5RjEwAyB0Bu81u4CUmwGvwtXf8+KhQKHyFvw3auiUl37Vm/xPrB7AohOQ1AVdqr0p9NYdwjE7+zs3MfVvFd6wzECucWKmzMQjKukqPCU756KsOpUspoJqS6vr7+eblcfkBVV7gqZrnf0mlBxw2GuVTJSYvMKAVVl5rwAvl42Gg0fkPlTRIgc7iZdNyCoUzpdcwF1ElBAaVLo4meXD88PPwDCsa4S4+yjt6Yo+sy7F5n956ONNrmoKnJC2k8Jxhz/8zcB87Pz/85OTn5FYL1b9s49kecG0fNrqSg+AO6kgD62dnZ36enpzXm8XucndZzrHmoW0YPPTH9nwADAK1QyP/ohXd8AAAAAElFTkSuQmCC)}.whatsappme--dark-auto .whatsappme__copy{color:#25d366}}[dir=rtl] .whatsappme__close{right:auto;left:24px}[dir=rtl] .whatsappme__message:before{left:auto;right:-18px;transform:rotateY(180deg)}[dir=rtl] .whatsappme__button{-ms-flex-direction:row-reverse;-webkit-flex-direction:row-reverse;flex-direction:row-reverse}[dir=rtl] .whatsappme--left .whatsappme__button{-ms-flex-direction:row;-webkit-flex-direction:row;flex-direction:row}@media (max-width:480px),(orientation:landscape) and (max-width:767px){.whatsappme{bottom:6px;right:6px}.whatsappme--left{right:auto;left:6px}.whatsappme__box{width:calc(100vw - 12px);min-height:0}.whatsappme__header{height:55px}.whatsappme__close{top:13px;width:28px;height:28px}.whatsappme__box__scroll{max-height:calc(100vh - 67px);padding:15px 0 70px 0}.whatsappme__message{padding:16px;margin:0 20px 20px;line-height:24px}}@media (max-width:360px){.whatsappme__copy{width:70px}}@keyframes wame_badge_in{from{opacity:0;transform:translateY(50px)}to{opacity:1;transform:translateY(0)}}@keyframes wame_badge_out{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-20px)}}@keyframes wame_plain{0%,100%,50%{stroke-dashoffset:1097}45%,5%{stroke-dashoffset:0}}@keyframes wame_chat{0%,100%,50%{stroke-dashoffset:1020}45%,5%{stroke-dashoffset:0}}@keyframes wame_image_loop{0%{opacity:0}20%,3%{opacity:1}100%,23%{opacity:0}}@keyframes wame_tootlip{0%{opacity:0;transform:scaleY(0)}1%,20%{opacity:1;transform:scaleY(1)}100%,23%{opacity:0;transform:scaleY(1)}}
 
public/images/background.png DELETED
Binary file
public/images/background.webp DELETED
Binary file
public/images/svgs.php DELETED
@@ -1,6 +0,0 @@
1
- <svg style="display:none;">
2
- <symbol id="wame_svg__logo" viewBox="0 0 24 24"><path fill="#fff" 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"/></symbol>
3
- <symbol id="wame_svg__close" viewBox="0 0 24 24"><path fill="#fff" 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"/></symbol>
4
- <symbol id="wame_svg__whatsapp" viewBox="0 0 120 28"><path fill-rule="evenodd" 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"/></symbol>
5
- <symbol id="wame_svg__wame" viewBox="0 0 72 17"><path fill-rule="evenodd" d="M25.371 10.429l2.122-6.239h.045l2.054 6.239h-4.22zm32.2 2.397c-.439.495-.88.953-1.325 1.375-.797.755-1.332 1.232-1.604 1.43-.622.438-1.156.706-1.604.805-.447.1-.787.13-1.02.09a3.561 3.561 0 0 1-.7-.239c-.66-.318-1.02-.864-1.079-1.64-.058-.774.03-1.619.263-2.533.35-1.987 1.108-4.133 2.274-6.438a73.481 73.481 0 0 0-2.8 3.04c-.816.954-1.7 2.096-2.653 3.428a44.068 44.068 0 0 0-2.77 4.441c-.738 0-1.341-.159-1.808-.477-.427-.278-.748-.695-.962-1.252-.214-.556-.165-1.41.146-2.563l.204-.626c.097-.298.204-.606.32-.924.117-.318.234-.626.35-.924.117-.298.195-.507.234-.626v.06c.272-.756.603-1.56.991-2.415a56.92 56.92 0 0 1 1.4-2.832 62.832 62.832 0 0 0-3.266 3.875 61.101 61.101 0 0 0-2.945 3.995 57.072 57.072 0 0 0-2.886 4.71c-.387 0-.736-.044-1.048-.131l.195.545h-3.72l-1.23-3.786h-6.093L23.158 17h-3.605l6.16-17h3.674l4.357 12.16c.389-1.35.97-2.736 1.74-4.16a41.336 41.336 0 0 0 2.013-4.232.465.465 0 0 0 .058-.18c0-.039.02-.098.058-.178.04-.08.078-.199.117-.358.039-.159.097-.337.175-.536.039-.12.078-.219.117-.298a.465.465 0 0 0 .058-.18c.078-.277.175-.575.292-.893.116-.318.194-.597.233-.835V.25c-.039-.04-.039-.08 0-.119l.233-.12c.117-.039.292.02.525.18.156.08.292.179.408.298.272.199.564.427.875.685.311.259.583.557.816.895a2.9 2.9 0 0 1 .467 1.043c.078.358.039.735-.117 1.133a8.127 8.127 0 0 1-.35.775c0 .08-.038.159-.116.238a2.93 2.93 0 0 1-.175.298 7.05 7.05 0 0 0-.35.656c-.039.04-.058.07-.058.09 0 .02-.02.05-.059.089a61.988 61.988 0 0 1-1.633 2.385c-.544.755-.913 1.35-1.108 1.788a79.39 79.39 0 0 1 3.5-4.233 101.59 101.59 0 0 1 3.12-3.398C45.651 1.82 46.612.986 47.468.43c.739.278 1.341.596 1.808.954.428.318.768.676 1.02 1.073.253.398.244.835-.029 1.312l-1.4 2.325a36.928 36.928 0 0 0-1.749 3.279 53.748 53.748 0 0 1 1.633-1.848 46.815 46.815 0 0 1 4.024-3.875c.7-.597 1.38-1.113 2.041-1.55.739.278 1.341.596 1.808.953.428.318.768.676 1.02 1.073.253.398.243.835-.029 1.312-.155.318-.408.795-.758 1.43a152.853 152.853 0 0 0-2.04 3.846 97.87 97.87 0 0 0-.467.924c-.35.835-.632 1.55-.846 2.146-.214.597-.282.934-.204 1.014a.63.63 0 0 0 .291-.06c.234-.119.564-.348.992-.685.428-.338.875-.736 1.341-1.193.467-.457.914-.914 1.341-1.37.217-.232.409-.45.575-.657a15.4 15.4 0 0 1 .957-2.514c.34-.696.708-1.333 1.108-1.91.399-.576.778-1.044 1.137-1.402a19.553 19.553 0 0 1 1.796-1.7 32.727 32.727 0 0 1 1.497-1.164 8.821 8.821 0 0 1 1.317-.835C66.292.989 66.83.83 67.269.83c.32 0 .649.11.988.328.34.22.649.478.928.776.28.299.519.607.718.925.2.318.3.557.3.716.04.597-.06 1.253-.3 1.97a7.14 7.14 0 0 1-1.107 2.058 8.534 8.534 0 0 1-1.826 1.76 6.522 6.522 0 0 1-2.395 1.074c-.2.08-.36.06-.48-.06a.644.644 0 0 1-.179-.477c0-.358.14-.616.42-.776.837-.318 1.536-.735 2.095-1.253.559-.517.998-1.034 1.317-1.551.4-.597.699-1.213.898-1.85 0-.199-.09-.308-.27-.328a4.173 4.173 0 0 0-.448-.03 4.83 4.83 0 0 0-1.318.597c-.399.239-.848.577-1.347 1.014-.499.438-1.028 1.015-1.586 1.73-.918 1.154-1.587 2.298-2.006 3.432-.42 1.134-.629 1.979-.629 2.536 0 .915.19 1.482.569 1.7.38.22.728.329 1.048.329.638 0 1.347-.15 2.125-.448a16.248 16.248 0 0 0 2.305-1.104 30.05 30.05 0 0 0 2.126-1.342 27.256 27.256 0 0 0 1.646-1.224c.08-.04.18-.1.3-.179l.24-.12a.54.54 0 0 1 .239-.059c.08 0 .16.02.24.06.08.04.119.16.119.358 0 .239-.08.457-.24.656a19.115 19.115 0 0 1-2.245 1.82 35.445 35.445 0 0 1-2.185 1.403c-.759.437-1.497.855-2.215 1.253a8.461 8.461 0 0 1-1.647.387c-.499.06-.968.09-1.407.09-.998 0-1.796-.16-2.395-.477-.599-.319-1.048-.706-1.347-1.164a4.113 4.113 0 0 1-.599-1.372c-.1-.457-.15-.843-.15-1.161zm-42.354-1.111L17.887 0h3.514L17.02 17h-3.56L10.7 5.428h-.046L7.94 17H4.312L0 0h3.582L6.16 11.571h.045L9.035 0h3.354l2.783 11.715h.045z"/></symbol>
6
- </svg>
 
 
 
 
 
 
public/js/joinchat.js ADDED
@@ -0,0 +1,268 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($, window) {
2
+ 'use strict';
3
+
4
+ window.joinchat_obj = window.joinchat_obj || {};
5
+
6
+ joinchat_obj = $.extend({
7
+ $div: null,
8
+ settings: null,
9
+ store: null,
10
+ chatbox: false,
11
+ is_mobile: false,
12
+ }, joinchat_obj);
13
+
14
+ joinchat_obj.$ = function (sel) {
15
+ return $(sel || this.$div, this.$div);
16
+ };
17
+
18
+ // Trigger Google Analytics event
19
+ joinchat_obj.send_event = function (link) {
20
+ var ga_tracker = window[this.settings.ga_tracker || 'ga'];
21
+
22
+ // Send Google Analtics custom event (Universal Analtics - analytics.js) or (Global Site Tag - gtag.js)
23
+ if (typeof ga_tracker == 'function' && typeof ga_tracker.getAll == 'function') {
24
+ ga_tracker('set', 'transport', 'beacon');
25
+ var trackers = ga_tracker.getAll();
26
+ trackers.forEach(function (tracker) {
27
+ tracker.send("event", 'JoinChat', 'click', link);
28
+ });
29
+ } else if (typeof gtag == 'function') {
30
+ gtag('event', 'click', {
31
+ 'event_category': 'JoinChat',
32
+ 'event_label': link,
33
+ 'transport_type': 'beacon'
34
+ });
35
+ }
36
+
37
+ // Send Google Tag Manager custom event
38
+ if (typeof dataLayer == 'object') {
39
+ dataLayer.push({
40
+ 'event': 'JoinChat',
41
+ 'eventAction': 'click',
42
+ 'eventLabel': link
43
+ });
44
+ }
45
+
46
+ // Send Facebook Pixel custom event
47
+ if (typeof fbq == 'function') {
48
+ fbq('trackCustom', 'JoinChat', { eventAction: 'click', eventLabel: link });
49
+ }
50
+ };
51
+
52
+ // Return WhatsApp link with optional message
53
+ joinchat_obj.whatsapp_link = function (phone, message, wa_web) {
54
+ wa_web = typeof wa_web != 'undefined' ? wa_web : this.settings.whatsapp_web && !this.is_mobile;
55
+ var link = wa_web ? 'https://web.whatsapp.com/send' : 'https://api.whatsapp.com/send';
56
+
57
+ return link + '?phone=' + encodeURIComponent(phone) + '&text=' + encodeURIComponent(message || '');
58
+ };
59
+
60
+ joinchat_obj.chatbox_show = function () {
61
+ if (!this.chatbox) {
62
+ this.chatbox = true;
63
+ this.$div.addClass('joinchat--chatbox');
64
+
65
+ if (this.settings.message_badge && this.$('.joinchat__badge').hasClass('joinchat__badge--in')) {
66
+ this.$('.joinchat__badge').toggleClass('joinchat__badge--in joinchat__badge--out');
67
+ }
68
+ // Trigger custom event
69
+ $(document).trigger('joinchat:show');
70
+ }
71
+ };
72
+
73
+ joinchat_obj.chatbox_hide = function () {
74
+ if (this.chatbox) {
75
+ this.chatbox = false;
76
+ this.$div.removeClass('joinchat--chatbox joinchat--tooltip');
77
+ // Trigger custom event
78
+ $(document).trigger('joinchat:hide');
79
+ }
80
+ };
81
+
82
+ joinchat_obj.save_hash = function () {
83
+ var hash = this.settings.message_hash || 'none';
84
+ var saved_hashes = (this.store.getItem('joinchat_hashes') || '').split(',').filter(Boolean);
85
+
86
+ if (saved_hashes.indexOf(hash) === -1) {
87
+ saved_hashes.push(hash);
88
+ this.store.setItem('joinchat_hashes', saved_hashes.join(','));
89
+ }
90
+ };
91
+
92
+ joinchat_obj.open_whatsapp = function (phone, msg) {
93
+ var args = { link: this.whatsapp_link(phone || this.settings.telephone, msg || this.settings.message_send) };
94
+ var secure_link = new RegExp("^https?:\/\/(wa\.me|(api|web|chat)\.whatsapp\.com|" + location.hostname.replace('.', '\.') + ")\/.*", 'i');
95
+
96
+ // Trigger custom event (args obj allow edit link by third party scripts)
97
+ $(document).trigger('joinchat:open', [args, this.settings]);
98
+
99
+ // Ensure the link is safe
100
+ if (secure_link.test(args.link)) {
101
+ // Send analytics events
102
+ this.send_event(args.link);
103
+ // Open WhatsApp link
104
+ window.open(args.link, 'joinchat');
105
+ } else {
106
+ console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com");
107
+ }
108
+ };
109
+
110
+ // Ready!!
111
+ $(function () {
112
+ joinchat_obj.$div = $('.joinchat');
113
+ joinchat_obj.settings = joinchat_obj.$div.data('settings');
114
+ joinchat_obj.is_mobile = !!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i);
115
+
116
+ // Fallback if localStorage not supported (iOS incognito)
117
+ // Implements functional storage in memory and will not persist between page loads
118
+ try {
119
+ localStorage.setItem('test', 1);
120
+ localStorage.removeItem('test');
121
+ joinchat_obj.store = localStorage;
122
+ } catch (e) {
123
+ joinchat_obj.store = {
124
+ _data: {},
125
+ setItem: function (id, val) { this._data[id] = String(val); },
126
+ getItem: function (id) { return this._data.hasOwnProperty(id) ? this._data[id] : null; }
127
+ };
128
+ }
129
+
130
+ // In some strange cases data settings are empty
131
+ if (typeof joinchat_obj.settings == 'undefined') {
132
+ try { joinchat_obj.settings = JSON.parse(joinchat_obj.$div.attr('data-settings')); }
133
+ catch (error) { joinchat_obj.settings = undefined; }
134
+ }
135
+
136
+ // Only works if joinchat is defined
137
+ if (joinchat_obj.$div.length && !!joinchat_obj.settings && !!joinchat_obj.settings.telephone) {
138
+ if (joinchat_obj.is_mobile || !joinchat_obj.settings.mobile_only) {
139
+ joinchat_magic();
140
+ } else {
141
+ // Launch WhatsApp when click on nodes with class "joinchat_open"
142
+ $(document).on('click', '.joinchat_open', function (e) {
143
+ e.preventDefault();
144
+ joinchat_obj.open_whatsapp();
145
+ });
146
+ }
147
+ }
148
+
149
+ joinchat_obj.store.setItem('joinchat_views', parseInt(joinchat_obj.store.getItem('joinchat_views') || 0) + 1);
150
+
151
+ function joinchat_magic() {
152
+ var button_delay = joinchat_obj.settings.button_delay * 1000;
153
+ var chat_delay = joinchat_obj.settings.message_delay * 1000;
154
+ var has_cta = !!joinchat_obj.settings.message_hash;
155
+ var has_chatbox = !!joinchat_obj.$('.joinchat__box').length;
156
+ var timeoutHover, timeoutCTA;
157
+
158
+ // Stored values
159
+ var has_pageviews = parseInt(joinchat_obj.store.getItem('joinchat_views') || 1) >= joinchat_obj.settings.message_views;
160
+ var saved_hashes = (joinchat_obj.store.getItem('joinchat_hashes') || '').split(',').filter(Boolean);
161
+ var is_viewed = saved_hashes.indexOf(joinchat_obj.settings.message_hash || 'none') !== -1;
162
+
163
+ function chatbox_show() {
164
+ clearTimeout(timeoutCTA);
165
+ joinchat_obj.chatbox_show();
166
+ }
167
+
168
+ function chatbox_hide() {
169
+ joinchat_obj.save_hash();
170
+ joinchat_obj.chatbox_hide();
171
+ }
172
+
173
+ function joinchat_click() {
174
+ if (has_chatbox && !joinchat_obj.chatbox) {
175
+ chatbox_show();
176
+ } else {
177
+ chatbox_hide();
178
+ joinchat_obj.open_whatsapp();
179
+ }
180
+ }
181
+
182
+ // Show button (and tooltip)
183
+ var classes = 'joinchat--show';
184
+ if (!is_viewed && (!has_cta || !chat_delay || joinchat_obj.settings.message_badge || !has_pageviews)) {
185
+ classes += ' joinchat--tooltip';
186
+ }
187
+ setTimeout(function () { joinchat_obj.$div.addClass(classes); }, button_delay);
188
+
189
+ // Show badge or chatbox
190
+ if (has_cta && !is_viewed && chat_delay) {
191
+ if (joinchat_obj.settings.message_badge) {
192
+ timeoutCTA = setTimeout(function () { joinchat_obj.$('.joinchat__badge').addClass('joinchat__badge--in'); }, button_delay + chat_delay);
193
+ } else if (has_pageviews) {
194
+ timeoutCTA = setTimeout(chatbox_show, button_delay + chat_delay);
195
+ }
196
+ }
197
+
198
+ // Open Join.chat on mouse over
199
+ if (has_chatbox && !joinchat_obj.is_mobile) {
200
+ $('.joinchat__button', joinchat_obj.$div)
201
+ .mouseenter(function () { timeoutHover = setTimeout(chatbox_show, 1500); })
202
+ .mouseleave(function () { clearTimeout(timeoutHover); });
203
+ }
204
+
205
+ $('.joinchat__button', joinchat_obj.$div).click(joinchat_click);
206
+ $('.joinchat__close', joinchat_obj.$div).click(chatbox_hide);
207
+
208
+ // Only scroll Join.chat message box (no all body)
209
+ // TODO: disable also on touch
210
+ $('.joinchat__box__scroll').on('mousewheel DOMMouseScroll', function (e) {
211
+ e.preventDefault();
212
+ var delta = e.originalEvent.wheelDelta || -e.originalEvent.detail;
213
+ this.scrollTop += (delta < 0 ? 1 : -1) * 30;
214
+ });
215
+
216
+ // Hide on mobile when virtual keyboard is open
217
+ if (joinchat_obj.is_mobile) {
218
+ var initial_height = window.innerHeight;
219
+ var timeoutKB;
220
+
221
+ $(document).on('focus blur', 'input, textarea', function (e) {
222
+ if (!$(e.target).closest(joinchat_obj.$div)) {
223
+ clearTimeout(timeoutKB);
224
+ timeoutKB = setTimeout(function () {
225
+ joinchat_obj.$div.toggleClass('joinchat--show', window.innerHeight > initial_height * 0.7);
226
+ }, 800);
227
+ }
228
+ });
229
+ }
230
+
231
+ // Open Join.chat or launch WhatsApp when click on nodes with class "joinchat_open"
232
+ $(document).on('click', '.joinchat_open', function (e) {
233
+ e.preventDefault();
234
+ if (!joinchat_obj.chatbox) joinchat_click();
235
+ });
236
+
237
+ // Close Join.chat when click on nodes with class "joinchat_close"
238
+ $(document).on('click', '.joinchat_close', function (e) {
239
+ e.preventDefault();
240
+ chatbox_hide();
241
+ });
242
+
243
+ // Open Join.chat when "joinchat_open" or "joinchat_force_show" on viewport
244
+ if (has_chatbox && 'IntersectionObserver' in window) {
245
+ var $show_on_scroll = $('.joinchat_show,.joinchat_force_show');
246
+
247
+ function joinchat_observed(objs) {
248
+ $.each(objs, function () {
249
+ if (this.intersectionRatio > 0 && (!is_viewed || $(this.target).hasClass('joinchat_force_show'))) {
250
+ chatbox_show();
251
+ observer.disconnect(); // Only one show for visit
252
+ return false;
253
+ }
254
+ });
255
+ }
256
+
257
+ if ($show_on_scroll.length > 0) {
258
+ var observer = new IntersectionObserver(joinchat_observed);
259
+ $show_on_scroll.each(function () { observer.observe(this); });
260
+ }
261
+ }
262
+
263
+ $(document).trigger('joinchat:start');
264
+ }
265
+
266
+ });
267
+
268
+ }(jQuery, window));
public/js/joinchat.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(t,o){"use strict";o.joinchat_obj=o.joinchat_obj||{},joinchat_obj=t.extend({$div:null,settings:null,store:null,chatbox:!1,is_mobile:!1},joinchat_obj),joinchat_obj.$=function(o){return t(o||this.$div,this.$div)},joinchat_obj.send_event=function(t){var e=o[this.settings.ga_tracker||"ga"];"function"==typeof e&&"function"==typeof e.getAll?(e("set","transport","beacon"),e.getAll().forEach(function(o){o.send("event","JoinChat","click",t)})):"function"==typeof gtag&&gtag("event","click",{event_category:"JoinChat",event_label:t,transport_type:"beacon"});"object"==typeof dataLayer&&dataLayer.push({event:"JoinChat",eventAction:"click",eventLabel:t}),"function"==typeof fbq&&fbq("trackCustom","JoinChat",{eventAction:"click",eventLabel:t})},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"),t(document).trigger("joinchat:show"))},joinchat_obj.chatbox_hide=function(){this.chatbox&&(this.chatbox=!1,this.$div.removeClass("joinchat--chatbox joinchat--tooltip"),t(document).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(e,n){var i={link:this.whatsapp_link(e||this.settings.telephone,n||this.settings.message_send)},a=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");t(document).trigger("joinchat:open",[i,this.settings]),a.test(i.link)?(this.send_event(i.link),o.open(i.link,"joinchat")):console.error("Join.chat: the link doesn't seem safe, it must point to the current domain or whatsapp.com")},t(function(){joinchat_obj.$div=t(".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(){var e,n,i=1e3*joinchat_obj.settings.button_delay,a=1e3*joinchat_obj.settings.message_delay,s=!!joinchat_obj.settings.message_hash,c=!!joinchat_obj.$(".joinchat__box").length,h=parseInt(joinchat_obj.store.getItem("joinchat_views")||1)>=joinchat_obj.settings.message_views,j=-1!==(joinchat_obj.store.getItem("joinchat_hashes")||"").split(",").filter(Boolean).indexOf(joinchat_obj.settings.message_hash||"none");function _(){clearTimeout(n),joinchat_obj.chatbox_show()}function r(){joinchat_obj.save_hash(),joinchat_obj.chatbox_hide()}function b(){c&&!joinchat_obj.chatbox?_():(r(),joinchat_obj.open_whatsapp())}var l="joinchat--show";j||s&&a&&!joinchat_obj.settings.message_badge&&h||(l+=" joinchat--tooltip");setTimeout(function(){joinchat_obj.$div.addClass(l)},i),s&&!j&&a&&(joinchat_obj.settings.message_badge?n=setTimeout(function(){joinchat_obj.$(".joinchat__badge").addClass("joinchat__badge--in")},i+a):h&&(n=setTimeout(_,i+a)));c&&!joinchat_obj.is_mobile&&t(".joinchat__button",joinchat_obj.$div).mouseenter(function(){e=setTimeout(_,1500)}).mouseleave(function(){clearTimeout(e)});if(t(".joinchat__button",joinchat_obj.$div).click(b),t(".joinchat__close",joinchat_obj.$div).click(r),t(".joinchat__box__scroll").on("mousewheel DOMMouseScroll",function(t){t.preventDefault();var o=t.originalEvent.wheelDelta||-t.originalEvent.detail;this.scrollTop+=30*(o<0?1:-1)}),joinchat_obj.is_mobile){var g,u=o.innerHeight;t(document).on("focus blur","input, textarea",function(e){t(e.target).closest(joinchat_obj.$div)||(clearTimeout(g),g=setTimeout(function(){joinchat_obj.$div.toggleClass("joinchat--show",o.innerHeight>.7*u)},800))})}if(t(document).on("click",".joinchat_open",function(t){t.preventDefault(),joinchat_obj.chatbox||b()}),t(document).on("click",".joinchat_close",function(t){t.preventDefault(),r()}),c&&"IntersectionObserver"in o){var d=t(".joinchat_show,.joinchat_force_show");if(d.length>0){var p=new IntersectionObserver(function(o){t.each(o,function(){if(this.intersectionRatio>0&&(!j||t(this.target).hasClass("joinchat_force_show")))return _(),p.disconnect(),!1})});d.each(function(){p.observe(this)})}}t(document).trigger("joinchat:start")}():t(document).on("click",".joinchat_open",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);
public/js/whatsappme.js DELETED
@@ -1,246 +0,0 @@
1
- (function ($, window) {
2
- 'use strict';
3
-
4
- // Math.imul polyfill (source https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul#Polyfill)
5
- Math.imul = Math.imul || function (a, b) {
6
- var ah = (a >>> 16) & 0xffff;
7
- var al = a & 0xffff;
8
- var bh = (b >>> 16) & 0xffff;
9
- var bl = b & 0xffff;
10
- return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0) | 0);
11
- };
12
-
13
- window.wame_public = window.wame_public || {};
14
-
15
- wame_public = $.extend({
16
- $wame: null,
17
- $badge: null,
18
- settings: null,
19
- store: null,
20
- chatbox: false,
21
- is_mobile: false,
22
- }, wame_public);
23
-
24
- // Trigger Google Analytics event
25
- wame_public.send_event = function (link) {
26
- var ga_tracker = window[wame_public.settings.ga_tracker || 'ga'];
27
-
28
- // Send Google Analtics custom event (Universal Analtics - analytics.js) or (Global Site Tag - gtag.js)
29
- if (typeof ga_tracker == 'function' && typeof ga_tracker.getAll == 'function') {
30
- ga_tracker('set', 'transport', 'beacon');
31
- var trackers = ga_tracker.getAll();
32
- trackers.forEach(function (tracker) {
33
- tracker.send("event", 'WhatsAppMe', 'click', link);
34
- });
35
- } else if (typeof gtag == 'function') {
36
- gtag('event', 'click', {
37
- 'event_category': 'WhatsAppMe',
38
- 'event_label': link,
39
- 'transport_type': 'beacon'
40
- });
41
- }
42
-
43
- // Send Google Tag Manager custom event
44
- if (typeof dataLayer == 'object') {
45
- dataLayer.push({
46
- 'event': 'WhatsAppMe',
47
- 'eventAction': 'click',
48
- 'eventLabel': link
49
- });
50
- }
51
-
52
- // Send Facebook Pixel custom event
53
- if (typeof fbq == 'function') {
54
- fbq('trackCustom', 'WhatsAppMe', { eventAction: 'click', eventLabel: link });
55
- }
56
- }
57
-
58
- // Return a simple hash (source https://gist.github.com/iperelivskiy/4110988#gistcomment-2697447)
59
- wame_public.hash = function (s) {
60
- for (var i = 0, h = 1; i < s.length; i++) {
61
- h = Math.imul(h + s.charCodeAt(i) | 0, 2654435761);
62
- }
63
- return (h ^ h >>> 17) >>> 0;
64
- };
65
-
66
- // Return WhatsApp link with optional message
67
- wame_public.whatsapp_link = function (phone, message, wa_web) {
68
- wa_web = typeof wa_web != 'undefined' ? wa_web : wame_public.settings.whatsapp_web && !wame_public.is_mobile;
69
- var link = wa_web ? 'https://web.whatsapp.com/send' : 'https://api.whatsapp.com/send';
70
-
71
- return link + '?phone=' + encodeURIComponent(phone) + '&text=' + encodeURIComponent(message || '');
72
- };
73
-
74
- wame_public.chatbox_show = function () {
75
- wame_public.$wame.addClass('whatsappme--chatbox');
76
- wame_public.chatbox = true;
77
-
78
- if (wame_public.settings.message_badge && wame_public.$badge.hasClass('whatsappme__badge--in')) {
79
- wame_public.$badge.toggleClass('whatsappme__badge--in whatsappme__badge--out');
80
- }
81
- // Trigger custom event
82
- $(document).trigger('whatsappme:show');
83
- };
84
-
85
- wame_public.chatbox_hide = function () {
86
- wame_public.$wame.removeClass('whatsappme--chatbox whatsappme--tooltip');
87
- wame_public.chatbox = false;
88
- // Trigger custom event
89
- $(document).trigger('whatsappme:hide');
90
- };
91
-
92
- wame_public.save_hash = function (message_hash) {
93
- var messages_viewed = (wame_public.store.getItem('whatsappme_hashes') || '').split(',').filter(Boolean);
94
-
95
- if (messages_viewed.indexOf(message_hash) == -1) {
96
- messages_viewed.push(message_hash);
97
- wame_public.store.setItem('whatsappme_hashes', messages_viewed.join(','));
98
- }
99
- };
100
-
101
- // Ready!!
102
- $(function () {
103
- wame_public.$wame = $('.whatsappme');
104
- wame_public.$badge = wame_public.$wame.find('.whatsappme__badge');
105
- wame_public.settings = wame_public.$wame.data('settings');
106
- wame_public.is_mobile = !!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i);
107
-
108
- // Fallback if localStorage not supported (iOS incognito)
109
- // Implements functional storage in memory and will not persist between page loads
110
- try {
111
- localStorage.setItem('test', 1);
112
- localStorage.removeItem('test');
113
- wame_public.store = localStorage;
114
- } catch (e) {
115
- wame_public.store = {
116
- _data: {},
117
- setItem: function (id, val) { this._data[id] = String(val); },
118
- getItem: function (id) { return this._data.hasOwnProperty(id) ? this._data[id] : null; }
119
- };
120
- }
121
-
122
- // In some strange cases data settings are empty
123
- if (typeof wame_public.settings == 'undefined') {
124
- try {
125
- wame_public.settings = JSON.parse(wame_public.$wame.attr('data-settings'));
126
- } catch (error) {
127
- wame_public.settings = undefined;
128
- }
129
- }
130
-
131
- // Only works if whatsappme is defined
132
- if (wame_public.$wame.length && !!wame_public.settings && !!wame_public.settings.telephone) {
133
- whatsappme_magic();
134
- }
135
-
136
- function whatsappme_magic() {
137
- var button_delay = wame_public.settings.button_delay * 1000;
138
- var chat_delay = wame_public.settings.message_delay * 1000;
139
- var has_cta = !!wame_public.settings.message_text;
140
- var timeoutHover, timeoutCTA;
141
-
142
- // Stored values
143
- var messages_viewed = (wame_public.store.getItem('whatsappme_hashes') || '').split(',').filter(Boolean);
144
- var is_second_visit = wame_public.store.getItem('whatsappme_visited') == 'yes';
145
-
146
- var message_hash = has_cta ? wame_public.hash(wame_public.settings.message_text).toString() : 'no_cta';
147
- var is_viewed = messages_viewed.indexOf(message_hash) > -1;
148
-
149
- wame_public.store.setItem('whatsappme_visited', 'yes');
150
-
151
- function chatbox_show() {
152
- clearTimeout(timeoutCTA);
153
- wame_public.chatbox_show();
154
- }
155
-
156
- function chatbox_hide() {
157
- wame_public.save_hash(message_hash);
158
- wame_public.chatbox_hide();
159
- }
160
-
161
- function wame_click() {
162
- if (has_cta && !wame_public.chatbox) {
163
- chatbox_show();
164
- } else {
165
- var args = { link: wame_public.whatsapp_link(wame_public.settings.telephone, wame_public.settings.message_send) };
166
- var secure_link = new RegExp("^https?:\/\/(wa\.me|(api|web|chat)\.whatsapp\.com|" + location.hostname.replace('.', '\.') + ")\/.*", 'i');
167
-
168
- if (wame_public.chatbox) {
169
- chatbox_hide();
170
- }
171
- // Trigger custom event (args obj allow edit link by third party scripts)
172
- $(document).trigger('whatsappme:open', [args, wame_public.settings]);
173
-
174
- // Ensure the link is safe
175
- if (secure_link.test(args.link)) {
176
- // Send analytics events
177
- wame_public.send_event(args.link);
178
- // Open WhatsApp link
179
- window.open(args.link, 'whatsappme');
180
- } else {
181
- console.error("WAme: the link doesn't seem safe, it must point to the current domain or whatsapp.com");
182
- }
183
- }
184
- }
185
-
186
- if (!wame_public.settings.mobile_only || wame_public.is_mobile) {
187
- var classes = 'whatsappme--show';
188
- if (!is_viewed && (!has_cta || !chat_delay || wame_public.settings.message_badge || !is_second_visit)) {
189
- classes += ' whatsappme--tooltip';
190
- }
191
- // Show button (and tooltip)
192
- setTimeout(function () { wame_public.$wame.addClass(classes); }, button_delay);
193
-
194
- if (has_cta && !is_viewed && chat_delay) {
195
- if (wame_public.settings.message_badge) {
196
- // Show badge
197
- timeoutCTA = setTimeout(function () { wame_public.$badge.addClass('whatsappme__badge--in'); }, button_delay + chat_delay);
198
- } else if (is_second_visit) {
199
- // Show chatbox
200
- timeoutCTA = setTimeout(chatbox_show, button_delay + chat_delay);
201
- }
202
- }
203
- }
204
-
205
- if (has_cta && !wame_public.is_mobile) {
206
- $('.whatsappme__button', wame_public.$wame)
207
- .mouseenter(function () { if (!wame_public.chatbox) timeoutHover = setTimeout(chatbox_show, 1500); })
208
- .mouseleave(function () { clearTimeout(timeoutHover); });
209
- }
210
-
211
- $('.whatsappme__button', wame_public.$wame).click(wame_click);
212
- $('.whatsappme__close', wame_public.$wame).click(chatbox_hide);
213
-
214
- // Only scroll WAme message box (no all body)
215
- // TODO: disable also on touch
216
- $('.whatsappme__box__scroll').on('mousewheel DOMMouseScroll', function (e) {
217
- e.preventDefault();
218
- var delta = e.originalEvent.wheelDelta || -e.originalEvent.detail;
219
- this.scrollTop += (delta < 0 ? 1 : -1) * 30;
220
- });
221
-
222
- // Hide on mobile when virtual keyboard is open
223
- if (wame_public.is_mobile) {
224
- var initial_height = window.innerHeight;
225
- var timeoutKB;
226
-
227
- $(document).on('focus blur', 'input, textarea', function () {
228
- clearTimeout(timeoutKB);
229
- timeoutKB = setTimeout(function () {
230
- wame_public.$wame.toggleClass('whatsappme--show', initial_height * 0.7 < window.innerHeight);
231
- }, 800);
232
- });
233
- }
234
-
235
- // Open WAme when click on nodes with class "wame_open"
236
- $(document).on('click', '.wame_open', function (e) {
237
- e.preventDefault();
238
- if (!wame_public.chatbox) wame_click();
239
- });
240
-
241
- $(document).trigger('whatsappme:start');
242
- }
243
-
244
- });
245
-
246
- }(jQuery, window));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
public/js/whatsappme.min.js DELETED
@@ -1 +0,0 @@
1
- !function(e,t){"use strict";Math.imul=Math.imul||function(e,t){var a=65535&e,i=65535&t;return a*i+((e>>>16&65535)*i+a*(t>>>16&65535)<<16>>>0)|0},t.wame_public=t.wame_public||{},wame_public=e.extend({$wame:null,$badge:null,settings:null,store:null,chatbox:!1,is_mobile:!1},wame_public),wame_public.send_event=function(e){var a=t[wame_public.settings.ga_tracker||"ga"];"function"==typeof a&&"function"==typeof a.getAll?(a("set","transport","beacon"),a.getAll().forEach(function(t){t.send("event","WhatsAppMe","click",e)})):"function"==typeof gtag&&gtag("event","click",{event_category:"WhatsAppMe",event_label:e,transport_type:"beacon"});"object"==typeof dataLayer&&dataLayer.push({event:"WhatsAppMe",eventAction:"click",eventLabel:e}),"function"==typeof fbq&&fbq("trackCustom","WhatsAppMe",{eventAction:"click",eventLabel:e})},wame_public.hash=function(e){for(var t=0,a=1;t<e.length;t++)a=Math.imul(a+e.charCodeAt(t)|0,2654435761);return(a^a>>>17)>>>0},wame_public.whatsapp_link=function(e,t,a){return((a=void 0!==a?a:wame_public.settings.whatsapp_web&&!wame_public.is_mobile)?"https://web.whatsapp.com/send":"https://api.whatsapp.com/send")+"?phone="+encodeURIComponent(e)+"&text="+encodeURIComponent(t||"")},wame_public.chatbox_show=function(){wame_public.$wame.addClass("whatsappme--chatbox"),wame_public.chatbox=!0,wame_public.settings.message_badge&&wame_public.$badge.hasClass("whatsappme__badge--in")&&wame_public.$badge.toggleClass("whatsappme__badge--in whatsappme__badge--out"),e(document).trigger("whatsappme:show")},wame_public.chatbox_hide=function(){wame_public.$wame.removeClass("whatsappme--chatbox whatsappme--tooltip"),wame_public.chatbox=!1,e(document).trigger("whatsappme:hide")},wame_public.save_hash=function(e){var t=(wame_public.store.getItem("whatsappme_hashes")||"").split(",").filter(Boolean);-1==t.indexOf(e)&&(t.push(e),wame_public.store.setItem("whatsappme_hashes",t.join(",")))},e(function(){wame_public.$wame=e(".whatsappme"),wame_public.$badge=wame_public.$wame.find(".whatsappme__badge"),wame_public.settings=wame_public.$wame.data("settings"),wame_public.is_mobile=!!navigator.userAgent.match(/Android|iPhone|BlackBerry|IEMobile|Opera Mini/i);try{localStorage.setItem("test",1),localStorage.removeItem("test"),wame_public.store=localStorage}catch(e){wame_public.store={_data:{},setItem:function(e,t){this._data[e]=String(t)},getItem:function(e){return this._data.hasOwnProperty(e)?this._data[e]:null}}}if(void 0===wame_public.settings)try{wame_public.settings=JSON.parse(wame_public.$wame.attr("data-settings"))}catch(e){wame_public.settings=void 0}wame_public.$wame.length&&wame_public.settings&&wame_public.settings.telephone&&function(){var a,i,s=1e3*wame_public.settings.button_delay,n=1e3*wame_public.settings.message_delay,p=!!wame_public.settings.message_text,c=(wame_public.store.getItem("whatsappme_hashes")||"").split(",").filter(Boolean),o="yes"==wame_public.store.getItem("whatsappme_visited"),m=p?wame_public.hash(wame_public.settings.message_text).toString():"no_cta",l=c.indexOf(m)>-1;function u(){clearTimeout(i),wame_public.chatbox_show()}function w(){wame_public.save_hash(m),wame_public.chatbox_hide()}function _(){if(p&&!wame_public.chatbox)u();else{var a={link:wame_public.whatsapp_link(wame_public.settings.telephone,wame_public.settings.message_send)},i=new RegExp("^https?://(wa.me|(api|web|chat).whatsapp.com|"+location.hostname.replace(".",".")+")/.*","i");wame_public.chatbox&&w(),e(document).trigger("whatsappme:open",[a,wame_public.settings]),i.test(a.link)?(wame_public.send_event(a.link),t.open(a.link,"whatsappme")):console.error("WAme: the link doesn't seem safe, it must point to the current domain or whatsapp.com")}}if(wame_public.store.setItem("whatsappme_visited","yes"),!wame_public.settings.mobile_only||wame_public.is_mobile){var b="whatsappme--show";l||p&&n&&!wame_public.settings.message_badge&&o||(b+=" whatsappme--tooltip"),setTimeout(function(){wame_public.$wame.addClass(b)},s),p&&!l&&n&&(wame_public.settings.message_badge?i=setTimeout(function(){wame_public.$badge.addClass("whatsappme__badge--in")},s+n):o&&(i=setTimeout(u,s+n)))}p&&!wame_public.is_mobile&&e(".whatsappme__button",wame_public.$wame).mouseenter(function(){wame_public.chatbox||(a=setTimeout(u,1500))}).mouseleave(function(){clearTimeout(a)});if(e(".whatsappme__button",wame_public.$wame).click(_),e(".whatsappme__close",wame_public.$wame).click(w),e(".whatsappme__box__scroll").on("mousewheel DOMMouseScroll",function(e){e.preventDefault();var t=e.originalEvent.wheelDelta||-e.originalEvent.detail;this.scrollTop+=30*(t<0?1:-1)}),wame_public.is_mobile){var h,r=t.innerHeight;e(document).on("focus blur","input, textarea",function(){clearTimeout(h),h=setTimeout(function(){wame_public.$wame.toggleClass("whatsappme--show",.7*r<t.innerHeight)},800)})}e(document).on("click",".wame_open",function(e){e.preventDefault(),wame_public.chatbox||_()}),e(document).trigger("whatsappme:start")}()})}(jQuery,window);
 
uninstall.php CHANGED
@@ -6,7 +6,7 @@
6
  * @link https://crea.me
7
  * @since 1.0.0
8
  *
9
- * @package WhatsAppMe
10
  */
11
 
12
  // If uninstall not called from WordPress, then exit.
@@ -17,15 +17,19 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
17
  /**
18
  * By default don't delete plugin data.
19
  *
20
- * Use "add_filter( 'whatsappme_delete_all', '__return_true' );"
21
- * before uninstall WAme to completely clear all plugin data.
22
  */
23
- if ( apply_filters( 'whatsappme_delete_all', false ) ) {
24
  global $wpdb;
25
 
26
- // Delete general option 'whatsappme' added by plugin
27
- delete_option( 'whatsappme' );
28
- // Delete post meta '_whatsappme' added by plugin
29
- $wpdb->delete( $wpdb->prefix . 'postmeta', array( 'meta_key' => '_whatsappme' ) );
30
 
 
 
 
 
31
  }
6
  * @link https://crea.me
7
  * @since 1.0.0
8
  *
9
+ * @package JoinChat
10
  */
11
 
12
  // If uninstall not called from WordPress, then exit.
17
  /**
18
  * By default don't delete plugin data.
19
  *
20
+ * Use "add_filter( 'joinchat_delete_all', '__return_true' );"
21
+ * before uninstall Join.chat to completely clear all plugin data.
22
  */
23
+ if ( apply_filters( 'joinchat_delete_all', false ) ) {
24
  global $wpdb;
25
 
26
+ // Delete general option 'joinchat' added by plugin
27
+ delete_option( 'joinchat' );
28
+ // Delete post meta '_joinchat' added by plugin
29
+ $wpdb->delete( $wpdb->prefix . 'postmeta', array( 'meta_key' => '_joinchat' ) );
30
 
31
+ // TODO: delete WPML/Polylang translations
32
+
33
+ // Clear any cached data that has been removed
34
+ wp_cache_flush();
35
  }