From 76d31c84ad6ea8f27e724c56f2043ae448b7ac6d Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 21 Oct 2023 17:48:35 +0200 Subject: [PATCH] feat(editor): add tooltips for everything --- src/components/input/editor/EditorToolbar.vue | 116 +++++------------- src/components/input/editor/TipTap.vue | 12 +- src/i18n/lang/en.json | 8 +- 3 files changed, 45 insertions(+), 91 deletions(-) diff --git a/src/components/input/editor/EditorToolbar.vue b/src/components/input/editor/EditorToolbar.vue index 8a676c09bf..2d8fe6a8c9 100644 --- a/src/components/input/editor/EditorToolbar.vue +++ b/src/components/input/editor/EditorToolbar.vue @@ -5,7 +5,7 @@ class="editor-toolbar__button" @click="editor.chain().focus().toggleHeading({ level: 1 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 1 }) }" - title="h1" + v-tooltip="$t('input.editor.heading1')" > 1 @@ -13,7 +13,7 @@ class="editor-toolbar__button" @click="editor.chain().focus().toggleHeading({ level: 2 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 2 }) }" - title="h2" + v-tooltip="$t('input.editor.heading2')" > 2 @@ -21,34 +21,10 @@ class="editor-toolbar__button" @click="editor.chain().focus().toggleHeading({ level: 3 }).run()" :class="{ 'is-active': editor.isActive('heading', { level: 3 }) }" - title="h3" + v-tooltip="$t('input.editor.heading3')" > 3 - - 4 - - - 5 - - - 6 -
@@ -56,7 +32,7 @@ class="editor-toolbar__button" @click="editor.chain().focus().toggleBold().run()" :class="{ 'is-active': editor.isActive('bold') }" - title="bold" + v-tooltip="$t('input.editor.bold')" > @@ -66,17 +42,27 @@ class="editor-toolbar__button" @click="editor.chain().focus().toggleItalic().run()" :class="{ 'is-active': editor.isActive('italic') }" - title="italic" + v-tooltip="$t('input.editor.italic')" > + + + + + @@ -85,21 +71,11 @@
- - - - - @@ -109,7 +85,7 @@ class="editor-toolbar__button" @click="editor.chain().focus().toggleBlockquote().run()" :class="{ 'is-active': editor.isActive('blockquote') }" - title="quote" + v-tooltip="$t('input.editor.quote')" > @@ -122,7 +98,7 @@ class="editor-toolbar__button" @click="editor.chain().focus().toggleBulletList().run()" :class="{ 'is-active': editor.isActive('bulletList') }" - title="bullet list" + v-tooltip="$t('input.editor.bulletList')" > @@ -132,7 +108,7 @@ class="editor-toolbar__button" @click="editor.chain().focus().toggleOrderedList().run()" :class="{ 'is-active': editor.isActive('orderedList') }" - title="ordered list" + v-tooltip="$t('input.editor.orderedList')" > @@ -142,7 +118,7 @@ class="editor-toolbar__button" @click="editor.chain().focus().toggleTaskList().run()" :class="{ 'is-active': editor.isActive('taskList') }" - title="task list" + v-tooltip="$t('input.editor.taskList')" > @@ -151,54 +127,35 @@
- +
-
- - - - - - -
-
- - - - - @@ -208,17 +165,10 @@ - - - - - - - +
@@ -227,7 +177,7 @@ @@ -236,7 +186,7 @@ @@ -250,7 +200,7 @@ class="editor-toolbar__button" @click="toggleTableMode" :class="{ 'is-active': editor.isActive('table') }" - title="table" + v-tooltip="$t('input.editor.table.title')" > diff --git a/src/components/input/editor/TipTap.vue b/src/components/input/editor/TipTap.vue index eb01a54b5d..6d39ca4f76 100644 --- a/src/components/input/editor/TipTap.vue +++ b/src/components/input/editor/TipTap.vue @@ -14,7 +14,7 @@ class="editor-bubble__button" @click="editor.chain().focus().toggleBold().run()" :class="{ 'is-active': editor.isActive('bold') }" - title="bold" + v-tooltip="$t('input.editor.bold')" > @@ -22,7 +22,7 @@ class="editor-bubble__button" @click="editor.chain().focus().toggleItalic().run()" :class="{ 'is-active': editor.isActive('italic') }" - title="italic" + v-tooltip="$t('input.editor.italic')" > @@ -30,7 +30,7 @@ class="editor-bubble__button" @click="editor.chain().focus().toggleUnderline().run()" :class="{ 'is-active': editor.isActive('underline') }" - title="italic" + v-tooltip="$t('input.editor.underline')" > @@ -38,7 +38,7 @@ class="editor-bubble__button" @click="editor.chain().focus().toggleStrike().run()" :class="{ 'is-active': editor.isActive('strike') }" - title="strike" + v-tooltip="$t('input.editor.strikethrough')" > @@ -46,7 +46,7 @@ class="editor-bubble__button" @click="editor.chain().focus().toggleCode().run()" :class="{ 'is-active': editor.isActive('code') }" - title="code" + v-tooltip="$t('input.editor.code')" > @@ -54,7 +54,7 @@ class="editor-bubble__button" @click="setLink" :class="{ 'is-active': editor.isActive('link') }" - title="set link" + v-tooltip="$t('input.editor.link')" > diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 5702085d1d..1b3e6192c9 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -524,14 +524,15 @@ "bold": "Bold", "italic": "Italic", "strikethrough": "Strikethrough", + "underline": "Underline", "code": "Code", "codeTooltip": "Capture a code snippet.", "quote": "Quote", "quoteTooltip": "Capture a quote.", "bulletList": "Bullet list", "bulletListTooltip": "Create a simple bullet list.", - "unorderedList": "Unordered List", - "orderedList": "Ordered List", + "unorderedList": "Unordered list", + "orderedList": "Ordered list", "orderedListTooltip": "Create a list with numbering.", "cleanBlock": "Clean Block", "link": "Link", @@ -546,7 +547,10 @@ "textTooltip": "Just start typing with plain text.", "taskList": "Task list", "taskListTooltip": "Track tasks with a to-do list.", + "undo": "Undo", + "redo": "Redo", "table": { + "title": "Table", "insert": "Insert table", "addColumnBefore": "Add column before", "addColumnAfter": "Add column after",