Compare commits

...
2 Commits
Author SHA1 Message Date
qwqcode 6f1f48c18f v2.2.11
Signed-off-by: qwqcode <qwqcode@gmail.com>
2022-05-01 17:13:10 +08:00
qwqcode 91a0406d44 feat(conf): Add nestSort option
Signed-off-by: qwqcode <qwqcode@gmail.com>
2022-05-01 17:12:55 +08:00
4 changed files with 12 additions and 4 deletions

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "artalk",
"version": "2.2.10",
"version": "2.2.11",
"backendMinVersion": "2.1.4",
"license": "LGPL-3.0",
"description": "A Selfhosted Comment System",
+4 -1
View File
@@ -25,7 +25,7 @@ export default class ListLite extends Component {
public flatMode = false
/** 嵌套模式 */
public nestSortBy: ListNest.SortByType = 'DATE_DESC'
public nestSortBy!: ListNest.SortByType
/** 分页 */
public pageMode: 'pagination'|'read-more' = 'pagination'
@@ -58,6 +58,9 @@ export default class ListLite extends Component {
// 评论为空时显示字符
if (ctx.conf.noComment) this.noCommentText = ctx.conf.noComment
// 嵌套排序方式
this.nestSortBy = this.ctx.conf.nestSort || 'DATE_ASC'
// 评论时间自动更新
window.setInterval(() => {
this.$el.querySelectorAll<HTMLElement>('[data-atk-comment-date]').forEach(el => {
+4 -2
View File
@@ -12,6 +12,10 @@ const defaults: ArtalkConfig = {
darkMode: false,
editorTravel: true,
flatMode: 'auto',
nestMax: 2,
nestSort: 'DATE_ASC',
emoticons: "https://cdn.jsdelivr.net/gh/ArtalkJS/Emoticons/grps/default.json",
vote: true,
@@ -19,8 +23,6 @@ const defaults: ArtalkConfig = {
uaBadge: true,
listSort: true,
pvEl: '#ArtalkPV',
flatMode: 'auto',
nestMax: 2,
gravatar: {
default: 'mp',
+3
View File
@@ -77,6 +77,9 @@ export default interface ArtalkConfig {
/** 嵌套模式 · 最大层数 */
nestMax?: number
/** 嵌套模式 · 排序方式 */
nestSort?: 'DATE_ASC'|'DATE_DESC'
/** 显示 UA 徽标 */
uaBadge?: boolean