Changeset 3309069
- Timestamp:
- 06/10/2025 09:45:44 AM (10 months ago)
- Location:
- andy-votre-assistant-intelligent
- Files:
-
- 1 added
- 3 edited
-
tags/2.0.7 (added)
-
trunk/Andy-Wordress-Extension.php (modified) (5 diffs)
-
trunk/Andy/assets/Andy-Widget/scripts/Andy.js (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
andy-votre-assistant-intelligent/trunk/Andy-Wordress-Extension.php
r3297696 r3309069 4 4 * Plugin Name: Andy, Votre Assistant Intelligent 5 5 * Description: Installe Andy sur votre site WordPress. 6 * Version: 2.0. 66 * Version: 2.0.7 7 7 * Author: Maxime MORLET (MaxiCom) 8 8 * License: GPLv2 or later … … 96 96 if (version_compare($wp_version, '6.3', '>=')) { 97 97 // Modern WordPress 6.3+ way 98 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0. 6', [98 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0.7', [ 99 99 'strategy' => 'defer', 100 100 ]); 101 101 } else { 102 102 // Old WordPress way 103 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0. 6', true);103 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.0.7', true); 104 104 105 105 // Add defer manually … … 284 284 <?php 285 285 // Enqueue the script to handle the notice dismissal 286 wp_enqueue_script('andy-dismiss-notice', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-dismiss-notice.js', [], '2.0. 6', true);286 wp_enqueue_script('andy-dismiss-notice', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-dismiss-notice.js', [], '2.0.7', true); 287 287 288 288 endif; … … 340 340 <?php 341 341 // Enqueue the script for handling the external settings form submission 342 wp_enqueue_script('andy-external-settings', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-external-wordpress-settings.js', [], '2.0. 6', true);342 wp_enqueue_script('andy-external-settings', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-external-wordpress-settings.js', [], '2.0.7', true); 343 343 } 344 344 … … 443 443 $custom_css = ":root { --primary-color: " . esc_attr($primary) . " !important; }"; 444 444 445 wp_enqueue_style('andy-style', $plugin_url . 'Andy/assets/Andy-Widget/styles/Andy.css', [], '2.0. 6');445 wp_enqueue_style('andy-style', $plugin_url . 'Andy/assets/Andy-Widget/styles/Andy.css', [], '2.0.7'); 446 446 wp_add_inline_style('andy-style', $custom_css); 447 447 } -
andy-votre-assistant-intelligent/trunk/Andy/assets/Andy-Widget/scripts/Andy.js
r3297562 r3309069 282 282 console.log('WebSocket connection established'); 283 283 284 if ( 285 doesCookieExist('Andy-Conversation-Uuid') && 286 doesCookieExist('Andy-Conversation-Human-Requested') 287 ) { 288 const subscriptionMessage = { 289 action: 'subscribe-conversation', 290 291 conversationUuid: getCookie('Andy-Conversation-Uuid'), 292 }; 293 294 const jsonSubscriptionMessage = JSON.stringify(subscriptionMessage); 295 296 webSocket.send(jsonSubscriptionMessage); 297 } 298 299 if (window.andy?.userId) { 300 const userIdMessage = { 301 action: 'user-id', 302 303 siteUrl: window.location.origin, 304 305 userId: andy.userId, 284 setTimeout(() => { 285 if ( 286 doesCookieExist('Andy-Conversation-Uuid') && 287 doesCookieExist('Andy-Conversation-Human-Requested') 288 ) { 289 const subscriptionMessage = { 290 action: 'subscribe-conversation', 291 292 conversationUuid: getCookie('Andy-Conversation-Uuid'), 293 }; 294 295 const jsonSubscriptionMessage = JSON.stringify(subscriptionMessage); 296 297 webSocket.send(jsonSubscriptionMessage); 306 298 } 307 299 308 const handleUserIdResponse = (event) => { 309 const serverReply = JSON.parse(event.data); 310 311 if (serverReply.action === 'user-id') { 312 webSocket.removeEventListener('message', handleUserIdResponse); 313 314 webSocket.addEventListener('message', webSocketReceiveMessageHandler); 315 316 resolve(); // Resolve the promise when connection is ready 300 if (window.andy?.userId) { 301 const userIdMessage = { 302 action: 'user-id', 303 304 siteUrl: window.location.origin, 305 306 userId: andy.userId, 317 307 } 318 }; 319 320 webSocket.addEventListener('message', handleUserIdResponse); 321 webSocket.send(JSON.stringify(userIdMessage)); 322 } else { 323 webSocket.addEventListener('message', webSocketReceiveMessageHandler); 324 resolve(); // Resolve immediately when no user ID needed 325 } 308 309 const handleUserIdResponse = (event) => { 310 const serverReply = JSON.parse(event.data); 311 312 if (serverReply.action === 'user-id') { 313 webSocket.removeEventListener('message', handleUserIdResponse); 314 315 webSocket.addEventListener('message', webSocketReceiveMessageHandler); 316 317 resolve(); // Resolve the promise when connection is ready 318 } 319 }; 320 321 webSocket.addEventListener('message', handleUserIdResponse); 322 webSocket.send(JSON.stringify(userIdMessage)); 323 } else { 324 webSocket.addEventListener('message', webSocketReceiveMessageHandler); 325 resolve(); // Resolve immediately when no user ID needed 326 } 327 }, 1000); 326 328 }; 327 329 … … 1358 1360 if ( 1359 1361 window.andy?.openChatBoxOnLoad && 1360 !doesCookieExist('Andy-Chatbox-Closed') 1362 !doesCookieExist('Andy-Chatbox-Closed') && 1363 window.innerWidth > 550 && 1364 window.innerHeight > 720 1361 1365 ) { 1362 1366 chatBox.style.display = 'flex'; -
andy-votre-assistant-intelligent/trunk/readme.txt
r3297696 r3309069 6 6 Requires PHP: 7.3 7 7 Donate link: https://essayez-andy.fr 8 Stable tag: 2.0. 68 Stable tag: 2.0.7 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset
for help on using the changeset viewer.