nodebb-theme-harmony 1.0.45 → 1.0.47
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
|
@@ -179,18 +179,23 @@ library.saveUserSettings = async function (hookData) {
|
|
|
179
179
|
library.filterMiddlewareRenderHeader = async function (hookData) {
|
|
180
180
|
const userSettings = await user.getSettings(hookData.req.uid);
|
|
181
181
|
|
|
182
|
+
const defaultSkin = _.capitalize(meta.config.bootswatchSkin) || '[[user:no-skin]]';
|
|
183
|
+
const defaultSkins = [
|
|
184
|
+
{ name: `[[user:default, ${defaultSkin}]]`, value: '', selected: userSettings.bootswatchSkin === '' },
|
|
185
|
+
{ name: '[[user:no-skin]]', value: 'noskin', selected: userSettings.bootswatchSkin === 'noskin' },
|
|
186
|
+
];
|
|
182
187
|
const lightSkins = [
|
|
183
|
-
'
|
|
184
|
-
'lumen', 'lux', 'materia', 'minty', 'morph', 'pulse', '
|
|
188
|
+
'cerulean', 'cosmo', 'flatly', 'journal', 'litera',
|
|
189
|
+
'lumen', 'lux', 'materia', 'minty', 'morph', 'pulse', 'sandstone',
|
|
185
190
|
'simplex', 'sketchy', 'spacelab', 'united', 'yeti', 'zephyr',
|
|
186
191
|
];
|
|
187
192
|
const darkSkins = [
|
|
188
|
-
'cyborg', 'darkly', 'slate', 'solar', 'superhero', 'vapor',
|
|
193
|
+
'cyborg', 'darkly', 'quartz', 'slate', 'solar', 'superhero', 'vapor',
|
|
189
194
|
];
|
|
190
195
|
function parseSkins(skins) {
|
|
191
196
|
skins = skins.map(skin => ({
|
|
192
197
|
name: _.capitalize(skin),
|
|
193
|
-
value: skin
|
|
198
|
+
value: skin,
|
|
194
199
|
}));
|
|
195
200
|
skins.forEach((skin) => {
|
|
196
201
|
skin.selected = skin.value === userSettings.bootswatchSkin;
|
|
@@ -199,6 +204,7 @@ library.filterMiddlewareRenderHeader = async function (hookData) {
|
|
|
199
204
|
}
|
|
200
205
|
|
|
201
206
|
hookData.templateData.bootswatchSkinOptions = {
|
|
207
|
+
default: defaultSkins,
|
|
202
208
|
light: parseSkins(lightSkins),
|
|
203
209
|
dark: parseSkins(darkSkins),
|
|
204
210
|
};
|
package/package.json
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
</span>
|
|
11
11
|
</a>
|
|
12
12
|
|
|
13
|
-
<ul class="dropdown-menu p-1 text-sm overflow-auto">
|
|
14
|
-
<div class="d-flex
|
|
13
|
+
<ul class="dropdown-menu p-1 text-sm overflow-auto p-1">
|
|
14
|
+
<div class="d-flex">
|
|
15
15
|
<div>
|
|
16
16
|
<li class="dropdown-header">Light</li>
|
|
17
17
|
<div class="d-grid" style="grid-template-columns: 1fr 1fr;">
|
|
@@ -31,5 +31,15 @@
|
|
|
31
31
|
{{{ end }}}
|
|
32
32
|
</div>
|
|
33
33
|
</div>
|
|
34
|
+
|
|
35
|
+
<hr class="my-1"/>
|
|
36
|
+
|
|
37
|
+
<div class="d-grid" style="grid-template-columns: 1fr 1fr;">
|
|
38
|
+
{{{ each bootswatchSkinOptions.default }}}
|
|
39
|
+
<li>
|
|
40
|
+
<a href="#" class="dropdown-item rounded-1" data-value="{./value}">{./name} <i class="fa fa-fw fa-check {{{ if !./selected }}} invisible {{{ end }}}"></i></a>
|
|
41
|
+
</li>
|
|
42
|
+
{{{ end }}}
|
|
43
|
+
</div>
|
|
34
44
|
</ul>
|
|
35
45
|
</div>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<a id="{./index}" data-index="{./index}" component="topic/anchor" class="position-absolute"></a>
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
<div class="d-flex p-0 col-lg-7 gap-2 gap-lg-3 align-items-start">
|
|
12
|
+
<div class="d-flex p-0 col-lg-7 gap-2 gap-lg-3 pe-1 align-items-start">
|
|
13
13
|
<div class="flex-shrink-0 position-relative">
|
|
14
14
|
<a class="text-decoration-none" href="{{{ if ./user.userslug }}}{config.relative_path}/user/{./user.userslug}{{{ else }}}#{{{ end }}}">
|
|
15
15
|
{buildAvatar(./user, "40px", true, "avatar avatar-tooltip")}
|