Fix tab trích dẫn/lưới ko hiển thị + Thêm viết bài theo chủ đề (laguna-s2.1free OpenRouter)

#1

Fixes

  1. Tab trích dẫn / lưới ko hiển thị gì — _gridQuotes được khai báo ở cuối file nhưng được gọi từ đầu → di chuyển lên module scope; thêm window.openModalGridDesigner / closeModalGrid expose ra global.
  2. Escape helper — rename escape() → _esc() để không shadow global escape() (chỉ escape được dấu nháy đơn).
  3. Palette duplicate class — dùng classList.toggle('active') đúng cách.

New feature

  1. Viết bài theo chủ đề — model poolside/laguna-s-2.1:free qua OpenRouter (/api/pid/gen_text), văn phong báo chí Việt Nam; fallback lần lượt: ZeroGPU SenseNova → local RSS + KNOWLEDGE_BANK. Kích hoạt khi set env OPENROUTER_API_KEY.

Testing

  • Server chạy, endpoint /api/pid/gen_text test OK (fallback synthesis).
  • All 3 JS files syntax validated.
Publish this branch
This branch is in draft mode, publish it to be able to merge.

Sign up or log in to comment