nodebb-theme-harmony 1.0.0 → 1.0.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.
- package/README.md +12 -1
- package/languages/en-GB/harmony.json +6 -1
- package/library.js +56 -25
- package/package.json +1 -1
- package/plugin.json +0 -1
- package/public/harmony.js +165 -41
- package/public/settings.js +1 -0
- package/screenshots/categories.png +0 -0
- package/screenshots/recent.png +0 -0
- package/screenshots/topic.png +0 -0
- package/scss/account.scss +1 -1
- package/scss/chats.scss +81 -26
- package/scss/common.scss +84 -10
- package/scss/flags.scss +5 -0
- package/scss/groups.scss +2 -2
- package/scss/harmony.scss +3 -0
- package/scss/mixins.scss +7 -3
- package/scss/modals.scss +5 -3
- package/scss/modules/bottom-sheet.scss +1 -1
- package/scss/modules/composer.scss +0 -4
- package/scss/modules/cover.scss +1 -11
- package/scss/modules/filters.scss +8 -0
- package/scss/modules/paginator.scss +24 -0
- package/scss/modules/tags.scss +2 -2
- package/scss/modules/topic-navigator.scss +18 -42
- package/scss/modules/topics-list.scss +32 -17
- package/scss/modules/user-menu.scss +6 -0
- package/scss/overrides.scss +4 -1
- package/scss/sidebar.scss +61 -8
- package/scss/topic.scss +36 -13
- package/templates/account/blocks.tpl +35 -40
- package/templates/account/categories.tpl +47 -29
- package/templates/account/consent.tpl +66 -10
- package/templates/account/edit/password.tpl +25 -30
- package/templates/account/edit/username.tpl +21 -26
- package/templates/account/edit.tpl +105 -116
- package/templates/account/followers.tpl +12 -19
- package/templates/account/following.tpl +12 -18
- package/templates/account/groups.tpl +12 -17
- package/templates/account/info.tpl +178 -206
- package/templates/account/posts.tpl +31 -36
- package/templates/account/profile.tpl +82 -72
- package/templates/account/sessions.tpl +8 -30
- package/templates/account/settings.tpl +222 -203
- package/templates/account/theme.tpl +39 -25
- package/templates/account/topics.tpl +36 -38
- package/templates/account/uploads.tpl +33 -40
- package/templates/admin/plugins/harmony.tpl +21 -3
- package/templates/categories.tpl +3 -6
- package/templates/category.tpl +13 -14
- package/templates/chats.tpl +9 -10
- package/templates/flags/detail.tpl +160 -193
- package/templates/flags/list.tpl +3 -70
- package/templates/footer.tpl +2 -2
- package/templates/groups/details.tpl +22 -19
- package/templates/groups/list.tpl +1 -1
- package/templates/groups/members.tpl +0 -2
- package/templates/header.tpl +2 -2
- package/templates/login.tpl +4 -4
- package/templates/notifications.tpl +5 -5
- package/templates/partials/account/admin-menu.tpl +9 -9
- package/templates/partials/account/category-item.tpl +14 -17
- package/templates/partials/account/footer.tpl +3 -0
- package/templates/partials/account/header.tpl +78 -81
- package/templates/partials/account/session-list.tpl +18 -0
- package/templates/partials/account/sidebar-left.tpl +31 -25
- package/templates/partials/breadcrumbs.tpl +6 -6
- package/templates/partials/buttons/newTopic.tpl +1 -1
- package/templates/partials/categories/item.tpl +31 -27
- package/templates/partials/categories/lastpost.tpl +7 -7
- package/templates/partials/category/filter-dropdown-content.tpl +37 -0
- package/templates/partials/{category-selector-content.tpl → category/selector-dropdown-content.tpl} +7 -7
- package/templates/partials/category/sort.tpl +22 -7
- package/templates/partials/category/subcategory.tpl +2 -3
- package/templates/partials/category/tags.tpl +0 -2
- package/templates/partials/category/tools.tpl +28 -25
- package/templates/partials/category/watch.tpl +39 -6
- package/templates/partials/chats/dropdown.tpl +4 -1
- package/templates/partials/chats/message-window.tpl +12 -8
- package/templates/partials/chats/message.tpl +8 -10
- package/templates/partials/chats/options.tpl +14 -6
- package/templates/partials/chats/recent_room.tpl +41 -32
- package/templates/partials/cookie-consent.tpl +5 -5
- package/templates/partials/flags/bulk-actions.tpl +9 -0
- package/templates/partials/flags/filters.tpl +165 -78
- package/templates/partials/flags/results.tpl +38 -0
- package/templates/partials/groups/admin.tpl +4 -4
- package/templates/partials/groups/badge.tpl +1 -1
- package/templates/partials/groups/invited.tpl +1 -1
- package/templates/partials/groups/list.tpl +2 -2
- package/templates/partials/groups/memberlist.tpl +2 -2
- package/templates/partials/groups/sidebar-left.tpl +10 -10
- package/templates/partials/header/brand.tpl +9 -2
- package/templates/partials/mobile-footer.tpl +69 -61
- package/templates/partials/notifications_list.tpl +11 -8
- package/templates/partials/paginator.tpl +11 -9
- package/templates/partials/post_bar.tpl +26 -24
- package/templates/partials/posts_list_item.tpl +5 -5
- package/templates/partials/quick-search-results.tpl +3 -3
- package/templates/partials/search-filters.tpl +184 -0
- package/templates/partials/search-results.tpl +28 -35
- package/templates/partials/sidebar/chats.tpl +26 -34
- package/templates/partials/sidebar/drafts.tpl +45 -34
- package/templates/partials/sidebar/logged-in-menu.tpl +5 -5
- package/templates/partials/sidebar/logged-out-menu.tpl +1 -1
- package/templates/partials/sidebar/notifications.tpl +30 -9
- package/templates/partials/sidebar/search-mobile.tpl +1 -1
- package/templates/partials/sidebar/search.tpl +1 -1
- package/templates/partials/sidebar/user-menu.tpl +38 -29
- package/templates/partials/sidebar-left.tpl +14 -11
- package/templates/partials/sidebar-right.tpl +1 -3
- package/templates/partials/skin-switcher.tpl +3 -3
- package/templates/partials/tags/filter-dropdown-content.tpl +34 -0
- package/templates/partials/tags_list.tpl +4 -4
- package/templates/partials/topic/browsing-users.tpl +0 -2
- package/templates/partials/topic/event.tpl +1 -1
- package/templates/partials/topic/navigation-post.tpl +5 -9
- package/templates/partials/topic/navigator-mobile.tpl +62 -0
- package/templates/partials/topic/navigator.tpl +23 -17
- package/templates/partials/topic/post-editor.tpl +0 -2
- package/templates/partials/topic/post-menu-list.tpl +60 -62
- package/templates/partials/topic/post-menu.tpl +16 -11
- package/templates/partials/topic/post.tpl +45 -27
- package/templates/partials/topic/quickreply.tpl +8 -8
- package/templates/partials/topic/reply-button.tpl +7 -7
- package/templates/partials/topic/sort.tpl +17 -5
- package/templates/partials/topic/tools.tpl +2 -2
- package/templates/partials/topic/topic-menu-list.tpl +22 -24
- package/templates/partials/topic/watch.tpl +42 -9
- package/templates/partials/topic-filters.tpl +6 -3
- package/templates/partials/topic-list-bar.tpl +50 -46
- package/templates/partials/topic-terms.tpl +6 -3
- package/templates/partials/topics_list.tpl +88 -93
- package/templates/partials/userFilter-placeholders.tpl +5 -0
- package/templates/partials/users/filter-dropdown-content.tpl +23 -0
- package/templates/partials/users/item.tpl +25 -27
- package/templates/partials/users_list.tpl +1 -1
- package/templates/popular.tpl +3 -1
- package/templates/post-queue.tpl +166 -0
- package/templates/recent.tpl +3 -2
- package/templates/register.tpl +4 -4
- package/templates/search.tpl +39 -177
- package/templates/tags.tpl +3 -3
- package/templates/top.tpl +3 -1
- package/templates/topic.tpl +74 -68
- package/templates/unread.tpl +3 -1
- package/templates/users.tpl +7 -3
- package/templates/modules/usercard.tpl +0 -39
- package/templates/partials/acceptTos.tpl +0 -11
- package/templates/partials/category-filter-content.tpl +0 -30
- package/templates/partials/category-filter-right.tpl +0 -5
- package/templates/partials/category-filter.tpl +0 -3
- package/templates/partials/category-selector-right.tpl +0 -5
- package/templates/partials/category-selector.tpl +0 -3
- package/templates/partials/slideout-menu.tpl +0 -6
package/README.md
CHANGED
|
@@ -5,4 +5,15 @@ The Harmony theme is the default theme for NodeBB for versions spanning v3.0.0 o
|
|
|
5
5
|
|
|
6
6
|
## Issues
|
|
7
7
|
|
|
8
|
-
Issues are tracked in [the main project issue tracker](https://github.com/NodeBB/NodeBB/issues?q=is%3Aopen+is%3Aissue+label%3Athemes).
|
|
8
|
+
Issues are tracked in [the main project issue tracker](https://github.com/NodeBB/NodeBB/issues?q=is%3Aopen+is%3Aissue+label%3Athemes).
|
|
9
|
+
|
|
10
|
+
## Screenshots
|
|
11
|
+
|
|
12
|
+
### Categories
|
|
13
|
+
<img height="450" src="screenshots/categories.png">
|
|
14
|
+
|
|
15
|
+
### Recent
|
|
16
|
+
<img height="450" src="screenshots/recent.png">
|
|
17
|
+
|
|
18
|
+
### Topic
|
|
19
|
+
<img height="450" src="screenshots/topic.png">
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"skins": "Skins",
|
|
3
3
|
"collapse": "Collapse",
|
|
4
|
+
"expand": "Expand",
|
|
4
5
|
"login-register-to-search": "Login or register to search.",
|
|
5
6
|
"settings.title": "Theme settings",
|
|
6
7
|
"settings.enableQuickReply": "Enable quick reply",
|
|
7
8
|
"settings.centerHeaderElements": "Center header elements",
|
|
8
|
-
"settings.
|
|
9
|
+
"settings.mobileTopicTeasers": "Show topic teasers on mobile",
|
|
10
|
+
"settings.stickyToolbar": "Sticky toolbar",
|
|
11
|
+
"settings.stickyToolbar.help": "The toolbar on topic and category pages will stick to the top of the page",
|
|
12
|
+
"settings.autohideBottombar": "Auto hide bottom bar",
|
|
13
|
+
"settings.autohideBottombar.help": "The bottom bar on mobile view will be hidden when the page is scrolled down"
|
|
9
14
|
}
|
package/library.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const nconf = require.main.require('nconf');
|
|
3
4
|
const meta = require.main.require('./src/meta');
|
|
4
5
|
const _ = require.main.require('lodash');
|
|
5
6
|
const user = require.main.require('./src/user');
|
|
@@ -11,7 +12,9 @@ const library = module.exports;
|
|
|
11
12
|
const defaults = {
|
|
12
13
|
enableQuickReply: 'on',
|
|
13
14
|
centerHeaderElements: 'off',
|
|
15
|
+
mobileTopicTeasers: 'off',
|
|
14
16
|
stickyToolbar: 'on',
|
|
17
|
+
autohideBottombar: 'off',
|
|
15
18
|
openSidebars: 'off',
|
|
16
19
|
};
|
|
17
20
|
|
|
@@ -27,8 +30,26 @@ library.init = async function (params) {
|
|
|
27
30
|
middleware.canViewUsers,
|
|
28
31
|
middleware.checkAccountPermissions,
|
|
29
32
|
], controllers.renderThemeSettings);
|
|
33
|
+
|
|
34
|
+
if (nconf.get('isPrimary') && process.env.NODE_ENV === 'production') {
|
|
35
|
+
setTimeout(buildSkins, 0);
|
|
36
|
+
}
|
|
30
37
|
};
|
|
31
38
|
|
|
39
|
+
async function buildSkins() {
|
|
40
|
+
try {
|
|
41
|
+
const plugins = require.main.require('./src/plugins');
|
|
42
|
+
await plugins.prepareForBuild(['client side styles']);
|
|
43
|
+
for (const skin of meta.css.supportedSkins) {
|
|
44
|
+
// eslint-disable-next-line no-await-in-loop
|
|
45
|
+
await meta.css.buildBundle(`client-${skin}`, true);
|
|
46
|
+
}
|
|
47
|
+
require.main.require('./src/meta/minifier').killAll();
|
|
48
|
+
} catch (err) {
|
|
49
|
+
console.error(err.stack);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
32
53
|
library.addAdminNavigation = async function (header) {
|
|
33
54
|
header.plugins.push({
|
|
34
55
|
route: '/plugins/harmony',
|
|
@@ -77,11 +98,36 @@ library.defineWidgetAreas = async function (areas) {
|
|
|
77
98
|
});
|
|
78
99
|
|
|
79
100
|
areas = areas.concat([
|
|
101
|
+
{
|
|
102
|
+
name: 'Main post header',
|
|
103
|
+
template: 'topic.tpl',
|
|
104
|
+
location: 'mainpost-header',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'Main post footer',
|
|
108
|
+
template: 'topic.tpl',
|
|
109
|
+
location: 'mainpost-footer',
|
|
110
|
+
},
|
|
80
111
|
{
|
|
81
112
|
name: 'Sidebar Footer',
|
|
82
113
|
template: 'global',
|
|
83
114
|
location: 'sidebar-footer',
|
|
84
115
|
},
|
|
116
|
+
{
|
|
117
|
+
name: 'Brand Header',
|
|
118
|
+
template: 'global',
|
|
119
|
+
location: 'brand-header',
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
name: 'About me (before)',
|
|
123
|
+
template: 'account/profile.tpl',
|
|
124
|
+
location: 'profile-aboutme-before',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: 'About me (after)',
|
|
128
|
+
template: 'account/profile.tpl',
|
|
129
|
+
location: 'profile-aboutme-after',
|
|
130
|
+
},
|
|
85
131
|
]);
|
|
86
132
|
|
|
87
133
|
return areas;
|
|
@@ -92,15 +138,19 @@ async function loadThemeConfig(uid) {
|
|
|
92
138
|
meta.settings.get('harmony'),
|
|
93
139
|
user.getSettings(uid),
|
|
94
140
|
]);
|
|
95
|
-
|
|
141
|
+
|
|
142
|
+
const config = { ...defaults, ...themeConfig, ...(_.pick(userConfig, Object.keys(defaults))) };
|
|
143
|
+
config.enableQuickReply = config.enableQuickReply === 'on';
|
|
144
|
+
config.centerHeaderElements = config.centerHeaderElements === 'on';
|
|
145
|
+
config.mobileTopicTeasers = config.mobileTopicTeasers === 'on';
|
|
146
|
+
config.stickyToolbar = config.stickyToolbar === 'on';
|
|
147
|
+
config.autohideBottombar = config.autohideBottombar === 'on';
|
|
148
|
+
config.openSidebars = config.openSidebars === 'on';
|
|
149
|
+
return config;
|
|
96
150
|
}
|
|
97
151
|
|
|
98
152
|
library.getThemeConfig = async function (config) {
|
|
99
|
-
|
|
100
|
-
config.enableQuickReply = themeConfig.enableQuickReply === 'on';
|
|
101
|
-
config.centerHeaderElements = themeConfig.centerHeaderElements === 'on';
|
|
102
|
-
config.stickyToolbar = themeConfig.stickyToolbar === 'on';
|
|
103
|
-
config.openSidebars = themeConfig.openSidebars === 'on';
|
|
153
|
+
config.theme = await loadThemeConfig(config.uid);
|
|
104
154
|
config.openDraftsOnPageLoad = false;
|
|
105
155
|
return config;
|
|
106
156
|
};
|
|
@@ -124,25 +174,6 @@ library.saveUserSettings = async function (hookData) {
|
|
|
124
174
|
return hookData;
|
|
125
175
|
};
|
|
126
176
|
|
|
127
|
-
library.addUserToTopic = async function (hookData) {
|
|
128
|
-
const { enableQuickReply } = await loadThemeConfig(hookData.req.uid);
|
|
129
|
-
if (enableQuickReply === 'on') {
|
|
130
|
-
if (hookData.req.user) {
|
|
131
|
-
const userData = await user.getUserData(hookData.req.uid);
|
|
132
|
-
hookData.templateData.loggedInUser = userData;
|
|
133
|
-
} else {
|
|
134
|
-
hookData.templateData.loggedInUser = {
|
|
135
|
-
uid: 0,
|
|
136
|
-
username: '[[global:guest]]',
|
|
137
|
-
picture: user.getDefaultAvatar(),
|
|
138
|
-
'icon:text': '?',
|
|
139
|
-
'icon:bgColor': '#aaa',
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return hookData;
|
|
144
|
-
};
|
|
145
|
-
|
|
146
177
|
library.filterMiddlewareRenderHeader = async function (hookData) {
|
|
147
178
|
const userSettings = await user.getSettings(hookData.req.uid);
|
|
148
179
|
|
package/package.json
CHANGED
package/plugin.json
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
{ "hook": "filter:settings.get", "method": "getAdminSettings"},
|
|
9
9
|
{ "hook": "filter:user.saveSettings", "method": "saveUserSettings" },
|
|
10
10
|
{ "hook": "filter:user.profileMenu", "method": "addProfileItem" },
|
|
11
|
-
{ "hook": "filter:topic.build", "method": "addUserToTopic" },
|
|
12
11
|
{ "hook": "filter:middleware.renderHeader", "method": "filterMiddlewareRenderHeader" },
|
|
13
12
|
{ "hook": "filter:middleware.render", "method": "removeFinalBreadcrumb" }
|
|
14
13
|
],
|
package/public/harmony.js
CHANGED
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
$(document).ready(function () {
|
|
4
|
+
setupSkinSwitcher();
|
|
4
5
|
setupNProgress();
|
|
5
6
|
setupMobileMenu();
|
|
6
7
|
setupSearch();
|
|
7
8
|
setupDrafts();
|
|
9
|
+
handleMobileNavigator();
|
|
10
|
+
setupNavTooltips();
|
|
11
|
+
fixPlaceholders();
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
function setupSkinSwitcher() {
|
|
14
|
+
$('[component="skinSwitcher"]').on('click', '.dropdown-item', function () {
|
|
15
|
+
const skin = $(this).attr('data-value');
|
|
16
|
+
$('[component="skinSwitcher"] .dropdown-item .fa-check').addClass('invisible');
|
|
17
|
+
$(this).find('.fa-check').removeClass('invisible');
|
|
18
|
+
require(['forum/account/settings', 'hooks'], function (accountSettings, hooks) {
|
|
19
|
+
hooks.one('action:skin.change', function () {
|
|
20
|
+
$('[component="skinSwitcher"] [component="skinSwitcher/icon"]').removeClass('fa-fade');
|
|
21
|
+
});
|
|
22
|
+
$('[component="skinSwitcher"] [component="skinSwitcher/icon"]').addClass('fa-fade');
|
|
23
|
+
accountSettings.changeSkin(skin);
|
|
24
|
+
});
|
|
16
25
|
});
|
|
17
|
-
}
|
|
26
|
+
}
|
|
18
27
|
|
|
19
28
|
require(['hooks'], function (hooks) {
|
|
20
|
-
hooks.on('action:skin.change', function () {
|
|
21
|
-
$('[component="skinSwitcher"] [component="skinSwitcher/icon"]').removeClass('fa-fade');
|
|
22
|
-
});
|
|
23
|
-
|
|
24
29
|
$(window).on('action:composer.resize action:sidebar.toggle', function () {
|
|
25
30
|
$('[component="composer"]').css({
|
|
26
31
|
left: $('.sidebar-left').outerWidth(true),
|
|
@@ -36,7 +41,7 @@ $(document).ready(function () {
|
|
|
36
41
|
});
|
|
37
42
|
|
|
38
43
|
function setupMobileMenu() {
|
|
39
|
-
require(['api'], function (api) {
|
|
44
|
+
require(['hooks', 'api', 'navigator'], function (hooks, api, navigator) {
|
|
40
45
|
$('[component="sidebar/toggle"]').on('click', async function () {
|
|
41
46
|
const sidebarEl = $('.sidebar');
|
|
42
47
|
sidebarEl.toggleClass('open');
|
|
@@ -48,6 +53,73 @@ $(document).ready(function () {
|
|
|
48
53
|
});
|
|
49
54
|
}
|
|
50
55
|
$(window).trigger('action:sidebar.toggle');
|
|
56
|
+
if (ajaxify.data.template.topic) {
|
|
57
|
+
hooks.fire('action:navigator.update', { newIndex: navigator.getIndex() });
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const bottomBar = $('[component="bottombar"]');
|
|
62
|
+
const $body = $('body');
|
|
63
|
+
const $window = $(window);
|
|
64
|
+
$body.on('shown.bs.dropdown', '.sticky-tools', function () {
|
|
65
|
+
bottomBar.addClass('hidden');
|
|
66
|
+
});
|
|
67
|
+
$body.on('hidden.bs.dropdown', '.sticky-tools', function () {
|
|
68
|
+
bottomBar.removeClass('hidden');
|
|
69
|
+
});
|
|
70
|
+
function isSearchVisible() {
|
|
71
|
+
return !!$('[component="bottombar"] [component="sidebar/search"] .search-dropdown.show').length;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let lastScrollTop = 0;
|
|
75
|
+
let newPostsLoaded = false;
|
|
76
|
+
|
|
77
|
+
function onWindowScroll() {
|
|
78
|
+
const st = $window.scrollTop();
|
|
79
|
+
if (newPostsLoaded) {
|
|
80
|
+
newPostsLoaded = false;
|
|
81
|
+
lastScrollTop = st;
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (st !== lastScrollTop && !navigator.scrollActive && !isSearchVisible()) {
|
|
85
|
+
const diff = Math.abs(st - lastScrollTop);
|
|
86
|
+
const scrolledDown = st > lastScrollTop;
|
|
87
|
+
const scrolledUp = st < lastScrollTop;
|
|
88
|
+
if (diff > 5) {
|
|
89
|
+
bottomBar.css({
|
|
90
|
+
bottom: !scrolledUp && scrolledDown ?
|
|
91
|
+
-bottomBar.find('.bottombar-nav').outerHeight(true) :
|
|
92
|
+
0,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
lastScrollTop = st;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const delayedScroll = utils.throttle(onWindowScroll, 250);
|
|
100
|
+
function enableAutohide() {
|
|
101
|
+
$window.off('scroll', delayedScroll);
|
|
102
|
+
if (config.theme.autohideBottombar) {
|
|
103
|
+
lastScrollTop = $window.scrollTop();
|
|
104
|
+
$window.on('scroll', delayedScroll);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
hooks.on('action:posts.loading', function () {
|
|
109
|
+
$window.off('scroll', delayedScroll);
|
|
110
|
+
});
|
|
111
|
+
hooks.on('action:posts.loaded', function () {
|
|
112
|
+
newPostsLoaded = true;
|
|
113
|
+
setTimeout(enableAutohide, 250);
|
|
114
|
+
});
|
|
115
|
+
hooks.on('action:ajaxify.end', function () {
|
|
116
|
+
$window.off('scroll', delayedScroll);
|
|
117
|
+
$body.removeClass('chat-loaded');
|
|
118
|
+
bottomBar.css({ bottom: 0 });
|
|
119
|
+
setTimeout(enableAutohide, 250);
|
|
120
|
+
});
|
|
121
|
+
hooks.on('action:chat.loaded', function () {
|
|
122
|
+
$body.toggleClass('chat-loaded', !!(ajaxify.data.template.chats && ajaxify.data.roomId));
|
|
51
123
|
});
|
|
52
124
|
});
|
|
53
125
|
}
|
|
@@ -56,56 +128,44 @@ $(document).ready(function () {
|
|
|
56
128
|
$('[component="sidebar/search"]').on('shown.bs.dropdown', function () {
|
|
57
129
|
$(this).find('[component="search/fields"] input[name="query"]').trigger('focus');
|
|
58
130
|
});
|
|
59
|
-
|
|
60
|
-
function resizeResults(hookData) {
|
|
61
|
-
if (hookData && hookData.data && !hookData.data.posts.length) {
|
|
62
|
-
$('.bottombar .quick-search-results').css({ height: 'initial' });
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const dropdown = $('.bottombar .search-dropdown');
|
|
66
|
-
const padY = dropdown.innerHeight() - dropdown.height();
|
|
67
|
-
const input = dropdown.find('.input-container').outerHeight(true);
|
|
68
|
-
const showMore = dropdown.find('.show-more-container').outerHeight(true);
|
|
69
|
-
const newHeight = Math.max(
|
|
70
|
-
150,
|
|
71
|
-
$(window).height() - (input + (showMore || 0) + (padY * 2) + 30)
|
|
72
|
-
);
|
|
73
|
-
$('.bottombar .quick-search-results').height(newHeight);
|
|
74
|
-
}
|
|
75
|
-
require(['hooks'], function (hooks) {
|
|
76
|
-
$(window).on('resize', resizeResults);
|
|
77
|
-
hooks.on('action:search.quick.complete', resizeResults);
|
|
78
|
-
});
|
|
79
131
|
}
|
|
80
132
|
|
|
81
133
|
function setupDrafts() {
|
|
82
|
-
require(['composer/drafts'], function (drafts) {
|
|
134
|
+
require(['composer/drafts', 'bootbox'], function (drafts, bootbox) {
|
|
135
|
+
const draftsEl = $('[component="sidebar/drafts"]');
|
|
136
|
+
|
|
83
137
|
function updateBadgeCount() {
|
|
84
138
|
const count = drafts.getAvailableCount();
|
|
139
|
+
if (count > 0) {
|
|
140
|
+
draftsEl.removeClass('hidden');
|
|
141
|
+
}
|
|
85
142
|
$('[component="drafts/count"]').toggleClass('hidden', count <= 0).text(count);
|
|
86
143
|
}
|
|
87
144
|
|
|
88
145
|
async function renderDraftList() {
|
|
89
146
|
const draftListEl = $('[component="drafts/list"]');
|
|
90
|
-
draftListEl.children(':not(.no-drafts)').remove();
|
|
91
|
-
|
|
92
147
|
const draftItems = drafts.listAvailable();
|
|
93
148
|
if (!draftItems.length) {
|
|
94
149
|
draftListEl.find('.no-drafts').removeClass('hidden');
|
|
150
|
+
draftListEl.find('.placeholder-wave').addClass('hidden');
|
|
151
|
+
draftListEl.find('.draft-item-container').html('');
|
|
95
152
|
return;
|
|
96
153
|
}
|
|
97
154
|
draftItems.reverse().forEach((draft) => {
|
|
98
155
|
if (draft) {
|
|
99
|
-
draft.text =
|
|
156
|
+
draft.text = utils.escapeHTML(
|
|
157
|
+
draft.text
|
|
158
|
+
).replace(/(?:\r\n|\r|\n)/g, '<br>');
|
|
100
159
|
}
|
|
101
160
|
});
|
|
102
161
|
|
|
103
162
|
const html = await app.parseAndTranslate('partials/sidebar/drafts', 'drafts', { drafts: draftItems });
|
|
104
163
|
draftListEl.find('.no-drafts').addClass('hidden');
|
|
105
|
-
draftListEl.
|
|
164
|
+
draftListEl.find('.placeholder-wave').addClass('hidden');
|
|
165
|
+
draftListEl.find('.draft-item-container').html(html).find('.timeago').timeago();
|
|
106
166
|
}
|
|
107
167
|
|
|
108
|
-
|
|
168
|
+
|
|
109
169
|
draftsEl.on('shown.bs.dropdown', renderDraftList);
|
|
110
170
|
|
|
111
171
|
draftsEl.on('click', '[component="drafts/open"]', function () {
|
|
@@ -113,8 +173,13 @@ $(document).ready(function () {
|
|
|
113
173
|
});
|
|
114
174
|
|
|
115
175
|
draftsEl.on('click', '[component="drafts/delete"]', function () {
|
|
116
|
-
|
|
117
|
-
|
|
176
|
+
const save_id = $(this).attr('data-save-id');
|
|
177
|
+
bootbox.confirm('[[modules:composer.discard-draft-confirm]]', function (ok) {
|
|
178
|
+
if (ok) {
|
|
179
|
+
drafts.removeDraft(save_id);
|
|
180
|
+
renderDraftList();
|
|
181
|
+
}
|
|
182
|
+
});
|
|
118
183
|
return false;
|
|
119
184
|
});
|
|
120
185
|
|
|
@@ -123,6 +188,7 @@ $(document).ready(function () {
|
|
|
123
188
|
updateBadgeCount();
|
|
124
189
|
});
|
|
125
190
|
}
|
|
191
|
+
|
|
126
192
|
function setupNProgress() {
|
|
127
193
|
require(['nprogress'], function (NProgress) {
|
|
128
194
|
window.nprogress = NProgress;
|
|
@@ -137,4 +203,62 @@ $(document).ready(function () {
|
|
|
137
203
|
}
|
|
138
204
|
});
|
|
139
205
|
}
|
|
206
|
+
|
|
207
|
+
function handleMobileNavigator() {
|
|
208
|
+
const paginationBlockEl = $('.pagination-block');
|
|
209
|
+
require(['hooks'], function (hooks) {
|
|
210
|
+
hooks.on('action:ajaxify.end', function () {
|
|
211
|
+
paginationBlockEl.find('.dropdown-menu.show').removeClass('show');
|
|
212
|
+
});
|
|
213
|
+
hooks.on('filter:navigator.scroll', function (hookData) {
|
|
214
|
+
paginationBlockEl.find('.dropdown-menu.show').removeClass('show');
|
|
215
|
+
return hookData;
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function setupNavTooltips() {
|
|
221
|
+
// remove title from user icon in sidebar to prevent double tooltip
|
|
222
|
+
$('.sidebar [component="header/avatar"] .avatar').removeAttr('title');
|
|
223
|
+
const tooltipEls = $('.sidebar [title]');
|
|
224
|
+
tooltipEls.tooltip({
|
|
225
|
+
trigger: 'manual',
|
|
226
|
+
animation: false,
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
tooltipEls.on('mouseenter', function (ev) {
|
|
230
|
+
const target = $(ev.target);
|
|
231
|
+
const isDropdown = target.hasClass('dropdown-menu') || !!target.parents('.dropdown-menu').length;
|
|
232
|
+
if (!$('.sidebar').hasClass('open') && !isDropdown) {
|
|
233
|
+
$(this).tooltip('show');
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
tooltipEls.on('click mouseleave', function () {
|
|
237
|
+
$(this).tooltip('hide');
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
function fixPlaceholders() {
|
|
242
|
+
if (!config.loggedIn) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
['notifications', 'chat'].forEach((type) => {
|
|
246
|
+
const countEl = document.querySelector(`[component="${type}/count"]`);
|
|
247
|
+
if (!countEl) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
const count = parseInt(countEl.innerText, 10);
|
|
251
|
+
if (count > 1) {
|
|
252
|
+
const listEls = document.querySelectorAll(`[component="${type}/list"]`);
|
|
253
|
+
listEls.forEach((listEl) => {
|
|
254
|
+
const placeholder = listEl.querySelector('li');
|
|
255
|
+
|
|
256
|
+
for (let x = 0; x < count - 1; x++) {
|
|
257
|
+
const cloneEl = placeholder.cloneNode(true);
|
|
258
|
+
listEl.insertBefore(cloneEl, placeholder);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}
|
|
140
264
|
});
|
package/public/settings.js
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/scss/account.scss
CHANGED
package/scss/chats.scss
CHANGED
|
@@ -3,52 +3,107 @@
|
|
|
3
3
|
.page-user-chats #content {
|
|
4
4
|
max-width: 100%;
|
|
5
5
|
}
|
|
6
|
+
|
|
7
|
+
.stacked-avatars {
|
|
8
|
+
width: 32px;
|
|
9
|
+
height: 32px;
|
|
10
|
+
span:first-child {
|
|
11
|
+
top: 0;
|
|
12
|
+
left: 8px;
|
|
13
|
+
}
|
|
14
|
+
span:last-child {
|
|
15
|
+
left: 0;
|
|
16
|
+
top: 8px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
6
20
|
body.page-user-chats {
|
|
7
21
|
overflow: hidden;
|
|
22
|
+
[data-widget-area="footer"] {
|
|
23
|
+
display: none;
|
|
24
|
+
}
|
|
25
|
+
height: 100%;
|
|
26
|
+
> .layout-container {
|
|
27
|
+
height: 100%;
|
|
28
|
+
> #panel {
|
|
29
|
+
height: 100%;
|
|
30
|
+
> .container {
|
|
31
|
+
height: 100%;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
8
35
|
}
|
|
9
36
|
|
|
10
|
-
|
|
37
|
+
[component="chat/recent"] {
|
|
38
|
+
.active .chat-room-btn {
|
|
39
|
+
background-color: $btn-ghost-hover-color;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[component="chat/nav-wrapper"] {
|
|
44
|
+
width: 300px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.expanded-chat {
|
|
11
48
|
// no taskbar so hide minimize button
|
|
12
49
|
[data-action="minimize"] {
|
|
13
50
|
display: none!important;
|
|
14
51
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
52
|
+
|
|
53
|
+
.chat-content {
|
|
54
|
+
@include fix-lists;
|
|
55
|
+
|
|
56
|
+
.chat-message {
|
|
57
|
+
.message-body-wrapper .controls {
|
|
58
|
+
[data-action="restore"] {
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
19
61
|
}
|
|
20
62
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
63
|
+
.chat-message.deleted {
|
|
64
|
+
.message-body-wrapper .controls {
|
|
65
|
+
[data-action] {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
27
68
|
|
|
28
|
-
|
|
29
|
-
|
|
69
|
+
[data-action="restore"] {
|
|
70
|
+
display: inline;
|
|
71
|
+
}
|
|
30
72
|
}
|
|
31
|
-
}
|
|
32
73
|
|
|
33
|
-
|
|
34
|
-
|
|
74
|
+
.message-body {
|
|
75
|
+
opacity: 0.3;
|
|
76
|
+
}
|
|
35
77
|
}
|
|
36
78
|
}
|
|
37
79
|
}
|
|
38
80
|
|
|
39
81
|
/* Mobile handling of chat page */
|
|
82
|
+
@include media-breakpoint-down(lg) {
|
|
83
|
+
.page-user-chats.chat-loaded {
|
|
84
|
+
padding-bottom: 4.75rem;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
40
88
|
@include media-breakpoint-down(md) {
|
|
41
|
-
.page-user-chats
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
89
|
+
.page-user-chats.chat-loaded {
|
|
90
|
+
padding-bottom: initial;
|
|
91
|
+
}
|
|
92
|
+
[component="chat/nav-wrapper"] {
|
|
93
|
+
width: 100%;
|
|
94
|
+
}
|
|
45
95
|
|
|
46
|
-
[component="chat/nav-wrapper"][data-loaded="1"] {
|
|
47
|
-
display: none!important;
|
|
48
|
-
}
|
|
49
96
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
97
|
+
.page-user-chats.chat-loaded .bottombar {
|
|
98
|
+
display: none!important;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
[component="chat/nav-wrapper"][data-loaded="1"] {
|
|
102
|
+
display: none!important;
|
|
53
103
|
}
|
|
104
|
+
|
|
105
|
+
[component="chat/nav-wrapper"][data-loaded="0"] + [component="chat/main-wrapper"] {
|
|
106
|
+
display: none!important;
|
|
107
|
+
}
|
|
108
|
+
|
|
54
109
|
}
|