Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
trust Tomorrow
Awesome-Markdown-Editor
提交
bb7b9798
Awesome-Markdown-Editor
项目概览
trust Tomorrow
/
Awesome-Markdown-Editor
与 Fork 源项目一致
Fork自
gitcode_dev / Awesome-Markdown-Editor
通知
2
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Awesome-Markdown-Editor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bb7b9798
编写于
8月 06, 2021
作者:
璃白.
🌻
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:@用户匹配大小写
上级
8c56ab19
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
38 addition
and
30 deletion
+38
-30
package.json
package.json
+1
-1
src/App.vue
src/App.vue
+0
-1
src/assets/js/utils.js
src/assets/js/utils.js
+17
-7
src/assets/style/card.less
src/assets/style/card.less
+1
-1
src/assets/style/variable.less
src/assets/style/variable.less
+1
-0
src/components/content/components/user-select.vue
src/components/content/components/user-select.vue
+7
-12
src/components/content/md-textarea.vue
src/components/content/md-textarea.vue
+5
-1
src/components/content/mixins/select-user-mixins.js
src/components/content/mixins/select-user-mixins.js
+4
-5
src/components/header/md-header.vue
src/components/header/md-header.vue
+1
-1
src/main.js
src/main.js
+1
-1
未找到文件。
package.json
浏览文件 @
bb7b9798
{
"name"
:
"markdown-editor"
,
"description"
:
" A open source markdown editor of csdn codechina team contributed"
,
"version"
:
"0.
6.3
"
,
"version"
:
"0.
7.2
"
,
"publisher"
:
"guoweijia"
,
"scripts"
:
{
"start"
:
"webpack serve --mode=development"
,
...
...
src/App.vue
浏览文件 @
bb7b9798
...
...
@@ -406,7 +406,6 @@ export default {
}
});
}).
then
(
res
=>
{
console
.
log
(
"
返回的列表
"
,
res
);
res
.
forEach
(
item
=>
{
item
.
csdn
=
true
;
const
linkEl
=
vDom
.
querySelector
(
"
#
"
+
item
.
id
);
...
...
src/assets/js/utils.js
浏览文件 @
bb7b9798
...
...
@@ -77,7 +77,8 @@ export function initStyle({
codeBgColor
,
codeTheme
,
helpdocColor
,
itemActiveBgColor
itemActiveBgColor
,
linkCardBgColor
})
{
// 夜晚模式
if
(
dark
)
{
...
...
@@ -91,6 +92,13 @@ export function initStyle({
contentBgColor
=
"
#222226
"
;
helpdocColor
=
"
#CCCCD8
"
;
itemActiveBgColor
=
"
#777888
"
;
linkCardBgColor
=
"
#222226
"
;
}
if
(
linkCardBgColor
)
{
document
.
documentElement
.
style
.
setProperty
(
"
--md-editor-link-card-bg-color
"
,
linkCardBgColor
);
}
if
(
frameBgColor
)
{
document
.
documentElement
.
style
.
setProperty
(
...
...
@@ -193,9 +201,7 @@ export function checkBoswer() {
}
export
function
isAndroid
()
{
const
agent
=
navigator
.
userAgent
.
match
(
/
(
Android
)
/i
);
const
agent
=
navigator
.
userAgent
.
match
(
/
(
Android
)
/i
);
return
agent
!==
null
;
}
// 去除头部空格行
...
...
@@ -374,11 +380,15 @@ export function getLinkTitle(linkEl) {
export
function
renderLinkCard
(
title
,
item
)
{
return
`
<span class="md_link_title">
${
title
||
item
.
title
||
""
}
</span>
${
item
.
desc
?
`<span class="md_link_desc">
${
item
.
desc
}
</span>`
:
""
}
${
item
.
description
?
`<span class="md_link_desc">
${
item
.
description
}
</span>`
:
""
}
<span class="md_flex_card">
${
item
.
i
mg
?
`<img class="md_link_img" src="
${
item
.
i
mg
}
" />`
item
.
i
con
?
`<img class="md_link_img" src="
${
item
.
i
con
}
" />`
:
"
<span class='md_link_img icon iconfont icon-lianjie'></span>
"
}
<span class="flex-1">
...
...
src/assets/style/card.less
浏览文件 @
bb7b9798
...
...
@@ -5,7 +5,7 @@
box-sizing: border-box;
border-radius: 4px;
border: 1px solid var(--md-editor-border-color);
background:
#f5f7fa
;
background:
var(--md-editor-link-card-bg-color)
;
transition: border 0.3s;
margin: 4px 0;
max-width: 640px;
...
...
src/assets/style/variable.less
浏览文件 @
bb7b9798
...
...
@@ -10,6 +10,7 @@
--md-editor-item-active-bg-color: #f5f7fa;
--md-editor-helpdoc-color: #666666;
--md-editor-code-bg-color: #f3f4f5;
--md-editor-link-card-bg-color: #f5f7fa;
--md-editor-fullScrren-zIndex: 2000;
--md-editor-disabled-opacity: 0.5;
}
src/components/content/components/user-select.vue
浏览文件 @
bb7b9798
...
...
@@ -25,7 +25,6 @@
</div>
</
template
>
<
script
>
import
{
throttle
as
throttleFn
}
from
"
@/assets/js/utils
"
;
export
default
{
props
:
{
position
:
{
...
...
@@ -49,8 +48,6 @@ export default {
computed
:
{
list
()
{
const
list
=
this
.
userList
;
console
.
log
(
"
list
"
,
list
);
if
(
!
list
.
length
)
return
[];
return
list
.
map
((
item
,
index
)
=>
{
if
(
index
===
0
)
{
...
...
@@ -60,9 +57,6 @@ export default {
}
return
item
;
});
},
throttle
()
{
return
throttleFn
();
}
},
watch
:
{
...
...
@@ -77,16 +71,17 @@ export default {
data
()
{
return
{
left
:
0
,
top
:
0
top
:
0
,
selectDisable
:
false
};
},
methods
:
{
selectUser
(
user
)
{
console
.
log
(
this
.
throttle
)
;
this
.
throttle
(()
=>
{
console
.
log
(
111
);
this
.
$emit
(
"
selectUser
"
,
user
)
;
if
(
this
.
selectDisable
)
return
;
this
.
selectDisable
=
true
;
this
.
$emit
(
"
selectUser
"
,
user
);
setTimeout
(()
=>
{
this
.
selectDisable
=
false
;
},
1000
);
},
isActive
(
index
)
{
...
...
src/components/content/md-textarea.vue
浏览文件 @
bb7b9798
...
...
@@ -8,7 +8,7 @@
@
keydown.stop.50=
"handleCallUser"
@
keydown.stop.229=
"handleCallUser"
@
focus=
"setFocus(true)"
@
blur=
"
setFocus(false)
"
@
blur=
"
blur
"
@
paste=
"pasteFile"
@
keydown.stop.up=
"changeActiveUserIndex($event, 'up')"
@
keydown.stop.down=
"changeActiveUserIndex($event, 'down')"
...
...
@@ -297,6 +297,10 @@ export default {
this
.
$emit
(
"
update:textLength
"
,
this
.
textContent
.
length
);
this
.
emitText
();
},
blur
()
{
this
.
renderUserTags
()
this
.
setFocus
(
false
);
},
createHideEl
(
type
)
{
const
textEl
=
document
.
getElementById
(
this
.
id
);
if
(
!
textEl
)
return
;
...
...
src/components/content/mixins/select-user-mixins.js
浏览文件 @
bb7b9798
...
...
@@ -5,8 +5,9 @@ export default {
allUserList
:
[]
};
},
mounted
()
{
setTimeout
(()
=>
{
methods
:
{
renderUserTags
()
{
if
(
this
.
showSelectUser
)
return
;
const
text
=
this
.
text
;
if
(
/
(\@\S
+
\s{0,1})
/g
.
test
(
text
))
{
this
.
$emit
(
"
queryUserList
"
,
""
);
...
...
@@ -18,9 +19,7 @@ export default {
});
});
}
},
0
);
},
methods
:
{
},
handleSelectUser
(
user
)
{
const
originalText
=
this
.
textContent
;
const
queryInfo
=
this
.
queryInfo
;
...
...
src/components/header/md-header.vue
浏览文件 @
bb7b9798
...
...
@@ -204,7 +204,7 @@ export default {
icon
:
"
lianjie
"
,
tip
:
"
添加链接
"
,
doc
:
"
[标题](链接)
"
,
startStr
:
"
[
链接标题
](
"
,
startStr
:
"
[](
"
,
endStr
:
"
)
"
},
{
...
...
src/main.js
浏览文件 @
bb7b9798
...
...
@@ -178,7 +178,7 @@ function initMdEditor(obj) {
if
(
!
keyWord
)
return
callback
(
list
);
callback
(
list
.
filter
(
item
=>
{
return
item
.
nickname
.
includes
(
keyWord
);
return
item
.
nickname
.
toLowerCase
().
includes
(
keyWord
.
toLowerCase
()
);
})
);
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录