|
93 | 93 | position: relative; |
94 | 94 | } |
95 | 95 |
|
96 | | - /* ChatGPT message styles */ |
| 96 | + /* AI message styles */ |
97 | 97 | #messages li.chat-gpt .content { |
98 | 98 | background-color: #f3f4f6; |
99 | 99 | border-bottom-left-radius: 0.25rem; |
|
431 | 431 | color: #60a5fa; |
432 | 432 | } |
433 | 433 |
|
434 | | - /* ChatGPT toggle button styles */ |
435 | | - .chatgpt-toggle-wrapper { |
| 434 | + /* AI toggle button styles */ |
| 435 | + .ai-toggle-wrapper { |
436 | 436 | position: absolute; |
437 | 437 | left: 10px; |
438 | 438 | bottom: 10px; |
439 | 439 | z-index: 1; |
440 | 440 | } |
441 | 441 |
|
442 | | - .chatgpt-toggle { |
| 442 | + .ai-toggle { |
443 | 443 | display: inline-flex; |
444 | 444 | align-items: center; |
445 | 445 | cursor: pointer; |
446 | 446 | user-select: none; |
447 | 447 | } |
448 | 448 |
|
449 | | - .chatgpt-toggle input { |
| 449 | + .ai-toggle input { |
450 | 450 | display: none; |
451 | 451 | } |
452 | 452 |
|
453 | | - .chatgpt-toggle-label { |
| 453 | + .ai-toggle-label { |
454 | 454 | display: inline-flex; |
455 | 455 | align-items: center; |
456 | 456 | gap: 0.5rem; |
|
462 | 462 | transition: all 0.2s ease; |
463 | 463 | } |
464 | 464 |
|
465 | | - .chatgpt-toggle-label i { |
| 465 | + .ai-toggle-label i { |
466 | 466 | font-size: 0.875rem; |
467 | 467 | transition: transform 0.2s ease; |
468 | 468 | } |
469 | 469 |
|
470 | | - .chatgpt-toggle input:checked + .chatgpt-toggle-label { |
| 470 | + .ai-toggle input:checked + .ai-toggle-label { |
471 | 471 | background-color: #10a37f; |
472 | 472 | color: #ffffff; |
473 | 473 | } |
474 | 474 |
|
475 | | - .chatgpt-toggle input:checked + .chatgpt-toggle-label i { |
| 475 | + .ai-toggle input:checked + .ai-toggle-label i { |
476 | 476 | transform: scale(1.1); |
477 | 477 | } |
478 | 478 |
|
479 | | - .chatgpt-toggle:hover .chatgpt-toggle-label { |
| 479 | + .ai-toggle:hover .ai-toggle-label { |
480 | 480 | background-color: #e5e7eb; |
481 | 481 | } |
482 | 482 |
|
483 | | - .chatgpt-toggle input:checked:hover + .chatgpt-toggle-label { |
| 483 | + .ai-toggle input:checked:hover + .ai-toggle-label { |
484 | 484 | background-color: #0d8c6d; |
485 | 485 | } |
486 | 486 |
|
|
1107 | 1107 | 100% { content: '.'; } |
1108 | 1108 | } |
1109 | 1109 |
|
1110 | | - /* ChatGPT toggle button styles */ |
1111 | | - .chatgpt-toggle-wrapper { |
| 1110 | + /* AI toggle button styles */ |
| 1111 | + .ai-toggle-wrapper { |
1112 | 1112 | position: absolute; |
1113 | 1113 | left: 10px; |
1114 | 1114 | bottom: 10px; |
1115 | 1115 | z-index: 1; |
1116 | 1116 | } |
1117 | 1117 |
|
1118 | | - .chatgpt-toggle { |
| 1118 | + .ai-toggle { |
1119 | 1119 | display: inline-flex; |
1120 | 1120 | align-items: center; |
1121 | 1121 | cursor: pointer; |
1122 | 1122 | user-select: none; |
1123 | 1123 | margin-bottom: 0; |
1124 | 1124 | } |
1125 | 1125 |
|
1126 | | - .chatgpt-toggle input { |
| 1126 | + .ai-toggle input { |
1127 | 1127 | display: none; |
1128 | 1128 | } |
1129 | 1129 |
|
1130 | | - .chatgpt-toggle-label { |
| 1130 | + .ai-toggle-label { |
1131 | 1131 | display: inline-flex; |
1132 | 1132 | align-items: center; |
1133 | 1133 | gap: 0.5rem; |
|
1139 | 1139 | transition: all 0.2s ease; |
1140 | 1140 | } |
1141 | 1141 |
|
1142 | | - .chatgpt-toggle-label i { |
| 1142 | + .ai-toggle-label i { |
1143 | 1143 | font-size: 0.875rem; |
1144 | 1144 | transition: transform 0.2s ease; |
1145 | 1145 | } |
1146 | 1146 |
|
1147 | | - .chatgpt-toggle input:checked + .chatgpt-toggle-label { |
| 1147 | + .ai-toggle input:checked + .ai-toggle-label { |
1148 | 1148 | background-color: #10a37f; |
1149 | 1149 | color: #ffffff; |
1150 | 1150 | } |
1151 | 1151 |
|
1152 | | - .chatgpt-toggle input:checked + .chatgpt-toggle-label i { |
| 1152 | + .ai-toggle input:checked + .ai-toggle-label i { |
1153 | 1153 | transform: scale(1.1); |
1154 | 1154 | } |
1155 | 1155 |
|
1156 | | - .chatgpt-toggle:hover .chatgpt-toggle-label { |
| 1156 | + .ai-toggle:hover .ai-toggle-label { |
1157 | 1157 | background-color: #e5e7eb; |
1158 | 1158 | } |
1159 | 1159 |
|
1160 | | - .chatgpt-toggle input:checked:hover + .chatgpt-toggle-label { |
| 1160 | + .ai-toggle input:checked:hover + .ai-toggle-label { |
1161 | 1161 | background-color: #0d8c6d; |
1162 | 1162 | } |
1163 | 1163 |
|
|
2280 | 2280 | placeholder.appendChild(content); |
2281 | 2281 | } else { |
2282 | 2282 | // Regular message |
2283 | | - if ($data.user === 'ChatGPT') { |
| 2283 | + if ($data.user === 'AI') { |
2284 | 2284 | placeholder.classList.add('chat-gpt'); |
2285 | 2285 | } |
2286 | 2286 |
|
|
2317 | 2317 | const contentSpan = placeholder.querySelector('.content'); |
2318 | 2318 |
|
2319 | 2319 | // Handle different types of messages |
2320 | | - if ($data.user === 'ChatGPT') { |
2321 | | - // ChatGPT messages - use markdown rendering |
| 2320 | + if ($data.user === 'AI') { |
| 2321 | + // AI messages - use markdown rendering |
2322 | 2322 | requestAnimationFrame(() => { |
2323 | 2323 | // First set the raw text content to preserve newlines |
2324 | 2324 | contentSpan.textContent = $text; |
|
2682 | 2682 |
|
2683 | 2683 | image = ""; |
2684 | 2684 |
|
2685 | | - // Check if ChatGPT mode is enabled via the toggle button |
2686 | | - const chatGPTMode = localStorage.getItem('chatgpt-mode') === 'enabled'; |
| 2685 | + // Check if AI mode is enabled via the toggle button |
| 2686 | + const AIMode = localStorage.getItem('ai-mode') === 'enabled'; |
2687 | 2687 |
|
2688 | | - if (chatGPTMode) { |
2689 | | - $message = "@ChatGPT " + $("#text").text() + "\n"; |
| 2688 | + if (AIMode) { |
| 2689 | + $message = "@AI " + $("#text").text() + "\n"; |
2690 | 2690 |
|
2691 | 2691 | $("#text").find("img").each(function () { |
2692 | 2692 | image = $(this).attr("src"); |
|
2704 | 2704 | text: $message, |
2705 | 2705 | time: new Date().getTime(), |
2706 | 2706 | image: image, |
2707 | | - stream: chatGPTMode ? "true" : "false" // Enable streaming for ChatGPT messages |
| 2707 | + stream: AIMode ? "true" : "false" // Enable streaming for AI messages |
2708 | 2708 | } |
2709 | 2709 | }).done(function (msg) { |
2710 | 2710 | // Input already cleared |
|
2957 | 2957 | } |
2958 | 2958 | }); |
2959 | 2959 |
|
2960 | | - // Setup ChatGPT toggle button |
2961 | | - $("#chatgpt-toggle").change(function(event) { |
2962 | | - localStorage.setItem('chatgpt-mode', event.target.checked ? 'enabled' : 'disabled'); |
2963 | | - updateChatGPTToggleState(); |
| 2960 | + // Setup AI toggle button |
| 2961 | + $("#ai-toggle").change(function(event) { |
| 2962 | + localStorage.setItem('ai-mode', event.target.checked ? 'enabled' : 'disabled'); |
| 2963 | + updateAIToggleState(); |
2964 | 2964 | }); |
2965 | 2965 |
|
2966 | 2966 | // Initialize toggle state from localStorage |
2967 | | - updateChatGPTToggleState(); |
| 2967 | + updateAIToggleState(); |
2968 | 2968 |
|
2969 | | - function updateChatGPTToggleState() { |
2970 | | - const chatGPTMode = localStorage.getItem('chatgpt-mode') || 'disabled'; |
2971 | | - $("#chatgpt-toggle").prop('checked', chatGPTMode === 'enabled'); |
| 2969 | + function updateAIToggleState() { |
| 2970 | + const AIMode = localStorage.getItem('ai-mode') || 'disabled'; |
| 2971 | + $("#ai-toggle").prop('checked', AIMode === 'enabled'); |
2972 | 2972 | } |
2973 | 2973 |
|
2974 | 2974 | $("#link").click(function () { |
|
3628 | 3628 | </div> |
3629 | 3629 | <div class="upload-progress"></div> |
3630 | 3630 | </div> |
3631 | | - <div class="chatgpt-toggle-wrapper"> |
3632 | | - <label class="chatgpt-toggle" title="Toggle ChatGPT mode"> |
3633 | | - <input type="checkbox" id="chatgpt-toggle" /> |
3634 | | - <span class="chatgpt-toggle-label"> |
| 3631 | + <div class="ai-toggle-wrapper"> |
| 3632 | + <label class="ai-toggle" title="Toggle AI mode"> |
| 3633 | + <input type="checkbox" id="ai-toggle" /> |
| 3634 | + <span class="ai-toggle-label"> |
3635 | 3635 | <i class="fas fa-brain"></i> |
3636 | 3636 | <span>AI</span> |
3637 | 3637 | </span> |
|
0 commit comments