nodebb-theme-harmony 0.0.11 → 0.0.12

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/library.js CHANGED
@@ -99,6 +99,7 @@ library.getThemeConfig = async function (config) {
99
99
  config.enableQuickReply = themeConfig.enableQuickReply === 'on';
100
100
  config.centerHeaderElements = themeConfig.centerHeaderElements === 'on';
101
101
  config.stickyToolbar = themeConfig.stickyToolbar === 'on';
102
+ config.openDraftsOnPageLoad = false;
102
103
  return config;
103
104
  };
104
105
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-harmony",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "nbbpm": {
5
5
  "compatibility": "^3.0.0"
6
6
  },
package/public/harmony.js CHANGED
@@ -76,13 +76,20 @@ $(document).ready(function () {
76
76
 
77
77
  async function renderDraftList() {
78
78
  const draftListEl = $('[component="drafts/list"]');
79
- draftListEl.find('[data-save-id]').remove();
79
+ draftListEl.children(':not(.no-drafts)').remove();
80
80
 
81
81
  const draftItems = drafts.listAvailable();
82
+ console.log('harmony sees', draftItems);
82
83
  if (!draftItems.length) {
83
84
  draftListEl.find('.no-drafts').removeClass('hidden');
84
85
  return;
85
86
  }
87
+ draftItems.reverse().forEach((draft) => {
88
+ if (draft) {
89
+ draft.text = draft.text.replace(/(?:\r\n|\r|\n)/g, '<br>');
90
+ }
91
+ });
92
+ console.log(draftItems);
86
93
  const html = await app.parseAndTranslate('partials/sidebar/drafts', 'drafts', { drafts: draftItems });
87
94
  draftListEl.find('.no-drafts').addClass('hidden');
88
95
  draftListEl.append(html).find('.timeago').timeago();
@@ -97,6 +104,8 @@ $(document).ready(function () {
97
104
 
98
105
  draftsEl.on('click', '[component="drafts/delete"]', function () {
99
106
  drafts.removeDraft($(this).attr('data-save-id'));
107
+ renderDraftList();
108
+ return false;
100
109
  });
101
110
 
102
111
  $(window).on('action:composer.drafts.save', updateBadgeCount);
package/scss/common.scss CHANGED
@@ -2,6 +2,9 @@
2
2
  body {
3
3
  overflow-y: scroll;
4
4
  }
5
+ .ff-base {
6
+ font-family: $font-family-base;
7
+ }
5
8
  .ff-secondary {
6
9
  font-family: $font-family-secondary;
7
10
  }
package/scss/sidebar.scss CHANGED
@@ -75,6 +75,7 @@
75
75
 
76
76
  .chats-dropdown, .notifications-dropdown, .drafts-dropdown {
77
77
  min-width: 300px;
78
+ width: 300px;
78
79
  ul {
79
80
  max-height: 400px;
80
81
  overflow-y: auto;
@@ -116,12 +117,3 @@
116
117
  max-height: 100%;
117
118
  }
118
119
  }
119
-
120
- .sidebar-left {
121
- border-right: 1px solid $border-color;
122
- left: 0px;
123
- }
124
- .sidebar-right {
125
- border-left: 1px solid $border-color;
126
- right: 0px;
127
- }
package/scss/skins.scss CHANGED
@@ -1,6 +1,6 @@
1
1
  .skin-quartz {
2
2
  // $body-bg-image is gradient in quartz
3
- .icon {
3
+ [component="post"] .icon {
4
4
  background-color: transparent !important;
5
5
  }
6
6
  }
@@ -10,4 +10,11 @@
10
10
  .topic-list-header .btn, .topic-main-buttons .btn {
11
11
  padding: 6px 12px;
12
12
  }
13
+ }
14
+
15
+ .skin-yeti {
16
+ .badge {
17
+ padding-left: 0.5rem;
18
+ padding-right: 0.5rem;
19
+ }
13
20
  }
@@ -14,8 +14,8 @@
14
14
  <!-- IMPORT partials/chats/options.tpl -->
15
15
  </div>
16
16
  <hr class="text-muted opacity-25"/>
17
- <div class="position-relative">
18
- <div component="chat/messages/scroll-up-alert" class="position-absolute me-md-4 end-0 text-sm scroll-up-alert alert alert-info hidden w-25 d-none d-md-block" role="button" style="z-index: 1;">[[modules:chat.scroll-up-alert]]</div>
17
+ <div class="row position-relative justify-content-center mx-5">
18
+ <div component="chat/messages/scroll-up-alert" class="col-12 col-xl-6 position-absolute text-sm scroll-up-alert alert alert-info hidden d-none d-md-block" role="button" style="z-index: 1;">[[modules:chat.scroll-up-alert]]</div>
19
19
  </div>
20
20
  <ul class="chat-content p-0 m-0 list-unstyled overflow-auto flex-grow-1">
21
21
  <!-- IMPORT partials/chats/messages.tpl -->
@@ -10,19 +10,30 @@
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 gap-1">
13
+ <ul component="drafts/list" class="draft-list list-unstyled d-flex flex-column gap-1 pe-1">
14
14
  <li class="no-drafts text-center p-2">[[modules:composer.no-drafts]]</li>
15
15
 
16
16
  {{{ each drafts }}}
17
17
  {{{ if !@first}}}
18
18
  <hr class="m-0"/>
19
19
  {{{ end }}}
20
- <li class="dropdown-item rounded-1 p-2" data-save-id="{./save_id}">
21
- <div class="d-flex gap-1 justify-content-between">
22
- <div class="d-flex flex-column" component="drafts/open" data-save-id="{./save_id}">
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") }}}
23
24
  {{{ if ./title}}}
24
- <div class="text text-xs fw-semibold">{./title}</div>
25
+ <div class="text text-xs fw-semibold line-clamp-2">{./title}</div>
25
26
  {{{ end }}}
27
+ {{{ end }}}
28
+
29
+ {{{ if (./action == "posts.reply") }}}
30
+ <div class="text text-xs fw-semibold line-clamp-2">[[topic:composer.replying_to, "{./title}"]]</div>
31
+ {{{ end }}}
32
+
33
+ {{{ if (./action == "posts.edit") }}}
34
+ <div class="text text-xs fw-semibold line-clamp-2">[[topic:composer.editing]]</div>
35
+ {{{ end }}}
36
+
26
37
  {{{ if ./text }}}
27
38
  <div class="text text-sm line-clamp-3">{./text}</div>
28
39
  {{{ end }}}
@@ -1,4 +1,4 @@
1
- <nav class="text-dark bg-light sidebar sidebar-left vh-100 d-none d-md-flex flex-column justify-content-between sticky-top ff-secondary">
1
+ <nav class="text-dark bg-light sidebar sidebar-left start-0 border-end vh-100 d-none d-md-flex flex-column justify-content-between sticky-top ff-secondary">
2
2
  <ul id="main-nav" class="list-unstyled d-flex flex-column w-100 gap-2 mt-2">
3
3
  {{{ each navigation }}}
4
4
  <!-- IF function.displayMenuItem, @index -->
@@ -1,4 +1,4 @@
1
- <nav class="text-dark bg-light sidebar sidebar-right vh-100 d-none d-md-flex flex-column sticky-top ff-secondary">
1
+ <nav class="text-dark bg-light sidebar sidebar-right end-0 border-start vh-100 d-none d-md-flex flex-column sticky-top ff-secondary">
2
2
  {{{ if config.loggedIn }}}
3
3
  <ul id="logged-in-menu" class="list-unstyled d-flex flex-column w-100 gap-2 mt-2">
4
4
  <!-- IMPORT partials/sidebar/logged-in-menu.tpl -->
@@ -1,41 +0,0 @@
1
- <div id="chat-modal" class="chat-modal d-flex flex-nowrap modal hide" tabindex="-1" role="dialog" aria-labelledby="Chat" aria-hidden="true" data-backdrop="none">
2
- <div class="modal-dialog">
3
- <div class="modal-content">
4
- <div class="modal-header d-flex">
5
- <div class="fs-5 flex-grow-1" component="chat/room/name"><!-- IF roomName -->{roomName}<!-- ELSE -->{usernames}<!-- ENDIF roomName --></div>
6
- <button type="button" class="btn btn-outline d-none d-md-flex" data-action="maximize">
7
- <span aria-hidden="true"><i class="fa fa-fw fa-expand"></i></span>
8
- <span class="sr-only">[[modules:chat.maximize]]</span>
9
- </button>
10
- <button type="button" class="btn btn-outline d-none d-md-flex" data-action="minimize">
11
- <span aria-hidden="true"><i class="fa fa-fw fa-minus"></i></span>
12
- <span class="sr-only">[[modules:chat.minimize]]</span>
13
- </button>
14
- <!-- IMPORT partials/chats/options.tpl -->
15
-
16
- <button id="chat-close-btn" type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
17
- </div>
18
-
19
- <div class="modal-body d-flex flex-column" style="height: 500px;">
20
- <div class="position-relative">
21
- <div component="chat/messages/scroll-up-alert" class="position-absolute scroll-up-alert alert alert-info hidden w-100" role="button" style="z-index: 1;">[[modules:chat.scroll-up-alert]]</div>
22
- </div>
23
- <ul class="chat-content p-0 m-0 list-unstyled d-flex flex-column overflow-auto flex-grow-1" component="chat/messages">
24
- <!-- IMPORT partials/chats/messages.tpl -->
25
- </ul>
26
-
27
- <div component="chat/composer" class="d-flex">
28
- <div class="flex-grow-1 position-relative">
29
- <textarea component="chat/input" placeholder="[[modules:chat.placeholder]]" class="form-control chat-input mousetrap" rows="2"></textarea>
30
- <span component="chat/message/remaining" class="text-muted position-absolute me-1 mb-1" style="right: 0px; bottom:0px;">{maximumChatMessageLength}</span>
31
- </div>
32
- <button class="btn btn-primary" type="button" data-action="send"><i class="fa fa-fw fa-2x fa-paper-plane"></i></button>
33
- <form component="chat/upload" method="post" enctype="multipart/form-data">
34
- <input type="file" name="files[]" multiple class="hidden"/>
35
- </form>
36
- </div>
37
- </div>
38
- <div class="imagedrop"><div>[[topic:composer.drag_and_drop_images]]</div></div>
39
- </div>
40
- </div>
41
- </div>