| @@ -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 |
| @@ -342,21 +327,9 @@ | ||
| 342 | 327 | echo ' </div>'; |
| 343 | 328 | echo ' </div>'; |
| 344 | 329 | |
| 345 | 330 | echo ' <div id="input-container-' . esc_attr($bot_id) . '" class="input-container">'; |
| 346 | - // Max input length (plan a3fae2 part C) — global core setting, 0 = unlimited. | |
| 347 | - // Hard-caps typing/paste client-side; the chat handler enforces it server-side too. | |
| 348 | - $mxchat_max_input_length = isset($this->options['max_input_length']) ? intval($this->options['max_input_length']) : 0; | |
| 349 | - $mxchat_maxlength_attr = $mxchat_max_input_length > 0 ? ' maxlength="' . esc_attr($mxchat_max_input_length) . '"' : ''; | |
| 350 | - echo ' <textarea id="chat-input-' . esc_attr($bot_id) . '" class="chat-input" dir="auto"' . $mxchat_maxlength_attr . ' placeholder="' . esc_attr($input_copy) . '"' . ($skip_inline_colors ? '' : ' style="color: ' . esc_attr($chat_input_font_color) . ';"') . '></textarea>'; | |
| 351 | - // Language-neutral character counter (plan 7091a2). Numbers only — no | |
| 352 | - // translatable strings — so it reads correctly on every-language install. | |
| 353 | - // Only rendered when a cap is set; hidden until ~80% of the cap, then | |
| 354 | - // ramps neutral -> amber -> red. Decorative (aria-hidden); the textarea's | |
| 355 | - // maxlength carries the real semantics for assistive tech. | |
| 356 | - if ($mxchat_max_input_length > 0) { | |
| 357 | - echo ' <div id="mxchat-char-counter-' . esc_attr($bot_id) . '" class="mxchat-char-counter" aria-hidden="true"><span class="mxchat-char-counter-current">0</span><span class="mxchat-char-counter-sep">/</span><span class="mxchat-char-counter-max">' . esc_html($mxchat_max_input_length) . '</span></div>'; | |
| 358 | - } | |
| 331 | + echo ' <textarea id="chat-input-' . esc_attr($bot_id) . '" class="chat-input" dir="auto" placeholder="' . esc_attr($input_copy) . '"' . ($skip_inline_colors ? '' : ' style="color: ' . esc_attr($chat_input_font_color) . ';"') . '></textarea>'; | |
| 359 | 332 | echo ' <button id="send-button-' . esc_attr($bot_id) . '" class="send-button" aria-label="' . esc_attr__('Send message', 'mxchat') . '">'; |
| 360 | 333 | if (!empty($custom_send_image)) { |
| 361 | 334 | echo ' <img src="' . esc_url($custom_send_image) . '" alt="' . esc_attr__('Send', 'mxchat') . '" style="width: ' . intval($send_width) . 'px; height: ' . intval($send_height) . 'px; transform: rotate(' . intval($send_rotation) . 'deg);" />'; |
| 362 | 335 | } else { |
| @@ -454,19 +427,15 @@ | ||
| 454 | 427 | echo '</div>'; |
| 455 | 428 | |
| 456 | 429 | if (!empty($pre_chat_message)) { |
| 457 | 430 | // Rendered hidden by default — JS checkPreChatDismissal() handles show/hide via localStorage |
| 458 | - // data-nosnippet: the pre-chat teaser bubble is a sibling outside | |
| 459 | - // .mxchat-chatbot-wrapper, so it needs its own marker to stay out of snippets. | |
| 460 | - 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;">'; | |
| 461 | 432 | echo nl2br(esc_html($pre_chat_message)); |
| 462 | 433 | echo '<button class="close-pre-chat-message" aria-label="' . esc_attr__('Close', 'mxchat') . '">×</button>'; |
| 463 | 434 | echo '</div>'; |
| 464 | 435 | } |
| 465 | 436 | |
| 466 | - $is_initially_hidden = (strpos($visibility_class, 'hidden') !== false); | |
| 467 | - $aria_expanded = $is_initially_hidden ? 'false' : 'true'; | |
| 468 | - 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) . ';"') . '>'; | |
| 469 | 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>'; |
| 470 | 439 | |
| 471 | 440 | if (!empty($custom_icon)) { |
| 472 | 441 | echo '<img src="' . $custom_icon . '" alt="' . esc_attr__('Chatbot Icon', 'mxchat') . '" style="height: 48px; width: 48px; object-fit: contain;" />'; |