diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2024-09-29 12:09:54 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2024-09-29 16:19:10 +0800 |
| commit | aa90a9c32c7c6b01cb0056595e2bb2ebea52fae0 (patch) | |
| tree | 8bf1d779cc6e5110cbc826fe9b6b4abc73190013 /src | |
| parent | 54d28115a5fcad222b7d61786fc2f97a0877ae34 (diff) | |
feat(editor): use unicode for action icons
* remove some buttons for later
Diffstat (limited to 'src')
| -rw-r--r-- | src/editor.mjs | 70 |
1 files changed, 51 insertions, 19 deletions
diff --git a/src/editor.mjs b/src/editor.mjs index f80ff07..f965b56 100644 --- a/src/editor.mjs +++ b/src/editor.mjs | |||
| @@ -63,25 +63,57 @@ const editor = new EasyMDE({ | |||
| 63 | alert('URL copied to clipboard'); | 63 | alert('URL copied to clipboard'); |
| 64 | }, | 64 | }, |
| 65 | }, | 65 | }, |
| 66 | "undo", | 66 | { |
| 67 | "redo", | 67 | name: 'undo', |
| 68 | "|", | 68 | title: 'Undo last editing', |
| 69 | "heading-1", | 69 | text: '\u27F2', |
| 70 | "heading-2", | 70 | action: EasyMDE.undo, |
| 71 | "|", | 71 | }, |
| 72 | "link", | 72 | { |
| 73 | "image", | 73 | name: 'redo', |
| 74 | "|", | 74 | text: '\u27F3', |
| 75 | "bold", | 75 | title: 'Redo editing', |
| 76 | "italic", | 76 | action: EasyMDE.redo, |
| 77 | "strikethrough", | 77 | }, |
| 78 | "code", | 78 | '|', |
| 79 | "clean-block", | 79 | { |
| 80 | "|", | 80 | name: 'heading-1', |
| 81 | "unordered-list", | 81 | text: 'H1', |
| 82 | "ordered-list", | 82 | title: 'Big Heading', |
| 83 | "quote", | 83 | action: EasyMDE['heading-1'], |
| 84 | "table", | 84 | }, |
| 85 | { | ||
| 86 | name: 'heading-2', | ||
| 87 | text: 'H2', | ||
| 88 | title: 'Medium Heading', | ||
| 89 | action: EasyMDE['heading-2'], | ||
| 90 | }, | ||
| 91 | '|', | ||
| 92 | { | ||
| 93 | name: 'link', | ||
| 94 | text: '\u{1F517}', | ||
| 95 | title: 'Create Link', | ||
| 96 | action: EasyMDE.drawLink, | ||
| 97 | }, | ||
| 98 | { | ||
| 99 | name: 'image', | ||
| 100 | text: '\u{1F5BC}', | ||
| 101 | title: 'Create Image', | ||
| 102 | action: EasyMDE.drawImage, | ||
| 103 | }, | ||
| 104 | '|', | ||
| 105 | { | ||
| 106 | name: 'Bold', | ||
| 107 | text: '\u{1D401}', | ||
| 108 | title: 'Bold', | ||
| 109 | action: EasyMDE.toggleBold, | ||
| 110 | }, | ||
| 111 | { | ||
| 112 | name: 'Italic', | ||
| 113 | text: '\u{1D43C}', | ||
| 114 | title: 'Italic', | ||
| 115 | action: EasyMDE.toggleItalic, | ||
| 116 | }, | ||
| 85 | ], | 117 | ], |
| 86 | }); | 118 | }); |
| 87 | 119 | ||