artalk 2.2.10 → 2.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "artalk",
3
- "version": "2.2.10",
3
+ "version": "2.2.11",
4
4
  "backendMinVersion": "2.1.4",
5
5
  "license": "LGPL-3.0",
6
6
  "description": "A Selfhosted Comment System",
@@ -25,7 +25,7 @@ export default class ListLite extends Component {
25
25
  public flatMode = false
26
26
 
27
27
  /** 嵌套模式 */
28
- public nestSortBy: ListNest.SortByType = 'DATE_DESC'
28
+ public nestSortBy!: ListNest.SortByType
29
29
 
30
30
  /** 分页 */
31
31
  public pageMode: 'pagination'|'read-more' = 'pagination'
@@ -58,6 +58,9 @@ export default class ListLite extends Component {
58
58
  // 评论为空时显示字符
59
59
  if (ctx.conf.noComment) this.noCommentText = ctx.conf.noComment
60
60
 
61
+ // 嵌套排序方式
62
+ this.nestSortBy = this.ctx.conf.nestSort || 'DATE_ASC'
63
+
61
64
  // 评论时间自动更新
62
65
  window.setInterval(() => {
63
66
  this.$el.querySelectorAll<HTMLElement>('[data-atk-comment-date]').forEach(el => {
package/src/defaults.ts CHANGED
@@ -12,6 +12,10 @@ const defaults: ArtalkConfig = {
12
12
  darkMode: false,
13
13
  editorTravel: true,
14
14
 
15
+ flatMode: 'auto',
16
+ nestMax: 2,
17
+ nestSort: 'DATE_ASC',
18
+
15
19
  emoticons: "https://cdn.jsdelivr.net/gh/ArtalkJS/Emoticons/grps/default.json",
16
20
 
17
21
  vote: true,
@@ -19,8 +23,6 @@ const defaults: ArtalkConfig = {
19
23
  uaBadge: true,
20
24
  listSort: true,
21
25
  pvEl: '#ArtalkPV',
22
- flatMode: 'auto',
23
- nestMax: 2,
24
26
 
25
27
  gravatar: {
26
28
  default: 'mp',
@@ -77,6 +77,9 @@ export default interface ArtalkConfig {
77
77
  /** 嵌套模式 · 最大层数 */
78
78
  nestMax?: number
79
79
 
80
+ /** 嵌套模式 · 排序方式 */
81
+ nestSort?: 'DATE_ASC'|'DATE_DESC'
82
+
80
83
  /** 显示 UA 徽标 */
81
84
  uaBadge?: boolean
82
85