mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
closes #5499
This commit is contained in:
@@ -49,9 +49,12 @@ define('forum/account/settings', ['forum/account/header', 'components', 'sounds'
|
||||
|
||||
function changePageSkin(skinName) {
|
||||
var css = $('#bootswatchCSS');
|
||||
if (skinName === 'default') {
|
||||
if (skinName === 'noskin' || (skinName === 'default' && config.defaultBootswatchSkin === 'noskin')) {
|
||||
css.remove();
|
||||
} else {
|
||||
if (skinName === 'default') {
|
||||
skinName = config.defaultBootswatchSkin;
|
||||
}
|
||||
var cssSource = '//maxcdn.bootstrapcdn.com/bootswatch/latest/' + skinName + '/bootstrap.min.css';
|
||||
if (css.length) {
|
||||
css.attr('href', cssSource);
|
||||
|
||||
@@ -108,6 +108,7 @@ settingsController.get = function (req, res, callback) {
|
||||
|
||||
|
||||
userData.bootswatchSkinOptions = [
|
||||
{ name: 'No skin', value: 'noskin' },
|
||||
{ name: 'Default', value: 'default' },
|
||||
{ name: 'Cerulean', value: 'cerulean' },
|
||||
{ name: 'Cosmo', value: 'cosmo' },
|
||||
|
||||
@@ -61,7 +61,8 @@ apiController.getConfig = function (req, res, next) {
|
||||
config.categoryTopicSort = meta.config.categoryTopicSort || 'newest_to_oldest';
|
||||
config.csrf_token = req.csrfToken();
|
||||
config.searchEnabled = plugins.hasListeners('filter:search.query');
|
||||
config.bootswatchSkin = meta.config.bootswatchSkin || 'default';
|
||||
config.bootswatchSkin = meta.config.bootswatchSkin || 'noskin';
|
||||
config.defaultBootswatchSkin = meta.config.bootswatchSkin || 'noskin';
|
||||
|
||||
var timeagoCutoff = meta.config.timeagoCutoff === undefined ? 30 : meta.config.timeagoCutoff;
|
||||
config.timeagoCutoff = timeagoCutoff !== '' ? Math.max(0, parseInt(timeagoCutoff, 10)) : timeagoCutoff;
|
||||
@@ -90,7 +91,7 @@ apiController.getConfig = function (req, res, next) {
|
||||
config.categoryTopicSort = settings.categoryTopicSort || config.categoryTopicSort;
|
||||
config.topicSearchEnabled = settings.topicSearchEnabled || false;
|
||||
config.delayImageLoading = settings.delayImageLoading !== undefined ? settings.delayImageLoading : true;
|
||||
config.bootswatchSkin = settings.bootswatchSkin || config.bootswatchSkin;
|
||||
config.bootswatchSkin = (settings.bootswatchSkin && settings.bootswatchSkin !== 'default') ? settings.bootswatchSkin : config.bootswatchSkin;
|
||||
plugins.fireHook('filter:config.get', config, next);
|
||||
},
|
||||
], function (err, config) {
|
||||
|
||||
@@ -190,12 +190,12 @@ module.exports = function (middleware) {
|
||||
}
|
||||
|
||||
function setBootswatchCSS(obj, config) {
|
||||
if (config && config.bootswatchSkin !== 'default') {
|
||||
if (config && config.bootswatchSkin !== 'noskin') {
|
||||
var skinToUse = '';
|
||||
|
||||
if (parseInt(meta.config.disableCustomUserSkins, 10) !== 1) {
|
||||
skinToUse = config.bootswatchSkin;
|
||||
} else if (meta.config.bootswatchSkin !== 'default') {
|
||||
} else if (meta.config.bootswatchSkin) {
|
||||
skinToUse = meta.config.bootswatchSkin;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user