Skip to content

Commit

Permalink
feat(vditor): 控制编辑器添加表情
Browse files Browse the repository at this point in the history
  • Loading branch information
nineya committed Dec 20, 2023
1 parent a93ec25 commit b910d18
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/js/editor-options.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 12 additions & 1 deletion src/js/editor-options.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(function() {
(function () {
const commentVersion = '1.1.6'
const customElement = [
{
value: '<mew-subtitle>$副标题</mew-subtitle>',
Expand Down Expand Up @@ -105,6 +106,7 @@
handleCustomElement()
return {
hint: {
emoji: handleEmojiImg(),
extend: [
{
key: '<mew',
Expand Down Expand Up @@ -137,4 +139,13 @@
})
})
}

function handleEmojiImg() {
let emojiList = ['hehe', 'haha', 'tushe', 'a', 'ku', 'nu', 'kaixin', 'han', 'lei', 'heixian', 'bishi', 'bugaoxing', 'zhenbang', 'qian', 'yiwen', 'yingxiang', 'tu', 'yi', 'weiqu', 'huaxin', 'hu', 'xiaoyan', 'len', 'taikaixin', 'huaji', 'mianqiang', 'kuanhan', 'guai', 'shuijiao', 'jingku', 'shengqi', 'jingya', 'pen', 'turanxingfen', 'wabi', 'tanshou', 'wuzuixiao', 'hejiu', 'xili', 'landeli', 'zhayao', 'chigua', 'xiaoguai', 'nidongde', 'heiheihei', 'huanhu', 'xiaoniao', 'suanshuang', 'jinzhang', 'anzhongguancha', 'xiaohonglian', 'yamiedie', 'weiweiyixiao', 'what', 'tuosai', 'pu', 'kunchenggou', 'kejianzhongguancha', 'caigou', 'laohu', 'aowu', 'aoteman', 'heitougaoxing', 'heitoudengyan', 'wangyuanjing', 'butin', 'ganfan', 'damuzhi', 'shengli', 'haha2', 'ok', 'honglingjin', 'aixin', 'xinsui', 'meigui', 'liwu', 'yanhua', 'caihong', 'taiyang', 'xingxingyueliang', 'dangao', 'chabei', 'xiangjiao', 'bianbian', 'yaowan', 'qianbi', 'lazhu', 'shafa', 'yinyue', 'dengpao', 'shouzhi']
let emojis = {}
emojiList.forEach(key => {
emojis[key] = `/themes/dream/source/lib/halo-comment@${commentVersion}/assets/emoji/${key}.png`
})
return emojis
}
})()

0 comments on commit b910d18

Please sign in to comment.