perf: when the Valine meta is empty, use ['nick', 'mail', 'link'] configuration item

This commit is contained in:
XPoet 2020-12-27 21:27:57 +08:00
parent 344aab9e89
commit 6c2721286d
1 changed files with 3 additions and 3 deletions

View File

@ -7,19 +7,19 @@
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
<div id="vcomments"></div>
<script>
const temp_valine_input_meta = '<%= theme.comment.valine.meta %>';
new Valine({
el: '#vcomments',
appId: '<%= theme.comment.valine.appid %>',
appKey: '<%= theme.comment.valine.appkey %>',
meta: '<%= theme.comment.valine.meta %>'.split(','),
meta: temp_valine_input_meta ? temp_valine_input_meta.split(',') : ['nick', 'mail', 'link'],
avatar: 'wavatar',
enableQQ: true,
placeholder: '<%= theme.comment.valine.placeholder %>',
lang: '<%= config.language %>'.toLowerCase()
});
// Valine 评论列表增加"博主"标识
// Add "Author" identify
const getValineDomTimer = setInterval(() => {
const vcards = document.querySelectorAll('#vcomments .vcards .vcard');
if (vcards.length > 0) {