Mercurial
comparison rich_editor/rich_editor.js @ 241:9c2eec61a152
[assets] Generate site images as WebP with Bazel
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Mon, 03 Aug 2026 11:26:30 -0700 |
| parents | 5d3e116dd745 |
| children |
comparison
equal
deleted
inserted
replaced
| 240:c345083cd8a7 | 241:9c2eec61a152 |
|---|---|
| 42 function createToolbar(editor) { | 42 function createToolbar(editor) { |
| 43 const toolbar = document.createElement('div'); | 43 const toolbar = document.createElement('div'); |
| 44 toolbar.className = 'rich-editor-toolbar'; | 44 toolbar.className = 'rich-editor-toolbar'; |
| 45 | 45 |
| 46 const buttons = [ | 46 const buttons = [ |
| 47 { cmd: 'h1', label: '', title: 'Heading 1', icons: "/public/icons/h1.png" }, | 47 { cmd: 'h1', label: '', title: 'Heading 1', icons: "/public/icons/h1.webp" }, |
| 48 { cmd: 'h2', label: '', title: 'Heading 2', icons: "/public/icons/h2.png" }, | 48 { cmd: 'h2', label: '', title: 'Heading 2', icons: "/public/icons/h2.webp" }, |
| 49 { cmd: 'h3', label: '', title: 'Heading 3', icons: "/public/icons/h3.png" }, | 49 { cmd: 'h3', label: '', title: 'Heading 3', icons: "/public/icons/h3.webp" }, |
| 50 { cmd: 'p', label: '¶', title: 'Paragraph' }, | 50 { cmd: 'p', label: '¶', title: 'Paragraph' }, |
| 51 { cmd: 'ul', label: '•', title: 'Bullet List' }, | 51 { cmd: 'ul', label: '•', title: 'Bullet List' }, |
| 52 { cmd: 'ol', label: '1.', title: 'Numbered List' }, | 52 { cmd: 'ol', label: '1.', title: 'Numbered List' }, |
| 53 { cmd: 'bold', label: '', title: 'Bold', icons: "/public/icons/bold.png" }, | 53 { cmd: 'bold', label: '', title: 'Bold', icons: "/public/icons/bold.webp" }, |
| 54 { cmd: 'separator' }, | 54 { cmd: 'separator' }, |
| 55 { cmd: 'link', label: '', title: 'Insert Link', icons: "/public/icons/link.png" }, | 55 { cmd: 'link', label: '', title: 'Insert Link', icons: "/public/icons/link.webp" }, |
| 56 { cmd: 'notelink', label: '', title: 'Link to Note', icons: "/public/icons/binder.png" }, | 56 { cmd: 'notelink', label: '', title: 'Link to Note', icons: "/public/icons/binder.webp" }, |
| 57 { cmd: 'upload', label: '', title: 'Upload File', icons: "/public/icons/clipy.png" }, | 57 { cmd: 'upload', label: '', title: 'Upload File', icons: "/public/icons/clipy.webp" }, |
| 58 { cmd: 'separator' }, | 58 { cmd: 'separator' }, |
| 59 { cmd: 'readonly', label: '', title: 'readonly', icons: "/public/icons/book.png" }, | 59 { cmd: 'readonly', label: '', title: 'readonly', icons: "/public/icons/book.webp" }, |
| 60 ]; | 60 ]; |
| 61 | 61 |
| 62 buttons.forEach(btn => { | 62 buttons.forEach(btn => { |
| 63 if (btn.cmd === 'separator') { | 63 if (btn.cmd === 'separator') { |
| 64 const sep = document.createElement('span'); | 64 const sep = document.createElement('span'); |