Files
P4RS3LT0NGV3/js
Claude afe00b3534 Fix OpenRouter API key not working for translation and improve error handling
- API key retrieval now trims whitespace (pasted keys with spaces caused auth failures)
- Fallback to Vue data property if localStorage is empty (covers forgot-to-save case)
- Auto-saves key to localStorage when found only in Vue data
- HTTP-level error handling (401/402/403) with clear user-facing messages
- Changed HTTP-Referer from window.location.origin to window.location.href
  (origin returns "null" for file:// URLs, breaking OpenRouter requests)
- Handle non-JSON error responses gracefully
- Handle string-type error responses from OpenRouter
- Added missing else branch for empty API responses
- Updated README with AI Translation, PromptCraft, and OpenRouter key setup docs

https://claude.ai/code/session_01DjqbQB8WcZoGVe78sjvh72
2026-03-21 02:11:28 +00:00
..
2026-03-20 18:16:57 -07:00

JavaScript Directory Structure

Core Modules (js/core/)

  • decoder.js - Universal decoder for automatic encoding detection
  • steganography.js - Emoji and invisible text steganography
  • emojiLibrary.js - Emoji search, filtering, and library functions
  • toolRegistry.js - Tool registration and Vue data/method merging

Utilities (js/utils/)

  • clipboard.js - ClipboardUtils.copy() - Clipboard API wrapper
  • focus.js - FocusUtils.focusWithoutScroll(), clearFocusAndSelection()
  • history.js - HistoryUtils - Copy history management
  • notifications.js - NotificationUtils - Toast notifications
  • theme.js - ThemeUtils - Dark/light theme management
  • escapeParser.js - Escape sequence parsing

Tools (js/tools/)

Tool classes extending Tool base class. Auto-discovered by build/inject-tool-scripts.js.

Data (js/data/)

  • emojiData.js - Generated emoji data (build output)
  • emojiCompatibility.js - Emoji compatibility mappings

Bundles (js/bundles/)

  • transforms-bundle.js - Bundled transformer modules (build output)

Load Order

  1. Data files (emojiData, emojiCompatibility)
  2. Generated bundles (transforms-bundle)
  3. Utilities (escapeParser, focus, notifications, history, clipboard, theme)
  4. Core modules (steganography, decoder, emojiLibrary)
  5. Tool system (Tool.js, *Tool.js files, toolRegistry)
  6. Main app (app.js)