From aa90a9c32c7c6b01cb0056595e2bb2ebea52fae0 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sun, 29 Sep 2024 12:09:54 +0800 Subject: feat(editor): use unicode for action icons * remove some buttons for later --- src/editor.mjs | 70 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 19 deletions(-) (limited to 'src') 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({ alert('URL copied to clipboard'); }, }, - "undo", - "redo", - "|", - "heading-1", - "heading-2", - "|", - "link", - "image", - "|", - "bold", - "italic", - "strikethrough", - "code", - "clean-block", - "|", - "unordered-list", - "ordered-list", - "quote", - "table", + { + name: 'undo', + title: 'Undo last editing', + text: '\u27F2', + action: EasyMDE.undo, + }, + { + name: 'redo', + text: '\u27F3', + title: 'Redo editing', + action: EasyMDE.redo, + }, + '|', + { + name: 'heading-1', + text: 'H1', + title: 'Big Heading', + action: EasyMDE['heading-1'], + }, + { + name: 'heading-2', + text: 'H2', + title: 'Medium Heading', + action: EasyMDE['heading-2'], + }, + '|', + { + name: 'link', + text: '\u{1F517}', + title: 'Create Link', + action: EasyMDE.drawLink, + }, + { + name: 'image', + text: '\u{1F5BC}', + title: 'Create Image', + action: EasyMDE.drawImage, + }, + '|', + { + name: 'Bold', + text: '\u{1D401}', + title: 'Bold', + action: EasyMDE.toggleBold, + }, + { + name: 'Italic', + text: '\u{1D43C}', + title: 'Italic', + action: EasyMDE.toggleItalic, + }, ], }); -- cgit v1.2.3-70-g09d2