()
| 440 | } |
| 441 | |
| 442 | function performCleanup() { |
| 443 | const inputValue = inputText.value; |
| 444 | |
| 445 | if (!inputValue.trim()) { |
| 446 | outputText.placeholder = '[ERROR: NO INPUT DETECTED]'; |
| 447 | setTimeout(() => { |
| 448 | outputText.placeholder = '[OUTPUT READY FOR DISPLAY...]'; |
| 449 | }, 2000); |
| 450 | return; |
| 451 | } |
| 452 | |
| 453 | cleanBtn.textContent = '[ PROCESSING... ]'; |
| 454 | cleanBtn.disabled = true; |
| 455 | |
| 456 | setTimeout(() => { |
| 457 | const cleanedValue = detectAndClean(inputValue); |
| 458 | |
| 459 | outputText.value = cleanedValue; |
| 460 | updateOutputVisibility(); |
| 461 | |
| 462 | saveToHistory(cleanedValue, inputValue); |
| 463 | |
| 464 | if (isFirstUse()) { |
| 465 | markFirstUseComplete(); |
| 466 | localStorage.setItem(ABOUT_VISIBLE_KEY, 'false'); |
| 467 | updateAboutSectionDisplay(); |
| 468 | } |
| 469 | |
| 470 | editedBadge.style.display = 'none'; |
| 471 | copiedBadge.style.display = 'none'; |
| 472 | |
| 473 | copyBtn.disabled = !cleanedValue; |
| 474 | |
| 475 | if (copyBtn.classList.contains('copied')) { |
| 476 | copyBtn.textContent = '[ COPY ]'; |
| 477 | copyBtn.classList.remove('copied'); |
| 478 | } |
| 479 | |
| 480 | cleanBtn.textContent = '[ Clean My Clode ]'; |
| 481 | cleanBtn.disabled = false; |
| 482 | |
| 483 | if (cleanedValue) { |
| 484 | autoCopyToClipboard(cleanedValue); |
| 485 | |
| 486 | } |
| 487 | |
| 488 | }, 500); |
| 489 | } |
| 490 | |
| 491 | function cleanLLMText(input) { |
| 492 | return input |
no test coverage detected