mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
special theme.set socket call + static dir support, closes #427, tweaked languages 404 to work with subdirs
This commit is contained in:
@@ -21,24 +21,21 @@ define(function() {
|
||||
var parentEl = $(e.target).parents('li'),
|
||||
themeType = parentEl.attr('data-type'),
|
||||
cssSrc = parentEl.attr('data-css'),
|
||||
cssName = parentEl.attr('data-theme');
|
||||
themeId = parentEl.attr('data-theme');
|
||||
|
||||
socket.emit('api:config.set', {
|
||||
key: 'theme:type',
|
||||
value: themeType
|
||||
});
|
||||
|
||||
socket.emit('api:config.set', {
|
||||
key: 'theme:id',
|
||||
value: cssName
|
||||
});
|
||||
|
||||
if (themeType === 'bootswatch') {
|
||||
socket.emit('api:config.set', {
|
||||
key: 'theme:src',
|
||||
value: cssSrc
|
||||
socket.emit('api:admin.theme.set', {
|
||||
type: themeType,
|
||||
id: themeId,
|
||||
src: cssSrc
|
||||
}, function(err) {
|
||||
app.alert({
|
||||
alert_id: 'admin:theme',
|
||||
type: 'success',
|
||||
title: 'Theme Changed',
|
||||
message: 'You have successfully changed your NodeBB\'s theme. Please restart to see the changes.',
|
||||
timeout: 2500
|
||||
});
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user