From ca1c7364490a39e54ddb213a68441105e215b990 Mon Sep 17 00:00:00 2001 From: ronger Date: Wed, 22 Dec 2021 11:50:20 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=B8=B0=E5=AF=8C=E8=A1=A8=E6=83=85?= =?UTF-8?q?=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/common/comment/main.vue | 3 ++ pages/admin/tag/post/_tag_id.vue | 3 ++ pages/admin/topic/post/_topic_id.vue | 3 ++ pages/article/post/_article_id.vue | 3 ++ pages/guides/markdown.vue | 3 ++ pages/guides/vditor.vue | 3 ++ pages/portfolio/post/_portfolio_id.vue | 3 ++ plugins/vditor.js | 75 ++++++++++++++++++++++++++ 8 files changed, 96 insertions(+) diff --git a/components/common/comment/main.vue b/components/common/comment/main.vue index 6f42d1e..35fcbe1 100644 --- a/components/common/comment/main.vue +++ b/components/common/comment/main.vue @@ -226,6 +226,9 @@ after() { _ts.contentEditor.setValue(data.value ? data.value : ''); }, + hint: { + emoji: Vue.emoji + }, preview: { hljs: { enable: true, diff --git a/pages/admin/tag/post/_tag_id.vue b/pages/admin/tag/post/_tag_id.vue index e836624..790e21f 100644 --- a/pages/admin/tag/post/_tag_id.vue +++ b/pages/admin/tag/post/_tag_id.vue @@ -149,6 +149,9 @@ export default { after() { _ts.contentEditor.setValue(data.value ? data.value : ''); }, + hint: { + emoji: Vue.emoji + }, preview: { hljs: { enable: true, diff --git a/pages/admin/topic/post/_topic_id.vue b/pages/admin/topic/post/_topic_id.vue index c59235b..5659629 100644 --- a/pages/admin/topic/post/_topic_id.vue +++ b/pages/admin/topic/post/_topic_id.vue @@ -217,6 +217,9 @@ export default { after() { _ts.contentEditor.setValue(data.value ? data.value : ''); }, + hint: { + emoji: Vue.emoji + }, preview: { hljs: { enable: true, diff --git a/pages/article/post/_article_id.vue b/pages/article/post/_article_id.vue index 6386fc4..08a1842 100644 --- a/pages/article/post/_article_id.vue +++ b/pages/article/post/_article_id.vue @@ -167,6 +167,9 @@ after() { _ts.contentEditor.setValue(data.value ? data.value : ''); }, + hint: { + emoji: Vue.emoji + }, preview: { hljs: { enable: true, diff --git a/pages/guides/markdown.vue b/pages/guides/markdown.vue index 5b0c612..dcfbab5 100644 --- a/pages/guides/markdown.vue +++ b/pages/guides/markdown.vue @@ -67,6 +67,9 @@ export default { after() { _ts.contentEditor.setValue(data.value ? data.value : ''); }, + hint: { + emoji: Vue.emoji + }, preview: { hljs: { enable: true, diff --git a/pages/guides/vditor.vue b/pages/guides/vditor.vue index 3eda6f8..f5863d2 100644 --- a/pages/guides/vditor.vue +++ b/pages/guides/vditor.vue @@ -66,6 +66,9 @@ export default { after() { _ts.contentEditor.setValue(data.value ? data.value : ''); }, + hint: { + emoji: Vue.emoji + }, preview: { hljs: { enable: true, diff --git a/pages/portfolio/post/_portfolio_id.vue b/pages/portfolio/post/_portfolio_id.vue index d09982d..73544a8 100644 --- a/pages/portfolio/post/_portfolio_id.vue +++ b/pages/portfolio/post/_portfolio_id.vue @@ -222,6 +222,9 @@ export default { after() { _ts.contentEditor.setValue(data.value ? data.value : ''); }, + hint: { + emoji: Vue.emoji + }, preview: { markdown: { toc: true, diff --git a/plugins/vditor.js b/plugins/vditor.js index cc509c6..7f0dbc8 100644 --- a/plugins/vditor.js +++ b/plugins/vditor.js @@ -3,5 +3,80 @@ import VditorPreview from 'vditor/dist/method.min'; import Vditor from 'vditor'; + +let emoji = { + "+1": "👍", + "-1": "👎", + "100": "đŸ’¯", + "Accept": "🉑", + "beer": "đŸē", + "bug": "🐛", + "bulb": "💡", + "computer": "đŸ’ģ", + "construction": "🚧", + "construction_worker": "👷", + "construction_worker_man": "👷", + "construction_worker_woman": "👷‍♀", + "face_with_head_bandage": "🤕", + "face_with_thermometer": "🤒", + "fearful": "😨", + "flushed": "đŸ˜ŗ", + "frowning": "đŸ˜Ļ", + "frowning_face": "☚ī¸", + "full_moon_with_face": "🌝", + "grimacing": "đŸ˜Ŧ", + "grin": "😁", + "grinning": "😀", + "hankey": "💩", + "metal": "🤘", + "money_mouth_face": "🤑", + "nerd_face": "🤓", + "neutral_face": "😐", + "persevere": "đŸ˜Ŗ", + "point_down": "👇", + "point_left": "👈", + "point_right": "👉", + "point_up_2": "👆", + "satisfied": "😆", + "sleeping": "😴", + "sleepy": "đŸ˜Ē", + "slightly_frowning_face": "🙁", + "slightly_smiling_face": "🙂", + "smile": "😄", + "smiley": "😃", + "smiling_imp": "😈", + "smirk": "😏", + "sneezing_face": "🤧", + "sob": "😭", + "sparkler": "🎇", + "sparkles": "✨", + "stopwatch": "⏱", + "strawberry": "🍓", + "stuck_out_tongue": "😛", + "stuck_out_tongue_closed_eyes": "😝", + "stuck_out_tongue_winking_eye": "😜", + "sun_behind_large_cloud": "đŸŒĨ", + "sun_behind_rain_cloud": "đŸŒĻ", + "sun_behind_small_cloud": "🌤", + "sun_with_face": "🌞", + "sunflower": "đŸŒģ", + "sunglasses": "😎", + "sweat": "😓", + "sweat_smile": "😅", + "unamused": "😒", + "unlock": "🔓", + "upside_down_face": "🙃", + "v": "✌ī¸", + "wink": "😉", + "wrench": "🔧", + "writing_hand": "✍ī¸", + "x": "❌", + "yellow_heart": "💛", + "zipper_mouth_face": "🤐", + "zzz": "💤" +} + + +Vue.emoji = emoji Vue.VditorPreview = VditorPreview; Vue.Vditor = Vditor