Changeset 3411279
- Timestamp:
- 12/04/2025 06:00:10 PM (4 months ago)
- Location:
- andy-votre-assistant-intelligent
- Files:
-
- 22 added
- 3 edited
-
tags/2.14.0 (added)
-
tags/2.14.0/Andy (added)
-
tags/2.14.0/Andy-Wordress-Extension.php (added)
-
tags/2.14.0/Andy/Andy.html (added)
-
tags/2.14.0/Andy/assets (added)
-
tags/2.14.0/Andy/assets/Andy-Widget (added)
-
tags/2.14.0/Andy/assets/Andy-Widget/fonts (added)
-
tags/2.14.0/Andy/assets/Andy-Widget/fonts/Lato-Regular.ttf (added)
-
tags/2.14.0/Andy/assets/Andy-Widget/fonts/Poppins-Regular.ttf (added)
-
tags/2.14.0/Andy/assets/Andy-Widget/images (added)
-
tags/2.14.0/Andy/assets/Andy-Widget/images/bot-profile-pic.png (added)
-
tags/2.14.0/Andy/assets/Andy-Widget/scripts (added)
-
tags/2.14.0/Andy/assets/Andy-Widget/scripts/Andy.js (added)
-
tags/2.14.0/Andy/assets/Andy-Widget/styles (added)
-
tags/2.14.0/Andy/assets/Andy-Widget/styles/Andy.css (added)
-
tags/2.14.0/Andy/assets/Wordpress (added)
-
tags/2.14.0/Andy/assets/Wordpress/scripts (added)
-
tags/2.14.0/Andy/assets/Wordpress/scripts/andy-dismiss-notice.js (added)
-
tags/2.14.0/Andy/assets/Wordpress/scripts/andy-external-wordpress-settings.js (added)
-
tags/2.14.0/Andy/assets/andy-logo.png (added)
-
tags/2.14.0/Andy/favicon.png (added)
-
tags/2.14.0/readme.txt (added)
-
trunk/Andy-Wordress-Extension.php (modified) (7 diffs)
-
trunk/Andy/assets/Andy-Widget/scripts/Andy.js (modified) (5 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
andy-votre-assistant-intelligent/trunk/Andy-Wordress-Extension.php
r3411265 r3411279 4 4 * Plugin Name: Andy, Votre Assistant Intelligent 5 5 * Description: Installe Andy sur votre site WordPress. 6 * Version: 2.1 3.06 * Version: 2.14.0 7 7 * Author: Maxime MORLET (MaxiCom) 8 8 * License: GPLv2 or later … … 264 264 if (version_compare($wp_version, '6.3', '>=')) { 265 265 // Modern WordPress 6.3+ way 266 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.1 3.0', [266 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.14.0', [ 267 267 'strategy' => 'defer', 268 268 ]); … … 272 272 } else { 273 273 // Old WordPress way 274 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.1 3.0', true);274 wp_enqueue_script('andy-script', $plugin_url . 'Andy/assets/Andy-Widget/scripts/Andy.js', [], '2.14.0', true); 275 275 276 276 // Add defer manually … … 290 290 'openChatBoxOnLoad' => $open_chat_box, 291 291 'userId' => get_current_user_id(), 292 'language' => andy_get_user_language(), // Pass language to widget293 292 ]); 294 293 } … … 456 455 <?php 457 456 // Enqueue the script to handle the notice dismissal 458 wp_enqueue_script('andy-dismiss-notice', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-dismiss-notice.js', [], '2.1 3.0', true);457 wp_enqueue_script('andy-dismiss-notice', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-dismiss-notice.js', [], '2.14.0', true); 459 458 460 459 endif; … … 512 511 <?php 513 512 // Enqueue the script for handling the external settings form submission 514 wp_enqueue_script('andy-external-settings', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-external-wordpress-settings.js', [], '2.1 3.0', true);513 wp_enqueue_script('andy-external-settings', $plugin_url . 'Andy/assets/Wordpress/scripts/andy-external-wordpress-settings.js', [], '2.14.0', true); 515 514 } 516 515 … … 749 748 }"; 750 749 751 wp_enqueue_style('andy-style', $plugin_url . 'Andy/assets/Andy-Widget/styles/Andy.css', [], '2.1 3.0');750 wp_enqueue_style('andy-style', $plugin_url . 'Andy/assets/Andy-Widget/styles/Andy.css', [], '2.14.0'); 752 751 wp_add_inline_style('andy-style', $custom_css); 753 752 } -
andy-votre-assistant-intelligent/trunk/Andy/assets/Andy-Widget/scripts/Andy.js
r3411263 r3411279 30 30 }; 31 31 32 // Get current language from andy object or default to French 33 const currentLanguage = (typeof andy !== 'undefined' && andy.language) ? andy.language : 'fr'; 34 const t = TRANSLATIONS[currentLanguage] || TRANSLATIONS.fr; 32 // Global variables for language 33 let currentLanguage = 'fr'; 34 let t = TRANSLATIONS.fr; 35 36 // Fetch user language from API 37 async function fetchUserLanguage() { 38 try { 39 const hostname = window.location.hostname; 40 const response = await fetch(`https://dashboard.essayez-andy.fr/api/public/user-language/${encodeURIComponent(hostname)}`); 41 42 if (!response.ok) { 43 console.warn('Andy Widget - Failed to fetch language, using default (fr)'); 44 return 'fr'; 45 } 46 47 const data = await response.json(); 48 return data.language || 'fr'; 49 } catch (error) { 50 console.warn('Andy Widget - Error fetching language:', error); 51 return 'fr'; 52 } 53 } 54 55 // Initialize language and translations 56 async function initializeLanguage() { 57 currentLanguage = await fetchUserLanguage(); 58 t = TRANSLATIONS[currentLanguage] || TRANSLATIONS.fr; 59 console.log('Andy Widget - Language loaded:', currentLanguage); 60 61 // Apply translations to existing elements 62 applyTranslations(); 63 } 35 64 36 65 // DOM Elements … … 66 95 }; 67 96 68 // Labels for contact methods 69 const CONTACT_LABELS = { 70 'messenger_dm': 'Messenger', 71 'tiktok_page': 'TikTok', 72 'insta_page': 'Instagram', 73 'whatsapp_dm': 'WhatsApp', 74 'facebook_page': 'Facebook', 75 'linkedin_page': 'LinkedIn', 76 'mail': 'Email', 77 'tel': t.telephone, 78 'adresse': t.address, 79 'contact_page': t.contact, 80 'twitter': 'Twitter', 81 'youtube': 'YouTube' 82 }; 97 // Function to get contact labels (dynamic based on language) 98 function getContactLabels() { 99 return { 100 'messenger_dm': 'Messenger', 101 'tiktok_page': 'TikTok', 102 'insta_page': 'Instagram', 103 'whatsapp_dm': 'WhatsApp', 104 'facebook_page': 'Facebook', 105 'linkedin_page': 'LinkedIn', 106 'mail': 'Email', 107 'tel': t.telephone, 108 'adresse': t.address, 109 'contact_page': t.contact, 110 'twitter': 'Twitter', 111 'youtube': 'YouTube' 112 }; 113 } 83 114 /* CONST SECTION END */ 84 115 85 // Initialize contact methods when DOM is loaded86 document.addEventListener('DOMContentLoaded', function() {116 // Apply translations to DOM elements 117 function applyTranslations() { 87 118 // Set placeholder text based on language 88 119 if (chatInput) { … … 122 153 } 123 154 155 // Re-initialize contact methods with new language 156 if (typeof andyContactMethods !== 'undefined') { 157 initContactMethods(); 158 } 159 } 160 161 // Initialize contact methods when DOM is loaded 162 document.addEventListener('DOMContentLoaded', async function() { 124 163 // Add Font Awesome if not already added 125 164 if (!document.querySelector('link[href*="font-awesome"]')) { … … 130 169 } 131 170 132 // Initialize contact methods if they exist 133 if (typeof andyContactMethods !== 'undefined') { 134 initContactMethods(); 135 } 171 // Initialize language (async - will fetch from API) 172 await initializeLanguage(); 136 173 }); 137 174 … … 200 237 contactItem.target = key === 'mail' || key === 'tel' ? '_self' : '_blank'; 201 238 contactItem.rel = 'noopener noreferrer'; 202 contactItem.title = CONTACT_LABELS[key] || key.replace('_', ' '); 239 const contactLabels = getContactLabels(); 240 contactItem.title = contactLabels[key] || key.replace('_', ' '); 203 241 204 242 const icon = document.createElement('i'); -
andy-votre-assistant-intelligent/trunk/readme.txt
r3411265 r3411279 6 6 Requires PHP: 7.3 7 7 Donate link: https://essayez-andy.fr 8 Stable tag: 2.1 3.08 Stable tag: 2.14.0 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 60 60 == Changelog == 61 61 62 = 2.1 3.0 =62 = 2.14.0 = 63 63 * Rebranding complet orienté IA. 64 64 * Amélioration de la génération du contexte et de la FAQ. … … 75 75 == Upgrade Notice == 76 76 77 = 2.1 3.0 =77 = 2.14.0 = 78 78 Mise à jour recommandée : meilleure pertinence IA et branding clarifié. Aucun changement de configuration requis.
Note: See TracChangeset
for help on using the changeset viewer.