| @@ -215,12 +215,9 @@ | ||
| 215 | 215 | echo '<div id="floating-chatbot-' . esc_attr($bot_id) . '" class="floating-chatbot ' . $initial_visibility . $additional_class . '">'; |
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | // Add bot_id to the chatbot wrapper as a data attribute |
| 219 | - // data-nosnippet: keep the chat widget's UI copy (greeting, title, quick-question | |
| 220 | - // prompts, privacy notice) out of Google search snippets. This wrapper renders in both | |
| 221 | - // floating and inline/shortcode modes, so it covers all in-panel copy in one place. | |
| 222 | - echo '<div id="mxchat-chatbot-wrapper-' . esc_attr($bot_id) . '" class="mxchat-chatbot-wrapper" data-nosnippet data-bot-id="' . esc_attr($bot_id) . '">'; | |
| 219 | + echo '<div id="mxchat-chatbot-wrapper-' . esc_attr($bot_id) . '" class="mxchat-chatbot-wrapper" data-bot-id="' . esc_attr($bot_id) . '">'; | |
| 223 | 220 | |
| 224 | 221 | echo ' <div class="chatbot-top-bar" id="exit-chat-button-' . esc_attr($bot_id) . '"' . ($skip_inline_colors ? '' : ' style="background: ' . esc_attr($top_bar_bg_color) . ';"') . '>'; |
| 225 | 222 | echo ' <div class="chatbot-title-container">'; |
| 226 | 223 | echo ' <div class="chatbot-title-group">'; |
| @@ -233,25 +230,13 @@ | ||
| 233 | 230 | if (!empty(trim($ai_agent_text))) { |
| 234 | 231 | echo '<span class="chat-mode-indicator" id="chat-mode-indicator-' . esc_attr($bot_id) . '" data-ai-text="' . esc_attr($ai_agent_text) . '"' . ($skip_inline_colors ? '' : ' style="color: ' . esc_attr($mode_indicator_font_color) . '; background-color: ' . esc_attr($mode_indicator_bg_color) . ';"') . '>' . esc_html($ai_agent_text) . '</span>'; |
| 235 | 232 | } |
| 236 | 233 | echo ' </div>'; |
| 237 | - // Overflow menu (3-dot) trigger + dropdown container. | |
| 238 | - // Sibling of .exit-chat, rendered to its left. JS hides the trigger | |
| 239 | - // if no menu items are enabled; outer click + Escape close the menu. | |
| 240 | - echo ' <div class="mxchat-header-menu-wrap" data-bot-id="' . esc_attr($bot_id) . '"' . ($skip_inline_colors ? '' : ' style="--mxchat-menu-bg: ' . esc_attr($bot_message_bg_color) . '; --mxchat-menu-fg: ' . esc_attr($bot_message_font_color) . ';"') . '>'; | |
| 241 | - echo ' <button class="mxchat-header-btn mxchat-menu-trigger" type="button" aria-haspopup="menu" aria-expanded="false" aria-label="' . esc_attr__('More options', 'mxchat') . '"' . ($skip_inline_colors ? '' : ' style="color: ' . esc_attr($close_button_color) . ';"') . '>'; | |
| 242 | - echo ' <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">'; | |
| 243 | - echo ' <circle cx="12" cy="5" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="12" cy="19" r="2"/>'; | |
| 244 | - echo ' </svg>'; | |
| 245 | - echo ' </button>'; | |
| 246 | - echo ' <div class="mxchat-header-menu" role="menu" aria-hidden="true" hidden></div>'; | |
| 247 | - echo ' </div>'; | |
| 248 | - echo ' <button class="exit-chat" type="button" aria-label="' . esc_attr__('Close', 'mxchat') . '"' . ($skip_inline_colors ? '' : ' style="color: ' . esc_attr($close_button_color) . ';"') . '>'; | |
| 249 | - echo ' <svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" id="ic-close" aria-hidden="true">'; | |
| 250 | - echo ' <line x1="6" y1="6" x2="18" y2="18"></line>'; | |
| 251 | - echo ' <line x1="18" y1="6" x2="6" y2="18"></line>'; | |
| 234 | + echo ' <button class="exit-chat" type="button" aria-label="' . esc_attr__('Minimize', 'mxchat') . '"' . ($skip_inline_colors ? '' : ' style="color: ' . esc_attr($close_button_color) . ';"') . '>'; | |
| 235 | + echo ' <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24" id="ic-minimize"' . ($skip_inline_colors ? '' : ' style="fill: ' . esc_attr($close_button_color) . ';"') . '>'; | |
| 236 | + echo ' <path d="M11.67 3.87L9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"></path>'; | |
| 252 | 237 | echo ' </svg>'; |
| 253 | - echo ' <span>' . esc_html__('Close', 'mxchat') . '</span>'; | |
| 238 | + echo ' <span>' . esc_html__('Minimize', 'mxchat') . '</span>'; | |
| 254 | 239 | echo ' </button>'; |
| 255 | 240 | echo ' </div>'; |
| 256 | 241 | |
| 257 | 242 | // 3b) Main chatbot container |
| @@ -442,19 +427,15 @@ | ||
| 442 | 427 | echo '</div>'; |
| 443 | 428 | |
| 444 | 429 | if (!empty($pre_chat_message)) { |
| 445 | 430 | // Rendered hidden by default — JS checkPreChatDismissal() handles show/hide via localStorage |
| 446 | - // data-nosnippet: the pre-chat teaser bubble is a sibling outside | |
| 447 | - // .mxchat-chatbot-wrapper, so it needs its own marker to stay out of snippets. | |
| 448 | - echo '<div id="pre-chat-message-' . esc_attr($bot_id) . '" class="pre-chat-message" data-nosnippet style="display:none;">'; | |
| 431 | + echo '<div id="pre-chat-message-' . esc_attr($bot_id) . '" class="pre-chat-message" style="display:none;">'; | |
| 449 | 432 | echo nl2br(esc_html($pre_chat_message)); |
| 450 | 433 | echo '<button class="close-pre-chat-message" aria-label="' . esc_attr__('Close', 'mxchat') . '">×</button>'; |
| 451 | 434 | echo '</div>'; |
| 452 | 435 | } |
| 453 | 436 | |
| 454 | - $is_initially_hidden = (strpos($visibility_class, 'hidden') !== false); | |
| 455 | - $aria_expanded = $is_initially_hidden ? 'false' : 'true'; | |
| 456 | - echo '<div class="floating-chatbot-button ' . esc_attr($visibility_class) . '" id="floating-chatbot-button-' . esc_attr($bot_id) . '" role="button" tabindex="0" aria-label="' . esc_attr__('Open chat', 'mxchat') . '" aria-expanded="' . esc_attr($aria_expanded) . '" aria-controls="floating-chatbot-' . esc_attr($bot_id) . '"' . ($skip_inline_colors ? '' : ' style="background: ' . esc_attr($chatbot_background_color) . '; color: ' . esc_attr($send_button_font_color) . ';"') . '>'; | |
| 437 | + echo '<div class="floating-chatbot-button ' . esc_attr($visibility_class) . '" id="floating-chatbot-button-' . esc_attr($bot_id) . '"' . ($skip_inline_colors ? '' : ' style="background: ' . esc_attr($chatbot_background_color) . '; color: ' . esc_attr($send_button_font_color) . ';"') . '>'; | |
| 457 | 438 | echo '<div id="chat-notification-badge-' . esc_attr($bot_id) . '" class="chat-notification-badge" style="display: none; position: absolute; top: -8px; right: -8px; background-color: #ff4444; color: white; border-radius: 50%; padding: 4px 8px; font-size: 12px; font-weight: bold; z-index: 10001;">1</div>'; |
| 458 | 439 | |
| 459 | 440 | if (!empty($custom_icon)) { |
| 460 | 441 | echo '<img src="' . $custom_icon . '" alt="' . esc_attr__('Chatbot Icon', 'mxchat') . '" style="height: 48px; width: 48px; object-fit: contain;" />'; |