Spaces:
Sleeping
Sleeping
Markdown Editor
Browse files- static/main.js +3 -3
static/main.js
CHANGED
|
@@ -109,11 +109,11 @@ function bindActions() {
|
|
| 109 |
};
|
| 110 |
try {
|
| 111 |
const saved = localStorage.getItem('md-theme-dark');
|
| 112 |
-
const initialDark = saved === null ?
|
| 113 |
setDark(initialDark);
|
| 114 |
const icon = themeBtn.querySelector('i');
|
| 115 |
if (icon) icon.className = initialDark ? 'fa-solid fa-moon' : 'fa-solid fa-sun';
|
| 116 |
-
} catch { setDark(
|
| 117 |
themeBtn.addEventListener('click', () => {
|
| 118 |
const isDark = document.documentElement.classList.contains('dark');
|
| 119 |
const nowDark = !isDark;
|
|
@@ -146,7 +146,7 @@ function bindActions() {
|
|
| 146 |
samplesBtn.addEventListener('click', () => samplesModal.show());
|
| 147 |
|
| 148 |
const samples = {
|
| 149 |
-
cheatsheet: `# Markdown Cheat Sheet\n\n## Headings\n# H1\n## H2\n### H3\n\n## Emphasis\n*italic* **bold** ~~strike~~ \`code\`\n\n## Lists\n- unordered\n- list\n - nested\n1. ordered\n2. list\n\n## Links & Images\n[OpenAI](https://openai.com) \n\n\n## Blockquote\n> A wise quote.\n\n## Table\n| Name | Role |\n|---|---|\n| Alice | Developer |\n| Bob | Designer |\n\n## Task List\n- [x] design\n- [ ] implement\n- [ ] test\n\n## Code Block\n\`\`\`python\nfrom math import sqrt\nprint(sqrt(9))\n\`\`\`\n\n---\n\n### Horizontal rule above`,
|
| 150 |
email: `**Subject:** Request to Schedule Project Kickoff Meeting\n\nDear [Recipient Name],\n\nI hope you're doing well. I'd like to schedule a 30βminute kickoff meeting to align on [Project/Topic].\n\n**Proposed agenda:**\n- Objectives and success criteria\n- Scope, timeline, and roles\n- Risks and dependencies\n- Next steps\n\n**Suggested times (IST):**\n- [Option 1, e.g., Tue 3:00β3:30 PM]\n- [Option 2, e.g., Wed 11:00β11:30 AM]\n\nIf these don't work, please share alternative slots and your preferred meeting platform.\n\nThanks in advance, and I look forward to our discussion.\n\nBest regards,\n\n[Your Full Name]\n[Your Role], [Your Company]\nPhone: [Your Phone]\nEmail: you@example.com\n\n---`,
|
| 151 |
readme: `# Project Title\n\n[](LICENSE) \n\nA short description of your project.\n\n## Features\n- Awesome feature\n- Fast and reliable\n\n## Installation\n\`\`\`bash\npip install -r requirements.txt\npython app.py\n\`\`\`\n\n## Usage\nDescribe how to use it.\n\n## License\nMIT Β© You`,
|
| 152 |
github_readme_pro: `# Awesome App\n\n[](https://github.com/OWNER/REPO/actions) [](LICENSE)\n\n> Oneβliner that explains what this project does.\n\n## Table of Contents\n- [Demo](#demo)\n- [Stack](#stack)\n- [Install](#install)\n- [Project Structure](#project-structure)\n- [CLI](#cli)\n- [Docs](#docs)\n\n## Demo\n\n\n## Stack\n| Layer | Tech |\n|---|---|\n| Frontend | React / Vite |\n| Backend | FastAPI |\n| DB | PostgreSQL |\n| Infra | Docker / GH Actions |\n\n## Install\n\`\`\`bash\n git clone https://github.com/OWNER/REPO && cd REPO\n cp .env.example .env\n docker compose up -d --build\n\`\`\`\n\n## Project Structure\n\`\`\`text\nREPO/\n ββ apps/\n β ββ api/\n β ββ web/\n ββ packages/\n β ββ ui/\n β ββ config/\n ββ tools/\n ββ scripts/\n\`\`\`\n\n## Docs\n### Data Flow (Mermaid)\n\`\`\`mermaid\ngraph TD\nA[Browser] --> B(Edge API)\nB --> C{Auth}\nC -->|pass| D[Service] --> E[(DB)]\nC -->|fail| F[401]\n\`\`\`\n\n## License\nMIT`,
|
|
|
|
| 109 |
};
|
| 110 |
try {
|
| 111 |
const saved = localStorage.getItem('md-theme-dark');
|
| 112 |
+
const initialDark = saved === null ? false : saved === '1';
|
| 113 |
setDark(initialDark);
|
| 114 |
const icon = themeBtn.querySelector('i');
|
| 115 |
if (icon) icon.className = initialDark ? 'fa-solid fa-moon' : 'fa-solid fa-sun';
|
| 116 |
+
} catch { setDark(false); }
|
| 117 |
themeBtn.addEventListener('click', () => {
|
| 118 |
const isDark = document.documentElement.classList.contains('dark');
|
| 119 |
const nowDark = !isDark;
|
|
|
|
| 146 |
samplesBtn.addEventListener('click', () => samplesModal.show());
|
| 147 |
|
| 148 |
const samples = {
|
| 149 |
+
cheatsheet: `# Markdown Cheat Sheet\n\n## Headings\n# H1\n## H2\n### H3\n\n## Emphasis\n*italic* **bold** ~~strike~~ \`code\`\n\n## Lists\n- unordered\n- list\n - nested\n1. ordered\n2. list\n\n## Links & Images\n[OpenAI](https://openai.com) \\n\n\n## Blockquote\n> A wise quote.\n\n## Table\n| Name | Role |\n|---|---|\n| Alice | Developer |\n| Bob | Designer |\n\n## Task List\n- [x] design\n- [ ] implement\n- [ ] test\n\n## Code Block\n\`\`\`python\nfrom math import sqrt\nprint(sqrt(9))\n\`\`\`\n\n---\n\n### Horizontal rule above`,
|
| 150 |
email: `**Subject:** Request to Schedule Project Kickoff Meeting\n\nDear [Recipient Name],\n\nI hope you're doing well. I'd like to schedule a 30βminute kickoff meeting to align on [Project/Topic].\n\n**Proposed agenda:**\n- Objectives and success criteria\n- Scope, timeline, and roles\n- Risks and dependencies\n- Next steps\n\n**Suggested times (IST):**\n- [Option 1, e.g., Tue 3:00β3:30 PM]\n- [Option 2, e.g., Wed 11:00β11:30 AM]\n\nIf these don't work, please share alternative slots and your preferred meeting platform.\n\nThanks in advance, and I look forward to our discussion.\n\nBest regards,\n\n[Your Full Name]\n[Your Role], [Your Company]\nPhone: [Your Phone]\nEmail: you@example.com\n\n---`,
|
| 151 |
readme: `# Project Title\n\n[](LICENSE) \n\nA short description of your project.\n\n## Features\n- Awesome feature\n- Fast and reliable\n\n## Installation\n\`\`\`bash\npip install -r requirements.txt\npython app.py\n\`\`\`\n\n## Usage\nDescribe how to use it.\n\n## License\nMIT Β© You`,
|
| 152 |
github_readme_pro: `# Awesome App\n\n[](https://github.com/OWNER/REPO/actions) [](LICENSE)\n\n> Oneβliner that explains what this project does.\n\n## Table of Contents\n- [Demo](#demo)\n- [Stack](#stack)\n- [Install](#install)\n- [Project Structure](#project-structure)\n- [CLI](#cli)\n- [Docs](#docs)\n\n## Demo\n\n\n## Stack\n| Layer | Tech |\n|---|---|\n| Frontend | React / Vite |\n| Backend | FastAPI |\n| DB | PostgreSQL |\n| Infra | Docker / GH Actions |\n\n## Install\n\`\`\`bash\n git clone https://github.com/OWNER/REPO && cd REPO\n cp .env.example .env\n docker compose up -d --build\n\`\`\`\n\n## Project Structure\n\`\`\`text\nREPO/\n ββ apps/\n β ββ api/\n β ββ web/\n ββ packages/\n β ββ ui/\n β ββ config/\n ββ tools/\n ββ scripts/\n\`\`\`\n\n## Docs\n### Data Flow (Mermaid)\n\`\`\`mermaid\ngraph TD\nA[Browser] --> B(Edge API)\nB --> C{Auth}\nC -->|pass| D[Service] --> E[(DB)]\nC -->|fail| F[401]\n\`\`\`\n\n## License\nMIT`,
|