hexo-theme-solitude 1.7.14 → 1.8.1

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.
Files changed (41) hide show
  1. package/README.md +25 -25
  2. package/{README_zh-cn.md → README_en.md} +25 -25
  3. package/README_zh-tw.md +3 -3
  4. package/_config.yml +41 -34
  5. package/layout/includes/body/mode.pug +6 -3
  6. package/layout/includes/console.pug +1 -1
  7. package/layout/includes/footer.pug +2 -2
  8. package/layout/includes/head/config.pug +3 -36
  9. package/layout/includes/head/page_config.pug +9 -0
  10. package/layout/includes/head.pug +4 -1
  11. package/layout/includes/inject/body.pug +1 -26
  12. package/layout/includes/inject/head.pug +8 -60
  13. package/layout/includes/rightmenu.pug +2 -2
  14. package/layout/includes/widgets/page/links/banner.pug +1 -1
  15. package/layout/includes/widgets/post/postMeta.pug +18 -17
  16. package/layout/includes/widgets/third-party/comments/artalk.pug +29 -18
  17. package/layout/includes/widgets/third-party/comments/comment.pug +48 -12
  18. package/layout/includes/widgets/third-party/comments/twikoo.pug +72 -55
  19. package/layout/includes/widgets/third-party/comments/valine.pug +43 -49
  20. package/layout/includes/widgets/third-party/comments/waline.pug +44 -52
  21. package/layout/includes/widgets/third-party/news-comment/artalk.pug +57 -67
  22. package/layout/includes/widgets/third-party/news-comment/newest-comment.pug +10 -10
  23. package/layout/includes/widgets/third-party/news-comment/twikoo.pug +41 -48
  24. package/layout/includes/widgets/third-party/news-comment/valine.pug +19 -17
  25. package/layout/includes/widgets/third-party/news-comment/waline.pug +3 -3
  26. package/layout/includes/widgets/third-party/pjax.pug +1 -0
  27. package/package.json +1 -1
  28. package/plugins.yml +2 -2
  29. package/scripts/event/merge_config.js +280 -255
  30. package/scripts/filter/comment.js +13 -0
  31. package/scripts/filter/default.js +1 -1
  32. package/source/css/_comments/comment.styl +73 -12
  33. package/source/css/_comments/valine.styl +1 -1
  34. package/source/css/_highlight/index.styl +1 -0
  35. package/source/css/_tags/link.styl +7 -2
  36. package/source/css/index.styl +1 -1
  37. package/source/js/barrage_comment.js +18 -12
  38. package/source/js/main.js +42 -18
  39. package/source/js/right_menu.js +3 -3
  40. package/source/js/tw_cn.js +3 -3
  41. package/source/js/utils.js +62 -0
@@ -40,40 +40,41 @@
40
40
  if theme.post.meta.pv
41
41
  a.post-meta-pv(href=url_for(page.path), title=_p('post.pv'))
42
42
  i.post-meta-icon.solitude.st-fire-fill
43
- if theme.comment.enable
44
- case theme.comment.type
45
- when "twikoo"
43
+ if theme.comment.use
44
+ case theme.comment.use[0]
45
+ when "Twikoo"
46
46
  span#twikoo_visitors
47
47
  i.solitude.st-loading-line
48
- when "waline"
48
+ when "Waline"
49
49
  span.waline-pageview-count
50
50
  i.solitude.st-loading-line
51
- when "valine"
51
+ when "Valine"
52
52
  span.leancloud_visitors(id=url_for(page.path))
53
53
  span.leancloud-visitors-count
54
54
  i.solitude.st-loading-line
55
- when 'artalk'
55
+ when 'Artalk'
56
56
  span#ArtalkPV
57
57
  i.solitude.st-loading-line
58
- else if theme.busuanzi
59
- span#busuanzi_value_page_pv
60
- i.solitude.st-loading-line
61
- if theme.post.meta.comment && page.comment
58
+ else
59
+ if theme.busuanzi
60
+ span#busuanzi_value_page_pv
61
+ i.solitude.st-loading-line
62
+ if theme.post.meta.comment && page.comment && theme.comment.count && theme.comment.use
62
63
  span.post-meta-commentcount(title=_p('post.comment'), onclick="sco.scrollTo('post-comment')")
63
64
  i.solitude.st-chat-fill
64
65
  a(href=url_for(page.path) + "#post-comment")
65
- case theme.comment.type
66
- when "twikoo"
67
- span#twikoo-count
66
+ case theme.comment.use[0]
67
+ when "Twikoo"
68
+ span.twikoo-count
68
69
  i.solitude.st-loading-line
69
- when "waline"
70
+ when "Waline"
70
71
  span.waline-comment-count
71
72
  i.solitude.st-loading-line
72
- when "valine"
73
+ when "Valine"
73
74
  span.valine-comment-count(data-xid=url_for(page.path) itemprop="commentCount")
74
75
  i.solitude.st-loading-line
75
- when 'artalk'
76
- span.waline-comment-count#ArtalkCount
76
+ when 'Artalk'
77
+ span#ArtalkCount.artalk-count
77
78
  i.solitude.st-loading-line
78
79
 
79
80
  include ./wave
@@ -1,18 +1,17 @@
1
- - const { server, site, option } = theme.comment.artalk
2
- - const { lazyload, count } = theme.comment
1
+ - const { server, site, option } = theme.artalk
2
+ - const { lazyload, count ,use} = theme.comment
3
3
 
4
4
  script.
5
- async function initComment() {
5
+ !function () {
6
6
  let artalkItem = null
7
7
  const initArtalk = () => {
8
8
  artalkItem = Artalk.init({
9
- el: '#comment',
9
+ el: '#artalk-wrap',
10
10
  server: '!{server}',
11
11
  site: "!{site}",
12
12
  pageKey: location.pathname,
13
13
  darkMode: document.documentElement.getAttribute('data-theme') === 'dark',
14
14
  }, !{JSON.stringify(option)})
15
-
16
15
  if (GLOBAL_CONFIG.lightbox === 'null') return
17
16
  artalkItem.on('list-loaded', () => {
18
17
  const array = []
@@ -24,27 +23,39 @@ script.
24
23
  })
25
24
  const $content = comment.getRender().$content
26
25
  utils.lightbox($content.querySelectorAll('img:not([atk-emoticon])'))
27
- sco.owoBig()
26
+ sco.owoBig({body: '.atk-grp', item: '.atk-item'})
28
27
  })
29
- GLOBAL_CONFIG.comment.commentBarrage && PAGE_CONFIG.comment && initializeCommentBarrage(array)
28
+ !{commentBarrage} && barrageArtalk(array)
30
29
  })
31
-
32
- const destroyArtalk = () => {
33
- artalkItem.destroy()
34
- }
35
-
30
+ const destroyArtalk = () => artalkItem.destroy()
36
31
  utils.addGlobalFn('pjax', destroyArtalk, 'destroyArtalk')
37
32
  }
38
-
33
+ const loadArtalk = async () => {
34
+ if (typeof Artalk === 'object') await initArtalk()
35
+ else {
36
+ await utils.getCSS('!{theme.cdn.artalk_css}')
37
+ await utils.getScript('!{theme.cdn.artalk_js}').then(initArtalk)
38
+ }
39
+ }
39
40
  const artalkChangeMode = theme => {
40
- const artalkWrap = document.getElementById('comment')
41
- console.log(artalkWrap, artalkWrap.children.length)
41
+ const artalkWrap = document.getElementById('artalk-wrap')
42
42
  if (!(artalkWrap && artalkWrap.children.length)) return
43
43
  const isDark = theme === 'dark'
44
44
  artalkItem.setDarkMode(!isDark)
45
45
  }
46
-
47
46
  utils.addGlobalFn('themeChange', artalkChangeMode, 'artalk')
47
+ if ('!{use[0]}' === 'Artalk' || !{lazyload}) {
48
+ if (!{lazyload}) utils.loadComment(document.getElementById('artalk-wrap'), loadArtalk)
49
+ else loadArtalk()
50
+ } else {
51
+ window.loadTwoComment = loadArtalk
52
+ }
53
+ }()
48
54
 
49
- initArtalk()
50
- }
55
+ if commentBarrage
56
+ script.
57
+ const barrageArtalk = async array => {
58
+ await utils.getScript('!{url_for(theme.cdn.commentBarrage)}').then(() => {
59
+ initializeCommentBarrage(array)
60
+ })
61
+ }
@@ -1,17 +1,53 @@
1
+ - const {use,count} = theme.comment
2
+
1
3
  #post-comment
2
4
  .comment-head
3
5
  .comment-headline
4
6
  i.solitude.st-chat-fill
5
- span=_p('comment.title')
6
- span
7
+ span=' ' + _p('comment.title')
8
+ if count
9
+ span.count
10
+ = ' ('
11
+ each name in use
12
+ case name
13
+ when "Twikoo"
14
+ span.twikoo-count
15
+ i.solitude.st-loading-line
16
+ when "Waline"
17
+ span.waline-comment-count
18
+ i.solitude.st-loading-line
19
+ when "Valine"
20
+ span.valine-comment-count(data-xid=url_for(page.path) itemprop="commentCount")
21
+ i.solitude.st-loading-line
22
+ when "Artalk"
23
+ span.artalk-count
24
+ | )
25
+
26
+ if use.length > 1
27
+ .comment-switch
28
+ span.first=use[0]
29
+ span#switch-btn
30
+ span.second=use[1]
31
+
7
32
  .comment-wrap
8
- #comment
9
- case theme.comment.type
10
- when 'twikoo'
11
- !=partial('includes/widgets/third-party/comments/twikoo',{}, {cache: true})
12
- when 'waline'
13
- !=partial('includes/widgets/third-party/comments/waline',{}, {cache: true})
14
- when 'valine'
15
- !=partial('includes/widgets/third-party/comments/valine',{}, {cache: true})
16
- when 'artalk'
17
- !=partial('includes/widgets/third-party/comments/artalk',{}, {cache: true})
33
+ each name in use
34
+ case name
35
+ when 'Valine'
36
+ #vcomment.vcomment
37
+ when 'Twikoo'
38
+ #twikoo-wrap
39
+ when 'Waline'
40
+ #waline-wrap
41
+ when 'Artalk'
42
+ #artalk-wrap
43
+
44
+ each name in use
45
+ case name
46
+ when 'Twikoo'
47
+ !=partial('includes/widgets/third-party/comments/twikoo', {}, {cache: true})
48
+ when 'Waline'
49
+ !=partial('includes/widgets/third-party/comments/waline', {}, {cache: true})
50
+ when 'Valine'
51
+ !=partial('includes/widgets/third-party/comments/valine', {}, {cache: true})
52
+ when 'Artalk'
53
+ !=partial('includes/widgets/third-party/comments/artalk', {}, {cache: true})
@@ -1,60 +1,77 @@
1
+ - const { envId, region, option ,accessToken } = theme.twikoo
2
+ - const { lazyload, count, use,commentBarrage } = theme.comment
3
+
1
4
  script.
2
- async function initComment() {
3
- const initOptions = Object.assign(
4
- !{JSON.stringify(theme.comment.twikoo || {})},
5
- {
6
- el: '#comment',
7
- onCommentLoaded: async function () {
8
- GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
9
- sco.owoBig()
10
- GLOBAL_CONFIG.comment.commentBarrage && PAGE_CONFIG.comment && initializeCommentBarrage(await fetchComments())
11
- },
12
- lang: '#{theme.comment.twikoo.lang}',
13
- }
14
- )
15
- await twikoo.init(initOptions)
16
- if (#{theme.post.meta.comment && is_post()}) {
17
- var countOptions = Object.assign(
18
- !{JSON.stringify(theme.comment.twikoo || {})},
19
- {
20
- urls: [window.location.pathname],
21
- includeReply: false
5
+ !function () {
6
+ const getCount = () => {
7
+ const ele = document.querySelectorAll('.twikoo-count')
8
+ if (!ele) return
9
+ twikoo.getCommentsCount({
10
+ envId: '!{envId}',
11
+ region: '!{region}',
12
+ urls: [window.location.pathname],
13
+ includeReply: false
14
+ }).then(res => {
15
+ ele.forEach(item => item.textContent = res[0].count)
16
+ }).catch(err => {
17
+ console.error(err)
18
+ })
19
+ }
20
+ const init = async () => {
21
+ twikoo.init(Object.assign({
22
+ el: '#twikoo-wrap',
23
+ envId: '!{envId}',
24
+ region: '!{region}',
25
+ onCommentLoaded: () => {
26
+ utils.lightbox(document.querySelectorAll('#twikoo .tk-content img:not(.tk-owo-emotion)'))
22
27
  }
23
- )
24
- const res = await twikoo.getCommentsCount(countOptions)
25
- try {
26
- document.getElementById('twikoo-count').innerText = res[0].count
27
- document.querySelector('.comment-headline span:last-child').innerText = ` (${res[0].count})`
28
- } catch (e) {
29
- document.getElementById('twikoo-count').innerText = '加载错误'
30
- }
28
+ }, !{JSON.stringify(option)}))
29
+
30
+ !{count ? ' && getCount()' : ''}
31
+ sco.owoBig({
32
+ body: '.OwO-body',
33
+ item: '.OwO-items li'
34
+ })
35
+
36
+ if (!{commentBarrage}) await barrageTwikoo()
31
37
  }
32
38
 
33
- async function fetchComments() {
34
- try {
35
- const response = await fetch("!{theme.comment.twikoo.envId}", {
36
- method: "POST",
37
- headers: {
38
- "Content-Type": "application/json"
39
- },
40
- body: JSON.stringify({
41
- event: "COMMENT_GET",
42
- accessToken: "!{theme.comment.twikoo.accessToken}",
43
- url: window.location.pathname
44
- })
45
- });
46
- if (!response.ok) {
47
- throw new Error("HTTP error! status: " + response.status);
48
- }
49
- const data = await response.json();
50
- return (data.data).map(item => Object.assign({
51
- content: item.comment,
52
- nick: item.nick,
53
- mailMd5: item.mailMd5,
54
- id: item.id
55
- }))
56
- } catch (error) {
57
- console.error("An error occurred while fetching comments: ", error);
58
- }
39
+ const loadTwikoo = () => {
40
+ if (typeof twikoo === 'object') init()
41
+ else utils.getScript('!{url_for(theme.cdn.twikoo)}').then(init)
42
+ }
43
+
44
+ if ('!{use[0]}' === 'Twikoo' || !{lazyload}) {
45
+ if (!{lazyload}) utils.loadComment(document.getElementById('twikoo-wrap'), loadTwikoo)
46
+ else loadTwikoo()
47
+ } else {
48
+ window.loadTwoComment = init
59
49
  }
60
- }
50
+ }()
51
+
52
+ if commentBarrage
53
+ script.
54
+ const barrageTwikoo = async () => {
55
+ await fetch("!{envId}", {
56
+ method: "POST",
57
+ headers: {
58
+ "Content-Type": "application/json"
59
+ },
60
+ body: JSON.stringify({
61
+ event: "COMMENT_GET",
62
+ accessToken: "!{accessToken}",
63
+ url: window.location.pathname
64
+ })
65
+ }).then(async res => {
66
+ if (!res.ok) throw new Error("HTTP error! status: " + res.status)
67
+ const data = await res.json();
68
+ await utils.getScript('!{url_for(theme.cdn.commentBarrage)}').then(() => {
69
+ initializeCommentBarrage((data.data).map(item => Object.assign({
70
+ content: item.comment,
71
+ nick: item.nick,
72
+ mailMd5: item.mailMd5,
73
+ id: item.id
74
+ })))
75
+ })
76
+ }).catch(error => console.error("An error occurred while fetching comments: ", error))
77
+ }
@@ -1,15 +1,15 @@
1
- - const { lazyload, count } = theme.comment
2
- - const { appId, appKey, avatar, serverURLs, visitor, option } = theme.comment.valine
1
+ - const { lazyload, count, use,commentBarrage } = theme.comment
2
+ - const { appId, appKey, avatar, serverURLs, visitor, option } = theme.valine
3
3
  - let emojiMaps = '""'
4
4
 
5
5
  if site.data.valine
6
6
  - emojiMaps = JSON.stringify(site.data.valine)
7
7
 
8
8
  script.
9
- async function initComment() {
10
- const initValine = async () => {
11
- const valine = new Valine(Object.assign({
12
- el: '#comment',
9
+ !function () {
10
+ const initValine = () => {
11
+ const valine = new Valine({
12
+ el: '#vcomment',
13
13
  appId: '#{appId}',
14
14
  appKey: '#{appKey}',
15
15
  avatar: '#{avatar}',
@@ -18,59 +18,53 @@ script.
18
18
  path: window.location.pathname,
19
19
  visitor: #{visitor},
20
20
  ...!{JSON.stringify(option)}
21
- }))
22
-
23
- if (GLOBAL_CONFIG.lightbox) {
24
- utils.lightbox(document.querySelectorAll('#comment .vcontent img:not(.vemoji)'));
21
+ })
22
+ GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll('#comment .vcontent img:not(.vemoji)'))
23
+ sco.owoBig({body: '.vwrap', item: '.vemojis i'})
24
+ }
25
+ const loadValine = async () => {
26
+ if (typeof Valine === 'function') await initValine()
27
+ else {
28
+ await utils.getScript('!{url_for(theme.cdn.valine)}').then(initValine)
25
29
  }
26
-
27
- sco.owoBig();
28
- GLOBAL_CONFIG.comment.commentBarrage && PAGE_CONFIG.comment && initializeCommentBarrage(await fetchComments())
30
+ !{commentBarrage} && barrageValine()
29
31
  }
30
-
31
- if (!!{lazyload}) {
32
- if (!{lazyload}) utils.loadComment(document.getElementById('comment'), initValine)
33
- else setTimeout(initValine, 0)
32
+ if ('!{use[0]}' === 'Valine' || !{lazyload}) {
33
+ if (!{lazyload}) utils.loadComment(document.getElementById('vcomment'), loadValine)
34
+ else loadValine()
34
35
  } else {
35
- await initValine()
36
+ window.loadTwoComment = loadValine
36
37
  }
38
+ }()
37
39
 
38
- async function fetchComments() {
39
- const url = new URL('#{serverURLs}' + '/1.1/classes/Comment');
40
+ if commentBarrage
41
+ script.
42
+ const barrageValine = async () => {
43
+ const url = new URL('!{serverURLs}/1.1/classes/Comment')
40
44
  const params = {
41
45
  url: window.location.pathname,
42
46
  order: '-createdAt'
43
- };
44
-
45
- for (const [key, value] of Object.entries(params)) {
46
- url.searchParams.append(key, value);
47
47
  }
48
-
49
- try {
50
- const response = await fetch(url, {
51
- method: "GET",
52
- headers: {
53
- "X-LC-Id": "#{appId}",
54
- "X-LC-Key": '#{appKey}',
55
- "Content-Type": "application/json"
56
- },
57
- });
58
-
59
- if (!response.ok) {
60
- throw new Error(`HTTP error! status: ${response.status}`);
61
- }
62
-
63
- const data = await response.json();
64
- return (data.results.filter(item => item.url === window.location.pathname)).map(item =>
65
- Object.assign({
48
+ Object.entries(params).forEach(([key, value]) => url.searchParams.append(key, value))
49
+ await fetch(url, {
50
+ method: "GET",
51
+ headers: {
52
+ "X-LC-Id": "#{appId}",
53
+ "X-LC-Key": "#{appKey}",
54
+ "Content-Type": "application/json"
55
+ },
56
+ }).then(async res => {
57
+ if (!res.ok) throw new Error(`HTTP error! status: ${res.status}`)
58
+ const data = await res.json()
59
+ if(typeof md5 ==="undefined") await utils.getScript('!{url_for(theme.cdn.blueimp_md5)}')
60
+ await utils.getScript('!{url_for(theme.cdn.commentBarrage)}')
61
+ initializeCommentBarrage(data.results
62
+ .filter(item => item.url === window.location.pathname)
63
+ .map(item => ({
66
64
  content: item.comment,
67
65
  nick: item.nick,
68
66
  mailMd5: md5(item.mail),
69
67
  id: item.objectId
70
- })
71
- )
72
- } catch (error) {
73
- console.error("An error occurred while fetching comments: ", error);
74
- }
75
- }
76
- }
68
+ })))
69
+ }).catch(error => console.error("An error occurred while fetching comments: ", error))
70
+ }
@@ -1,72 +1,64 @@
1
1
  - const { envId, option ,pageview } = theme.comment.waline
2
- - const { lazyload, count } = theme.comment
2
+ - const { lazyload, count, commentBarrage } = theme.comment
3
3
 
4
4
  script.
5
- async function initComment() {
6
- const isLazyLoad = !!{lazyload};
7
- let walineInitFunction = window.walineFn || null;
5
+ !function () {
6
+ let walineInitFunction = window.walineFn || null
8
7
 
9
- async function initWaline(Fn) {
8
+ function initWaline(initFn) {
10
9
  const walineOptions = {
11
- el: '#comment',
10
+ el: '#waline-wrap',
12
11
  serverURL: '!{envId}',
13
- pageview: !isLazyLoad,
12
+ pageview: !{pageview},
14
13
  dark: 'html[data-theme="dark"]',
15
14
  path: window.location.pathname,
16
- comment: !isLazyLoad,
15
+ comment: !{count},
17
16
  ...!{JSON.stringify(option)}
18
- };
19
- const walineInstance = Fn(walineOptions);
20
-
21
- utils.addGlobalFn('pjax', () => walineInstance.destroy(), 'destroyWaline');
22
-
23
- if (GLOBAL_CONFIG.lightbox) {
24
- utils.lightbox(document.querySelectorAll('#comment .wl-content img:not(.wl-emoji)'));
25
17
  }
26
-
27
- sco.owoBig();
28
-
29
- GLOBAL_CONFIG.comment.commentBarrage && PAGE_CONFIG.comment && initializeCommentBarrage(await fetchComments())
30
- }
31
-
32
- if (isLazyLoad) {
33
- utils.loadComment(document.getElementById('comment'), initWaline(walineInitFunction));
34
- } else {
35
- await initWaline(walineInitFunction);
18
+ const walineInstance = initFn(walineOptions)
19
+ utils.addGlobalFn('pjax', () => walineInstance.destroy(), 'destroyWaline')
20
+ GLOBAL_CONFIG.lightbox && utils.lightbox(document.querySelectorAll('#comment .wl-content img:not(.wl-emoji)'))
21
+ sco.owoBig()
36
22
  }
37
23
 
38
- async function fetchComments() {
39
- const url = new URL('#{envId}/api/comment');
40
- const params = {
41
- path: window.location.pathname,
42
- sortBy: 'insertedAt_asc'
43
- };
44
-
45
- for (const [key, value] of Object.entries(params)) {
46
- url.searchParams.append(key, value);
24
+ async function loadWaline() {
25
+ if (walineInitFunction) initWaline(walineInitFunction)
26
+ else {
27
+ await utils.getCSS('!{url_for(theme.cdn.waline_css)}')
28
+ const {init} = await import('!{url_for(theme.cdn.waline_js)}')
29
+ walineInitFunction = init || Waline.init
30
+ initWaline(walineInitFunction)
31
+ window.walineFn = walineInitFunction
47
32
  }
33
+ if (!{commentBarrage}) barrageWaline()
34
+ }
48
35
 
49
- try {
50
- const response = await fetch(url, {
51
- method: "GET",
52
- headers: {
53
- "Content-Type": "application/json"
54
- },
55
- });
56
-
57
- if (!response.ok) {
58
- throw new Error(`HTTP error! status: ${response.status}`);
59
- }
36
+ if ('!{use[0]}' === 'Valine' || !{lazyload}) {
37
+ if (!{lazyload}) utils.loadComment(document.getElementById('waline-wrap'), loadWaline)
38
+ else loadWaline()
39
+ } else window.loadTwoComment = loadWaline
40
+ }()
60
41
 
42
+ if commentBarrage
43
+ script.
44
+ const barrageWaline = async () => {
45
+ const url = new URL('!{envId}/api/comment')
46
+ const params = {path: window.location.pathname, sortBy: 'insertedAt_asc'}
47
+ Object.entries(params).forEach(([key, value]) => url.searchParams.append(key, value))
48
+ const response = await fetch(url, {
49
+ method: "GET",
50
+ headers: {
51
+ "Content-Type": "application/json"
52
+ },
53
+ }).then(async res => {
54
+ if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`)
61
55
  const data = await response.json();
62
- return (data.data).map(item => Object.assign({
56
+ await utils.getScript('!{url_for(theme.cdn.commentBarrage)}')
57
+ initializeCommentBarrage(data.data.map(item => ({
63
58
  nick: item.nick,
64
59
  mailId: item.avatar,
65
60
  content: item.comment,
66
61
  id: item.objectId
67
- }))
68
- } catch (error) {
69
- console.error("An error occurred while fetching comments: ", error);
70
- }
71
- }
72
- }
62
+ })))
63
+ }).catch(error => console.error("An error occurred while fetching comments: ", error))
64
+ }