nodebb-theme-harmony 0.0.11 → 0.0.13
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 +6 -1
- package/package.json +1 -1
- package/public/harmony.js +22 -4
- package/scss/common.scss +3 -0
- package/scss/sidebar.scss +1 -9
- package/scss/skins.scss +8 -1
- package/templates/groups/details.tpl +11 -0
- package/templates/partials/chats/message-window.tpl +2 -2
- package/templates/partials/quick-search-results.tpl +1 -1
- package/templates/partials/sidebar/drafts.tpl +16 -5
- package/templates/partials/sidebar-left.tpl +1 -1
- package/templates/partials/sidebar-right.tpl +1 -1
- package/templates/chat.tpl +0 -41
package/library.js
CHANGED
|
@@ -12,6 +12,7 @@ const defaults = {
|
|
|
12
12
|
enableQuickReply: 'on',
|
|
13
13
|
centerHeaderElements: 'off',
|
|
14
14
|
stickyToolbar: 'on',
|
|
15
|
+
openSidebars: 'off',
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
library.init = async function (params) {
|
|
@@ -99,6 +100,8 @@ library.getThemeConfig = async function (config) {
|
|
|
99
100
|
config.enableQuickReply = themeConfig.enableQuickReply === 'on';
|
|
100
101
|
config.centerHeaderElements = themeConfig.centerHeaderElements === 'on';
|
|
101
102
|
config.stickyToolbar = themeConfig.stickyToolbar === 'on';
|
|
103
|
+
config.openSidebars = themeConfig.openSidebars === 'on';
|
|
104
|
+
config.openDraftsOnPageLoad = false;
|
|
102
105
|
return config;
|
|
103
106
|
};
|
|
104
107
|
|
|
@@ -114,7 +117,9 @@ library.getAdminSettings = async function (hookData) {
|
|
|
114
117
|
|
|
115
118
|
library.saveUserSettings = async function (hookData) {
|
|
116
119
|
Object.keys(defaults).forEach((key) => {
|
|
117
|
-
|
|
120
|
+
if (hookData.data.hasOwnProperty(key)) {
|
|
121
|
+
hookData.settings[key] = hookData.data[key] || undefined;
|
|
122
|
+
}
|
|
118
123
|
});
|
|
119
124
|
return hookData;
|
|
120
125
|
};
|
package/package.json
CHANGED
package/public/harmony.js
CHANGED
|
@@ -35,9 +35,19 @@ $(document).ready(function () {
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
function setupMobileMenu() {
|
|
38
|
-
|
|
39
|
-
$('
|
|
40
|
-
|
|
38
|
+
require(['api'], function (api) {
|
|
39
|
+
$('[component="sidebar/toggle"]').on('click', async function () {
|
|
40
|
+
const sidebarEl = $('.sidebar');
|
|
41
|
+
sidebarEl.toggleClass('open');
|
|
42
|
+
if (app.user.uid) {
|
|
43
|
+
await api.put(`/users/${app.user.uid}/settings`, {
|
|
44
|
+
settings: {
|
|
45
|
+
openSidebars: sidebarEl.hasClass('open') ? 'on' : 'off',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
$(window).trigger('action:sidebar.toggle');
|
|
50
|
+
});
|
|
41
51
|
});
|
|
42
52
|
}
|
|
43
53
|
|
|
@@ -76,13 +86,19 @@ $(document).ready(function () {
|
|
|
76
86
|
|
|
77
87
|
async function renderDraftList() {
|
|
78
88
|
const draftListEl = $('[component="drafts/list"]');
|
|
79
|
-
draftListEl.
|
|
89
|
+
draftListEl.children(':not(.no-drafts)').remove();
|
|
80
90
|
|
|
81
91
|
const draftItems = drafts.listAvailable();
|
|
82
92
|
if (!draftItems.length) {
|
|
83
93
|
draftListEl.find('.no-drafts').removeClass('hidden');
|
|
84
94
|
return;
|
|
85
95
|
}
|
|
96
|
+
draftItems.reverse().forEach((draft) => {
|
|
97
|
+
if (draft) {
|
|
98
|
+
draft.text = draft.text.replace(/(?:\r\n|\r|\n)/g, '<br>');
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
86
102
|
const html = await app.parseAndTranslate('partials/sidebar/drafts', 'drafts', { drafts: draftItems });
|
|
87
103
|
draftListEl.find('.no-drafts').addClass('hidden');
|
|
88
104
|
draftListEl.append(html).find('.timeago').timeago();
|
|
@@ -97,6 +113,8 @@ $(document).ready(function () {
|
|
|
97
113
|
|
|
98
114
|
draftsEl.on('click', '[component="drafts/delete"]', function () {
|
|
99
115
|
drafts.removeDraft($(this).attr('data-save-id'));
|
|
116
|
+
renderDraftList();
|
|
117
|
+
return false;
|
|
100
118
|
});
|
|
101
119
|
|
|
102
120
|
$(window).on('action:composer.drafts.save', updateBadgeCount);
|
package/scss/common.scss
CHANGED
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
|
}
|
|
@@ -34,6 +34,11 @@
|
|
|
34
34
|
</div>
|
|
35
35
|
|
|
36
36
|
<div class="d-flex flex-column flex-md-row">
|
|
37
|
+
<div data-widget-area="left">
|
|
38
|
+
{{{each widgets.left}}}
|
|
39
|
+
{{widgets.left.html}}
|
|
40
|
+
{{{end}}}
|
|
41
|
+
</div>
|
|
37
42
|
<!-- IMPORT partials/groups/sidebar-left.tpl -->
|
|
38
43
|
|
|
39
44
|
<div class="flex-1 ps-md-2 ps-lg-5" style="min-width:0;">
|
|
@@ -68,5 +73,11 @@
|
|
|
68
73
|
{{{ end }}}
|
|
69
74
|
</div>
|
|
70
75
|
</div>
|
|
76
|
+
|
|
77
|
+
<div data-widget-area="right">
|
|
78
|
+
{{{each widgets.right}}}
|
|
79
|
+
{{widgets.right.html}}
|
|
80
|
+
{{{end}}}
|
|
81
|
+
</div>
|
|
71
82
|
</div>
|
|
72
83
|
</div>
|
|
@@ -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="
|
|
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 -->
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
{{{ end }}}
|
|
43
43
|
|
|
44
44
|
{{{if !posts.length}}}
|
|
45
|
-
<div class="text-center no-results">[[search:no-matches]]</li>
|
|
45
|
+
<div class="text-center no-results py-2 py-md-0">[[search:no-matches]]</li>
|
|
46
46
|
<li role="separator" class="dropdown-divider d-block d-md-none"></li>
|
|
47
47
|
{{{end}}}
|
|
@@ -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="
|
|
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="{{{ if config.openSidebars}}}open{{{ end }}} 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="{{{ if config.openSidebars}}}open{{{ end }}} 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 -->
|
package/templates/chat.tpl
DELETED
|
@@ -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>
|