nodebb-theme-peace
Advanced tools
Comparing version 2.0.31 to 2.0.32
@@ -66,35 +66,4 @@ 'use strict'; | ||
library.filterMiddlewareRenderHeader = async function (hookData) { | ||
const userSettings = await user.getSettings(hookData.req.uid); | ||
const defaultSkin = _.capitalize(meta.config.bootswatchSkin) || '[[user:no-skin]]'; | ||
const defaultSkins = [ | ||
{ name: `[[user:default, ${defaultSkin}]]`, value: '', selected: userSettings.bootswatchSkin === '' }, | ||
{ name: '[[user:no-skin]]', value: 'noskin', selected: userSettings.bootswatchSkin === 'noskin' }, | ||
]; | ||
const lightSkins = [ | ||
'cerulean', 'cosmo', 'flatly', 'journal', 'litera', | ||
'lumen', 'lux', 'materia', 'minty', 'morph', 'pulse', 'sandstone', | ||
'simplex', 'sketchy', 'spacelab', 'united', 'yeti', 'zephyr', | ||
]; | ||
const darkSkins = [ | ||
'cyborg', 'darkly', 'quartz', 'slate', 'solar', 'superhero', 'vapor', | ||
]; | ||
function parseSkins(skins) { | ||
skins = skins.map(skin => ({ | ||
name: _.capitalize(skin), | ||
value: skin, | ||
})); | ||
skins.forEach((skin) => { | ||
skin.selected = skin.value === userSettings.bootswatchSkin; | ||
}); | ||
return skins; | ||
} | ||
hookData.templateData.bootswatchSkinOptions = { | ||
default: defaultSkins, | ||
light: parseSkins(lightSkins), | ||
dark: parseSkins(darkSkins), | ||
}; | ||
hookData.templateData.currentBSSkin = _.capitalize(hookData.templateData.bootswatchSkin); | ||
hookData.templateData.bootswatchSkinOptions = await meta.css.getSkinSwitcherOptions(hookData.req.uid); | ||
return hookData; | ||
}; |
{ | ||
"name": "nodebb-theme-peace", | ||
"version": "2.0.31", | ||
"version": "2.0.32", | ||
"nbbpm": { | ||
@@ -5,0 +5,0 @@ "compatibility": "^3.0.0" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7440400
150