nodebb-theme-harmony 1.0.0-beta.1 → 1.0.0-beta.100

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 (154) hide show
  1. package/README.md +12 -1
  2. package/languages/en-GB/harmony.json +5 -1
  3. package/library.js +25 -25
  4. package/package.json +1 -1
  5. package/plugin.json +0 -1
  6. package/public/harmony.js +163 -29
  7. package/public/settings.js +1 -0
  8. package/screenshots/categories.png +0 -0
  9. package/screenshots/recent.png +0 -0
  10. package/screenshots/topic.png +0 -0
  11. package/scss/account.scss +1 -1
  12. package/scss/chats.scss +59 -26
  13. package/scss/common.scss +84 -10
  14. package/scss/flags.scss +5 -0
  15. package/scss/groups.scss +2 -2
  16. package/scss/harmony.scss +4 -0
  17. package/scss/mixins.scss +7 -3
  18. package/scss/modals.scss +6 -1
  19. package/scss/modules/bottom-sheet.scss +2 -2
  20. package/scss/modules/composer.scss +0 -4
  21. package/scss/modules/cover.scss +1 -11
  22. package/scss/modules/filters.scss +8 -0
  23. package/scss/modules/nprogress.scss +80 -0
  24. package/scss/modules/paginator.scss +24 -0
  25. package/scss/modules/topic-navigator.scss +16 -42
  26. package/scss/modules/topics-list.scss +32 -17
  27. package/scss/modules/user-menu.scss +6 -0
  28. package/scss/overrides.scss +4 -1
  29. package/scss/sidebar.scss +61 -8
  30. package/scss/topic.scss +30 -13
  31. package/templates/account/blocks.tpl +35 -40
  32. package/templates/account/categories.tpl +47 -29
  33. package/templates/account/consent.tpl +66 -10
  34. package/templates/account/edit/password.tpl +25 -30
  35. package/templates/account/edit/username.tpl +21 -26
  36. package/templates/account/edit.tpl +105 -116
  37. package/templates/account/followers.tpl +12 -19
  38. package/templates/account/following.tpl +12 -18
  39. package/templates/account/groups.tpl +12 -17
  40. package/templates/account/info.tpl +178 -206
  41. package/templates/account/posts.tpl +31 -36
  42. package/templates/account/profile.tpl +66 -73
  43. package/templates/account/sessions.tpl +8 -30
  44. package/templates/account/settings.tpl +222 -203
  45. package/templates/account/theme.tpl +35 -26
  46. package/templates/account/topics.tpl +36 -38
  47. package/templates/account/uploads.tpl +33 -40
  48. package/templates/admin/plugins/harmony.tpl +17 -3
  49. package/templates/categories.tpl +3 -6
  50. package/templates/category.tpl +13 -14
  51. package/templates/chats.tpl +9 -10
  52. package/templates/flags/detail.tpl +160 -193
  53. package/templates/flags/list.tpl +4 -70
  54. package/templates/footer.tpl +2 -2
  55. package/templates/groups/details.tpl +22 -19
  56. package/templates/groups/list.tpl +1 -1
  57. package/templates/groups/members.tpl +0 -2
  58. package/templates/header.tpl +2 -2
  59. package/templates/login.tpl +4 -4
  60. package/templates/notifications.tpl +5 -5
  61. package/templates/partials/account/admin-menu.tpl +9 -9
  62. package/templates/partials/account/category-item.tpl +14 -17
  63. package/templates/partials/account/footer.tpl +3 -0
  64. package/templates/partials/account/header.tpl +78 -81
  65. package/templates/partials/account/session-list.tpl +18 -0
  66. package/templates/partials/account/sidebar-left.tpl +31 -25
  67. package/templates/partials/breadcrumbs.tpl +6 -6
  68. package/templates/partials/buttons/newTopic.tpl +1 -1
  69. package/templates/partials/categories/item.tpl +32 -28
  70. package/templates/partials/categories/lastpost.tpl +7 -7
  71. package/templates/partials/category/filter-dropdown-content.tpl +37 -0
  72. package/templates/partials/{category-selector-content.tpl → category/selector-dropdown-content.tpl} +7 -7
  73. package/templates/partials/category/sort.tpl +22 -7
  74. package/templates/partials/category/subcategory.tpl +2 -3
  75. package/templates/partials/category/tags.tpl +0 -2
  76. package/templates/partials/category/tools.tpl +28 -25
  77. package/templates/partials/category/watch.tpl +39 -6
  78. package/templates/partials/chats/dropdown.tpl +4 -1
  79. package/templates/partials/chats/message-window.tpl +10 -8
  80. package/templates/partials/chats/message.tpl +5 -7
  81. package/templates/partials/chats/options.tpl +14 -6
  82. package/templates/partials/chats/recent_room.tpl +41 -32
  83. package/templates/partials/cookie-consent.tpl +5 -5
  84. package/templates/partials/flags/bulk-actions.tpl +9 -0
  85. package/templates/partials/flags/filters.tpl +163 -78
  86. package/templates/partials/flags/results.tpl +38 -0
  87. package/templates/partials/groups/admin.tpl +4 -4
  88. package/templates/partials/groups/badge.tpl +1 -1
  89. package/templates/partials/groups/list.tpl +2 -2
  90. package/templates/partials/groups/memberlist.tpl +1 -1
  91. package/templates/partials/groups/sidebar-left.tpl +10 -10
  92. package/templates/partials/header/brand.tpl +9 -2
  93. package/templates/partials/mobile-footer.tpl +69 -61
  94. package/templates/partials/notifications_list.tpl +11 -8
  95. package/templates/partials/paginator.tpl +11 -9
  96. package/templates/partials/post_bar.tpl +26 -24
  97. package/templates/partials/posts_list_item.tpl +5 -5
  98. package/templates/partials/quick-search-results.tpl +3 -3
  99. package/templates/partials/search-filters.tpl +184 -0
  100. package/templates/partials/search-results.tpl +28 -35
  101. package/templates/partials/sidebar/chats.tpl +28 -36
  102. package/templates/partials/sidebar/drafts.tpl +45 -34
  103. package/templates/partials/sidebar/logged-in-menu.tpl +5 -5
  104. package/templates/partials/sidebar/logged-out-menu.tpl +1 -1
  105. package/templates/partials/sidebar/notifications.tpl +33 -12
  106. package/templates/partials/sidebar/search-mobile.tpl +1 -1
  107. package/templates/partials/sidebar/search.tpl +1 -1
  108. package/templates/partials/sidebar/user-menu.tpl +38 -29
  109. package/templates/partials/sidebar-left.tpl +14 -11
  110. package/templates/partials/sidebar-right.tpl +1 -3
  111. package/templates/partials/skin-switcher.tpl +3 -3
  112. package/templates/partials/tags/filter-dropdown-content.tpl +34 -0
  113. package/templates/partials/tags_list.tpl +4 -4
  114. package/templates/partials/topic/browsing-users.tpl +0 -2
  115. package/templates/partials/topic/event.tpl +1 -1
  116. package/templates/partials/topic/navigation-post.tpl +5 -9
  117. package/templates/partials/topic/navigator-mobile.tpl +62 -0
  118. package/templates/partials/topic/navigator.tpl +21 -17
  119. package/templates/partials/topic/post-editor.tpl +0 -2
  120. package/templates/partials/topic/post-menu-list.tpl +60 -62
  121. package/templates/partials/topic/post-menu.tpl +16 -11
  122. package/templates/partials/topic/post.tpl +43 -25
  123. package/templates/partials/topic/quickreply.tpl +7 -7
  124. package/templates/partials/topic/reply-button.tpl +3 -3
  125. package/templates/partials/topic/sort.tpl +17 -5
  126. package/templates/partials/topic/tools.tpl +2 -2
  127. package/templates/partials/topic/topic-menu-list.tpl +22 -24
  128. package/templates/partials/topic/watch.tpl +42 -9
  129. package/templates/partials/topic-filters.tpl +6 -3
  130. package/templates/partials/topic-list-bar.tpl +50 -46
  131. package/templates/partials/topic-terms.tpl +6 -3
  132. package/templates/partials/topics_list.tpl +85 -93
  133. package/templates/partials/userFilter-placeholders.tpl +5 -0
  134. package/templates/partials/users/filter-dropdown-content.tpl +23 -0
  135. package/templates/partials/users/item.tpl +25 -27
  136. package/templates/partials/users_list.tpl +1 -1
  137. package/templates/popular.tpl +3 -1
  138. package/templates/post-queue.tpl +166 -0
  139. package/templates/recent.tpl +3 -2
  140. package/templates/register.tpl +4 -4
  141. package/templates/search.tpl +39 -177
  142. package/templates/tags.tpl +3 -3
  143. package/templates/top.tpl +3 -1
  144. package/templates/topic.tpl +74 -68
  145. package/templates/unread.tpl +3 -1
  146. package/templates/users.tpl +7 -3
  147. package/templates/modules/usercard.tpl +0 -39
  148. package/templates/partials/acceptTos.tpl +0 -11
  149. package/templates/partials/category-filter-content.tpl +0 -30
  150. package/templates/partials/category-filter-right.tpl +0 -5
  151. package/templates/partials/category-filter.tpl +0 -3
  152. package/templates/partials/category-selector-right.tpl +0 -5
  153. package/templates/partials/category-selector.tpl +0 -3
  154. 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,13 @@
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.stickyToolbar": "Sticky toolbar"
9
+ "settings.stickyToolbar": "Sticky toolbar",
10
+ "settings.stickyToolbar.help": "The toolbar on topic and category pages will stick to the top of the page",
11
+ "settings.autohideBottombar": "Auto hide bottom bar",
12
+ "settings.autohideBottombar.help": "The bottom bar on mobile view will be hidden when the page is scrolled down"
9
13
  }
package/library.js CHANGED
@@ -12,6 +12,7 @@ const defaults = {
12
12
  enableQuickReply: 'on',
13
13
  centerHeaderElements: 'off',
14
14
  stickyToolbar: 'on',
15
+ autohideBottombar: 'off',
15
16
  openSidebars: 'off',
16
17
  };
17
18
 
@@ -77,11 +78,26 @@ library.defineWidgetAreas = async function (areas) {
77
78
  });
78
79
 
79
80
  areas = areas.concat([
81
+ {
82
+ name: 'Main post header',
83
+ template: 'topic.tpl',
84
+ location: 'mainpost-header',
85
+ },
86
+ {
87
+ name: 'Main post footer',
88
+ template: 'topic.tpl',
89
+ location: 'mainpost-footer',
90
+ },
80
91
  {
81
92
  name: 'Sidebar Footer',
82
93
  template: 'global',
83
94
  location: 'sidebar-footer',
84
95
  },
96
+ {
97
+ name: 'Brand Header',
98
+ template: 'global',
99
+ location: 'brand-header',
100
+ },
85
101
  ]);
86
102
 
87
103
  return areas;
@@ -92,15 +108,18 @@ async function loadThemeConfig(uid) {
92
108
  meta.settings.get('harmony'),
93
109
  user.getSettings(uid),
94
110
  ]);
95
- return { ...defaults, ...themeConfig, ...userConfig };
111
+
112
+ const config = { ...defaults, ...themeConfig, ...(_.pick(userConfig, Object.keys(defaults))) };
113
+ config.enableQuickReply = config.enableQuickReply === 'on';
114
+ config.centerHeaderElements = config.centerHeaderElements === 'on';
115
+ config.stickyToolbar = config.stickyToolbar === 'on';
116
+ config.autohideBottombar = config.autohideBottombar === 'on';
117
+ config.openSidebars = config.openSidebars === 'on';
118
+ return config;
96
119
  }
97
120
 
98
121
  library.getThemeConfig = async function (config) {
99
- const themeConfig = await loadThemeConfig(config.uid);
100
- config.enableQuickReply = themeConfig.enableQuickReply === 'on';
101
- config.centerHeaderElements = themeConfig.centerHeaderElements === 'on';
102
- config.stickyToolbar = themeConfig.stickyToolbar === 'on';
103
- config.openSidebars = themeConfig.openSidebars === 'on';
122
+ config.theme = await loadThemeConfig(config.uid);;
104
123
  config.openDraftsOnPageLoad = false;
105
124
  return config;
106
125
  };
@@ -124,25 +143,6 @@ library.saveUserSettings = async function (hookData) {
124
143
  return hookData;
125
144
  };
126
145
 
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
146
  library.filterMiddlewareRenderHeader = async function (hookData) {
147
147
  const userSettings = await user.getSettings(hookData.req.uid);
148
148
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-theme-harmony",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.100",
4
4
  "nbbpm": {
5
5
  "compatibility": "^3.0.0"
6
6
  },
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,9 +1,13 @@
1
1
  'use strict';
2
2
 
3
3
  $(document).ready(function () {
4
+ setupNProgress();
4
5
  setupMobileMenu();
5
6
  setupSearch();
6
7
  setupDrafts();
8
+ handleMobileNavigator();
9
+ setupNavTooltips();
10
+ fixPlaceholders();
7
11
 
8
12
  $('[component="skinSwitcher"]').on('click', '.dropdown-item', function () {
9
13
  const skin = $(this).attr('data-value');
@@ -35,7 +39,7 @@ $(document).ready(function () {
35
39
  });
36
40
 
37
41
  function setupMobileMenu() {
38
- require(['api'], function (api) {
42
+ require(['hooks', 'api', 'navigator'], function (hooks, api, navigator) {
39
43
  $('[component="sidebar/toggle"]').on('click', async function () {
40
44
  const sidebarEl = $('.sidebar');
41
45
  sidebarEl.toggleClass('open');
@@ -47,6 +51,70 @@ $(document).ready(function () {
47
51
  });
48
52
  }
49
53
  $(window).trigger('action:sidebar.toggle');
54
+ if (ajaxify.data.template.topic) {
55
+ hooks.fire('action:navigator.update', { newIndex: navigator.getIndex() });
56
+ }
57
+ });
58
+
59
+ const bottomBar = $('[component="bottombar"]');
60
+ const $body = $('body');
61
+ const $window = $(window);
62
+ $body.on('shown.bs.dropdown', '.sticky-tools', function () {
63
+ bottomBar.addClass('hidden');
64
+ });
65
+ $body.on('hidden.bs.dropdown', '.sticky-tools', function () {
66
+ bottomBar.removeClass('hidden');
67
+ });
68
+
69
+ let lastScrollTop = 0;
70
+ let newPostsLoaded = false;
71
+
72
+ function onWindowScroll() {
73
+ const st = $window.scrollTop();
74
+ if (newPostsLoaded) {
75
+ newPostsLoaded = false;
76
+ lastScrollTop = st;
77
+ return;
78
+ }
79
+ if (st !== lastScrollTop && !navigator.scrollActive) {
80
+ const diff = Math.abs(st - lastScrollTop);
81
+ const scrolledDown = st > lastScrollTop;
82
+ const scrolledUp = st < lastScrollTop;
83
+ if (diff > 5) {
84
+ bottomBar.css({
85
+ bottom: !scrolledUp && scrolledDown ?
86
+ -bottomBar.find('.bottombar-nav').outerHeight(true) :
87
+ 0,
88
+ });
89
+ }
90
+ }
91
+ lastScrollTop = st;
92
+ }
93
+
94
+ const delayedScroll = utils.throttle(onWindowScroll, 250);
95
+ function enableAutohide() {
96
+ $window.off('scroll', delayedScroll);
97
+ if (config.theme.autohideBottombar) {
98
+ lastScrollTop = $window.scrollTop();
99
+ $window.on('scroll', delayedScroll);
100
+ }
101
+ }
102
+
103
+ hooks.on('action:posts.loading', function () {
104
+ $window.off('scroll', delayedScroll);
105
+ });
106
+ hooks.on('action:posts.loaded', function () {
107
+ newPostsLoaded = true;
108
+ setTimeout(enableAutohide, 250);
109
+ });
110
+ hooks.on('action:ajaxify.end', function () {
111
+ $window.off('scroll', delayedScroll);
112
+ $body.removeClass('chat-loaded');
113
+ bottomBar.css({ bottom: 0 });
114
+ setTimeout(enableAutohide, 250);
115
+ });
116
+ hooks.on('action:chat.loaded', function () {
117
+ $body.toggleClass('chat-loaded', !!(ajaxify.data.template.chats && ajaxify.data.roomId));
50
118
  });
51
119
  });
52
120
  }
@@ -55,56 +123,44 @@ $(document).ready(function () {
55
123
  $('[component="sidebar/search"]').on('shown.bs.dropdown', function () {
56
124
  $(this).find('[component="search/fields"] input[name="query"]').trigger('focus');
57
125
  });
58
-
59
- function resizeResults(hookData) {
60
- if (hookData && hookData.data && !hookData.data.posts.length) {
61
- $('.bottombar .quick-search-results').css({ height: 'initial' });
62
- return;
63
- }
64
- const dropdown = $('.bottombar .search-dropdown');
65
- const padY = dropdown.innerHeight() - dropdown.height();
66
- const input = dropdown.find('.input-container').outerHeight(true);
67
- const showMore = dropdown.find('.show-more-container').outerHeight(true);
68
- const newHeight = Math.max(
69
- 150,
70
- $(window).height() - (input + (showMore || 0) + (padY * 2) + 30)
71
- );
72
- $('.bottombar .quick-search-results').height(newHeight);
73
- }
74
- require(['hooks'], function (hooks) {
75
- $(window).on('resize', resizeResults);
76
- hooks.on('action:search.quick.complete', resizeResults);
77
- });
78
126
  }
79
127
 
80
128
  function setupDrafts() {
81
- require(['composer/drafts'], function (drafts) {
129
+ require(['composer/drafts', 'bootbox'], function (drafts, bootbox) {
130
+ const draftsEl = $('[component="sidebar/drafts"]');
131
+
82
132
  function updateBadgeCount() {
83
133
  const count = drafts.getAvailableCount();
134
+ if (count > 0) {
135
+ draftsEl.removeClass('hidden');
136
+ }
84
137
  $('[component="drafts/count"]').toggleClass('hidden', count <= 0).text(count);
85
138
  }
86
139
 
87
140
  async function renderDraftList() {
88
141
  const draftListEl = $('[component="drafts/list"]');
89
- draftListEl.children(':not(.no-drafts)').remove();
90
-
91
142
  const draftItems = drafts.listAvailable();
92
143
  if (!draftItems.length) {
93
144
  draftListEl.find('.no-drafts').removeClass('hidden');
145
+ draftListEl.find('.placeholder-wave').addClass('hidden');
146
+ draftListEl.find('.draft-item-container').html('');
94
147
  return;
95
148
  }
96
149
  draftItems.reverse().forEach((draft) => {
97
150
  if (draft) {
98
- draft.text = draft.text.replace(/(?:\r\n|\r|\n)/g, '<br>');
151
+ draft.text = utils.escapeHTML(
152
+ draft.text
153
+ ).replace(/(?:\r\n|\r|\n)/g, '<br>');
99
154
  }
100
155
  });
101
156
 
102
157
  const html = await app.parseAndTranslate('partials/sidebar/drafts', 'drafts', { drafts: draftItems });
103
158
  draftListEl.find('.no-drafts').addClass('hidden');
104
- draftListEl.append(html).find('.timeago').timeago();
159
+ draftListEl.find('.placeholder-wave').addClass('hidden');
160
+ draftListEl.find('.draft-item-container').html(html).find('.timeago').timeago();
105
161
  }
106
162
 
107
- const draftsEl = $('[component="sidebar/drafts"]');
163
+
108
164
  draftsEl.on('shown.bs.dropdown', renderDraftList);
109
165
 
110
166
  draftsEl.on('click', '[component="drafts/open"]', function () {
@@ -112,8 +168,13 @@ $(document).ready(function () {
112
168
  });
113
169
 
114
170
  draftsEl.on('click', '[component="drafts/delete"]', function () {
115
- drafts.removeDraft($(this).attr('data-save-id'));
116
- renderDraftList();
171
+ const save_id = $(this).attr('data-save-id');
172
+ bootbox.confirm('[[modules:composer.discard-draft-confirm]]', function (ok) {
173
+ if (ok) {
174
+ drafts.removeDraft(save_id);
175
+ renderDraftList();
176
+ }
177
+ });
117
178
  return false;
118
179
  });
119
180
 
@@ -122,4 +183,77 @@ $(document).ready(function () {
122
183
  updateBadgeCount();
123
184
  });
124
185
  }
186
+
187
+ function setupNProgress() {
188
+ require(['nprogress'], function (NProgress) {
189
+ window.nprogress = NProgress;
190
+ if (NProgress) {
191
+ $(window).on('action:ajaxify.start', function () {
192
+ NProgress.set(0.7);
193
+ });
194
+
195
+ $(window).on('action:ajaxify.end', function () {
196
+ NProgress.done(true);
197
+ });
198
+ }
199
+ });
200
+ }
201
+
202
+ function handleMobileNavigator() {
203
+ const paginationBlockEl = $('.pagination-block');
204
+ require(['hooks'], function (hooks) {
205
+ hooks.on('action:ajaxify.end', function () {
206
+ paginationBlockEl.find('.dropdown-menu.show').removeClass('show');
207
+ });
208
+ hooks.on('filter:navigator.scroll', function (hookData) {
209
+ paginationBlockEl.find('.dropdown-menu.show').removeClass('show');
210
+ return hookData;
211
+ });
212
+ });
213
+ }
214
+
215
+ function setupNavTooltips() {
216
+ // remove title from user icon in sidebar to prevent double tooltip
217
+ $('.sidebar [component="header/avatar"] .avatar').removeAttr('title');
218
+ const tooltipEls = $('.sidebar [title]');
219
+ tooltipEls.tooltip({
220
+ trigger: 'manual',
221
+ animation: false,
222
+ });
223
+
224
+ tooltipEls.on('mouseenter', function (ev) {
225
+ const target = $(ev.target);
226
+ const isDropdown = target.hasClass('dropdown-menu') || !!target.parents('.dropdown-menu').length;
227
+ if (!$('.sidebar').hasClass('open') && !isDropdown) {
228
+ $(this).tooltip('show');
229
+ }
230
+ });
231
+ tooltipEls.on('click mouseleave', function () {
232
+ $(this).tooltip('hide');
233
+ });
234
+ }
235
+
236
+ function fixPlaceholders() {
237
+ if (!config.loggedIn) {
238
+ return;
239
+ }
240
+ ['notifications', 'chat'].forEach((type) => {
241
+ const countEl = document.querySelector(`[component="${type}/count"]`);
242
+ if (!countEl) {
243
+ return;
244
+ }
245
+ const count = parseInt(countEl.innerText, 10);
246
+ if (count > 1) {
247
+ const listEls = document.querySelectorAll(`[component="${type}/list"]`);
248
+ listEls.forEach((listEl) => {
249
+ const placeholder = listEl.querySelector('li');
250
+
251
+ for (let x = 0; x < count - 1; x++) {
252
+ const cloneEl = placeholder.cloneNode(true);
253
+ listEl.insertBefore(cloneEl, placeholder);
254
+ }
255
+ });
256
+ }
257
+ });
258
+ }
125
259
  });
@@ -19,6 +19,7 @@ define('forum/account/theme', ['forum/account/header', 'api', 'settings', 'alert
19
19
  ...themeSettings,
20
20
  },
21
21
  });
22
+ config.theme = (await api.get('/api/config')).theme;
22
23
  alerts.success('[[success:settings-saved]]');
23
24
  });
24
25
  }
Binary file
Binary file
Binary file
package/scss/account.scss CHANGED
@@ -1,4 +1,4 @@
1
- .page-user #panel {
1
+ .page-user.page-status-200 #panel {
2
2
  margin-top: 0px!important;
3
3
  }
4
4
  .account {
package/scss/chats.scss CHANGED
@@ -3,52 +3,85 @@
3
3
  .page-user-chats #content {
4
4
  max-width: 100%;
5
5
  }
6
+
6
7
  body.page-user-chats {
7
8
  overflow: hidden;
9
+ [data-widget-area="footer"] {
10
+ display: none;
11
+ }
12
+ height: 100%;
13
+ > .layout-container {
14
+ height: 100%;
15
+ > #panel {
16
+ height: 100%;
17
+ > .container {
18
+ height: 100%;
19
+ }
20
+ }
21
+ }
22
+ }
23
+
24
+ [component="chat/recent"] {
25
+ .active .chat-room-btn {
26
+ background-color: $btn-ghost-hover-color;
27
+ }
28
+ }
29
+
30
+ [component="chat/nav-wrapper"] {
31
+ width: 300px;
8
32
  }
9
33
 
10
- .expanded-chat, .chat-modal {
34
+ .expanded-chat {
11
35
  // no taskbar so hide minimize button
12
36
  [data-action="minimize"] {
13
37
  display: none!important;
14
38
  }
15
- .chat-content .chat-message {
16
- .message-body-wrapper .controls {
17
- [data-action="restore"] {
18
- display: none;
39
+
40
+ .chat-content {
41
+ @include fix-lists;
42
+
43
+ .chat-message {
44
+ .message-body-wrapper .controls {
45
+ [data-action="restore"] {
46
+ display: none;
47
+ }
19
48
  }
20
49
  }
21
- }
22
- .chat-content .chat-message.deleted {
23
- .message-body-wrapper .controls {
24
- [data-action] {
25
- display: none;
26
- }
50
+ .chat-message.deleted {
51
+ .message-body-wrapper .controls {
52
+ [data-action] {
53
+ display: none;
54
+ }
27
55
 
28
- [data-action="restore"] {
29
- display: inline;
56
+ [data-action="restore"] {
57
+ display: inline;
58
+ }
30
59
  }
31
- }
32
60
 
33
- .message-body {
34
- opacity: 0.3;
61
+ .message-body {
62
+ opacity: 0.3;
63
+ }
35
64
  }
36
65
  }
37
66
  }
38
67
 
39
68
  /* Mobile handling of chat page */
40
69
  @include media-breakpoint-down(md) {
41
- .page-user-chats {
42
- .chats-full {
43
- padding-bottom: 8rem!important;
44
- }
70
+ [component="chat/nav-wrapper"] {
71
+ width: 100%;
72
+ }
45
73
 
46
- [component="chat/nav-wrapper"][data-loaded="1"] {
47
- display: none!important;
48
- }
49
74
 
50
- [component="chat/nav-wrapper"][data-loaded="0"] + [component="chat/main-wrapper"] {
51
- display: none!important;
52
- }
75
+ .page-user-chats.chat-loaded .bottombar {
76
+ display: none!important;
53
77
  }
78
+
79
+ [component="chat/nav-wrapper"][data-loaded="1"] {
80
+ display: none!important;
81
+ }
82
+
83
+ [component="chat/nav-wrapper"][data-loaded="0"] + [component="chat/main-wrapper"] {
84
+ display: none!important;
85
+ }
86
+
54
87
  }
package/scss/common.scss CHANGED
@@ -1,27 +1,88 @@
1
1
 
2
2
  body {
3
3
  overflow-y: scroll;
4
+ -webkit-font-smoothing: antialiased;
5
+ -moz-osx-font-smoothing: grayscale;
6
+ text-rendering: optimizeLegibility;
4
7
  }
8
+
9
+ // fixes chrome font boosting :/ https://stackoverflow.com/questions/13430897/how-to-override-font-boosting-in-mobile-chrome
10
+ body * {
11
+ max-height:1000000px;
12
+ text-size-adjust: none;
13
+ -webkit-text-size-adjust: none;
14
+ -moz-text-size-adjust: none;
15
+ }
16
+
17
+ hr {
18
+ border-top-color: $border-color;
19
+ opacity: 1;
20
+ }
21
+
5
22
  .ff-base {
6
- font-family: $font-family-base;
23
+ font-family: $font-family-base !important;
24
+ }
25
+ .ff-sans {
26
+ font-family: $font-family-sans-serif !important;
7
27
  }
8
28
  .ff-secondary {
9
29
  font-family: $font-family-secondary;
10
30
  }
11
- .tracking-tight { letter-spacing: -0.025em; }
31
+ .tracking-tight { letter-spacing: -0.02em; }
32
+
33
+ .caret {
34
+ &::after {
35
+ border: none;
36
+ font-family: "FontAwesome";
37
+ content: "\f078";
38
+ color: tint-color($primary, 40%);
39
+ }
40
+ }
41
+
42
+ .placeholder-wave {
43
+ opacity: 0.5;
44
+ }
45
+
46
+ .bg-card-cap {
47
+ --bs-bg-opacity: 1;
48
+ background-color: $card-cap-bg!important;
49
+ }
12
50
 
13
- .text-md { font-size: 1.125rem!important; } // 18px
14
- .text-sm { font-size: 0.875rem!important; } // 14px
15
- .text-xs { font-size: 0.75rem!important; } // 12px
51
+ blockquote {
52
+ background-color: $light;
53
+ font-style: normal;
54
+ border-left: 2px solid $border-color;
55
+ padding: 1rem;
56
+ p:last-child {
57
+ margin-bottom: 0;
58
+ }
59
+ }
16
60
 
17
- .btn-link:hover {
18
- text-decoration: none;
61
+ body:not(.page-user) {
62
+ #content {
63
+ transition: opacity 150ms linear;
64
+ &.ajaxifying {
65
+ -moz-opacity: 0;
66
+ opacity: 0;
67
+ }
68
+ }
69
+ }
70
+ .page-user {
71
+ #content {
72
+ transition: opacity 150ms linear;
73
+ &.ajaxifying .account-content {
74
+ transition: opacity 150ms linear;
75
+ -moz-opacity: 0;
76
+ opacity: 0;
77
+ }
78
+ }
19
79
  }
20
80
 
21
81
  .sticky-tools {
22
82
  position: sticky;
23
83
  z-index: 3;
24
- top: calc($spacer * 0.5);
84
+ top: 0;
85
+ padding: 0.25rem 0;
25
86
  background-color: $body-bg;
26
87
  }
27
88
  // quartz doesn't need body-bg for tool background
@@ -35,6 +96,13 @@ body {
35
96
  }
36
97
  }
37
98
 
99
+ .btn-link {
100
+ &:hover, &.active {
101
+ background-color: $btn-ghost-hover-color;
102
+ text-decoration: none;
103
+ }
104
+ }
105
+
38
106
  @mixin btn-ghost-base {
39
107
  display: flex;
40
108
  align-items: center;
@@ -48,10 +116,10 @@ body {
48
116
  text-align: left;
49
117
  --bs-text-opacity: 1;
50
118
  color: inherit !important;
51
- $hover-color: mix($light, $dark, 90);
119
+ font-family: $font-family-secondary;
52
120
  cursor: pointer;
53
121
  &:hover, &.active {
54
- background-color: $hover-color;
122
+ background-color: $btn-ghost-hover-color;
55
123
  text-decoration: none;
56
124
  }
57
125
  }
@@ -59,12 +127,18 @@ body {
59
127
  .btn-ghost {
60
128
  @include btn-ghost-base();
61
129
  line-height: 1.5rem;
130
+ > i {
131
+ line-height: 1.5rem;
132
+ }
62
133
  }
63
134
 
64
135
  .btn-ghost-sm {
65
136
  @include btn-ghost-base();
66
137
  font-size: 0.875rem;
67
138
  line-height: 1.25rem;
139
+ > i {
140
+ line-height: 1.25rem;
141
+ }
68
142
  }
69
143
 
70
144
  .btn-outline {
@@ -0,0 +1,5 @@
1
+ .page-flags {
2
+ [component="flag/history"] {
3
+ max-height: 30rem;
4
+ }
5
+ }
package/scss/groups.scss CHANGED
@@ -3,8 +3,8 @@
3
3
  }
4
4
 
5
5
  .group-hover-bg {
6
- $hover-color: mix($light, $dark, 97);
7
- $border-color: mix($light, $dark, 90);
6
+ $hover-color: mix($light, $dark, 97%);
7
+ $border-color: mix($light, $dark, 90%);
8
8
  .card-body {
9
9
  border-color: $border-color!important;
10
10
  }