nodebb-theme-harmony 1.0.0-beta.34 → 1.0.0-beta.36

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": "nodebb-theme-harmony",
3
- "version": "1.0.0-beta.34",
3
+ "version": "1.0.0-beta.36",
4
4
  "nbbpm": {
5
5
  "compatibility": "^3.0.0"
6
6
  },
package/public/harmony.js CHANGED
@@ -77,24 +77,25 @@ $(document).ready(function () {
77
77
 
78
78
  async function renderDraftList() {
79
79
  const draftListEl = $('[component="drafts/list"]');
80
- draftListEl.children(':not(.no-drafts)').remove();
81
-
82
80
  const draftItems = drafts.listAvailable();
83
81
  if (!draftItems.length) {
84
82
  draftListEl.find('.no-drafts').removeClass('hidden');
83
+ draftListEl.find('.placeholder-wave').addClass('hidden');
84
+ draftListEl.find('.draft-item-container').html('');
85
85
  return;
86
86
  }
87
87
  draftItems.reverse().forEach((draft) => {
88
88
  if (draft) {
89
89
  draft.text = utils.escapeHTML(
90
- draft.text.replace(/(?:\r\n|\r|\n)/g, '<br>')
91
- );
90
+ draft.text
91
+ ).replace(/(?:\r\n|\r|\n)/g, '<br>');
92
92
  }
93
93
  });
94
94
 
95
95
  const html = await app.parseAndTranslate('partials/sidebar/drafts', 'drafts', { drafts: draftItems });
96
96
  draftListEl.find('.no-drafts').addClass('hidden');
97
- draftListEl.append(html).find('.timeago').timeago();
97
+ draftListEl.find('.placeholder-wave').addClass('hidden');
98
+ draftListEl.find('.draft-item-container').html(html).find('.timeago').timeago();
98
99
  }
99
100
 
100
101
 
@@ -10,43 +10,51 @@
10
10
  </a>
11
11
  <ul class="drafts-dropdown dropdown-menu p-1 shadow">
12
12
  <li>
13
- <ul component="drafts/list" class="draft-list list-unstyled d-flex flex-column overscroll-behavior-contain gap-1 pe-1">
14
- <li class="no-drafts text-center p-2">[[modules:composer.no-drafts]]</li>
15
-
16
- {{{ each drafts }}}
17
- {{{ if !@first}}}
18
- <hr class="m-0"/>
19
- {{{ end }}}
20
- <li class="" data-save-id="{./save_id}">
21
- <div class="d-flex gap-1 justify-content-between ff-base">
22
- <div class="dropdown-item rounded-1 p-2 d-flex flex-column gap-2 pointer" component="drafts/open" data-save-id="{./save_id}">
23
- {{{ if (./action == "topics.post") }}}
24
- {{{ if ./title}}}
25
- <div class="text text-xs fw-semibold line-clamp-2 text-break">{./title}</div>
26
- {{{ end }}}
27
- {{{ end }}}
13
+ <div component="drafts/list" class="draft-list list-unstyled d-flex flex-column overscroll-behavior-contain gap-1 pe-1">
14
+ <div class="dropdown-item rounded-1 p-2 d-flex gap-2 placeholder-wave">
15
+ <div class="d-flex flex-grow-1 flex-column w-100">
16
+ <div class="text-xs placeholder col-3">&nbsp;</div>
17
+ <div class="text-sm placeholder col-11">&nbsp;</div>
18
+ <div class="text-xs placeholder col-4">&nbsp;</div>
19
+ </div>
20
+ </div>
21
+ <div class="hidden no-drafts text-center p-2">[[modules:composer.no-drafts]]</div>
22
+ <div class="draft-item-container">
23
+ {{{ each drafts }}}
24
+ {{{ if !@first}}}
25
+ <hr class="my-1"/>
26
+ {{{ end }}}
27
+ <div data-save-id="{./save_id}">
28
+ <div class="d-flex gap-1 justify-content-between ff-base">
29
+ <div class="dropdown-item rounded-1 p-2 d-flex flex-column gap-2 pointer" component="drafts/open" data-save-id="{./save_id}">
30
+ {{{ if (./action == "topics.post") }}}
31
+ {{{ if ./title}}}
32
+ <div class="text text-xs fw-semibold line-clamp-2 text-break">{./title}</div>
33
+ {{{ end }}}
34
+ {{{ end }}}
28
35
 
29
- {{{ if (./action == "posts.reply") }}}
30
- <div class="text text-xs fw-semibold line-clamp-2 text-break">[[topic:composer.replying_to, "{./title}"]]</div>
31
- {{{ end }}}
36
+ {{{ if (./action == "posts.reply") }}}
37
+ <div class="text text-xs fw-semibold line-clamp-2 text-break">[[topic:composer.replying_to, "{./title}"]]</div>
38
+ {{{ end }}}
32
39
 
33
- {{{ if (./action == "posts.edit") }}}
34
- <div class="text text-xs fw-semibold line-clamp-2">[[topic:composer.editing]]</div>
35
- {{{ end }}}
40
+ {{{ if (./action == "posts.edit") }}}
41
+ <div class="text text-xs fw-semibold line-clamp-2">[[topic:composer.editing]]</div>
42
+ {{{ end }}}
36
43
 
37
- {{{ if ./text }}}
38
- <div class="text text-sm line-clamp-3 text-break">{./text}</div>
39
- {{{ end }}}
40
- <div class="timeago text-xs text-muted" title="{./timestampISO}"></div>
41
- </div>
42
- <div class="">
43
- <button component="drafts/delete" data-save-id="{./save_id}" class="btn btn-light btn-sm">
44
- <i class="unread fa fa-xs fa-trash text-secondary"></i>
45
- </button>
44
+ {{{ if ./text }}}
45
+ <div class="text text-sm line-clamp-3 text-break">{./text}</div>
46
+ {{{ end }}}
47
+ <div class="timeago text-xs text-muted" title="{./timestampISO}"></div>
48
+ </div>
49
+ <div>
50
+ <button component="drafts/delete" data-save-id="{./save_id}" class="btn btn-light btn-sm">
51
+ <i class="unread fa fa-xs fa-trash text-secondary"></i>
52
+ </button>
53
+ </div>
46
54
  </div>
47
55
  </div>
48
- </li>
49
- {{{ end }}}
50
- </ul>
56
+ {{{ end }}}
57
+ </div>
58
+ </div>
51
59
  </li>
52
60
  </ul>
@@ -19,7 +19,7 @@
19
19
  {{{ if !scheduled }}}
20
20
  <li {{{ if !deleted }}}hidden{{{ end }}}><a component="topic/restore" href="#" class="dropdown-item {{{ if !deleted }}}hidden{{{ end }}}"><i class="fa fa-fw fa-history"></i> [[topic:thread_tools.restore]]</a></li>
21
21
  {{{ end }}}
22
- {{{ if privileges.purge }}]
22
+ {{{ if privileges.purge }}}
23
23
  <li {{{ if !deleted }}}hidden{{{ end }}}><a component="topic/purge" href="#" class="dropdown-item {{{ if !deleted }}}hidden{{{ end }}}"><i class="fa fa-fw fa-eraser"></i> [[topic:thread_tools.purge]]</a></li>
24
24
  {{{ end }}}
25
25
  {{{ if privileges.isAdminOrMod }}}