|
|
@ -21,34 +21,30 @@ define(['forum/admin/settings'], function(Settings) {
|
|
|
|
var target = $(e.target),
|
|
|
|
var target = $(e.target),
|
|
|
|
action = target.attr('data-action');
|
|
|
|
action = target.attr('data-action');
|
|
|
|
|
|
|
|
|
|
|
|
if (action) {
|
|
|
|
if (action && action === 'use') {
|
|
|
|
switch (action) {
|
|
|
|
var parentEl = target.parents('li'),
|
|
|
|
case 'use':
|
|
|
|
themeType = parentEl.attr('data-type'),
|
|
|
|
var parentEl = target.parents('li'),
|
|
|
|
cssSrc = parentEl.attr('data-css'),
|
|
|
|
themeType = parentEl.attr('data-type'),
|
|
|
|
themeId = parentEl.attr('data-theme');
|
|
|
|
cssSrc = parentEl.attr('data-css'),
|
|
|
|
|
|
|
|
themeId = parentEl.attr('data-theme');
|
|
|
|
socket.emit('admin.themes.set', {
|
|
|
|
|
|
|
|
type: themeType,
|
|
|
|
socket.emit('admin.themes.set', {
|
|
|
|
id: themeId,
|
|
|
|
type: themeType,
|
|
|
|
src: cssSrc
|
|
|
|
id: themeId,
|
|
|
|
}, function(err) {
|
|
|
|
src: cssSrc
|
|
|
|
if (err) {
|
|
|
|
}, function(err) {
|
|
|
|
return app.alertError(err.message);
|
|
|
|
if (err) {
|
|
|
|
}
|
|
|
|
return app.alertError(err.message);
|
|
|
|
highlightSelectedTheme(themeId);
|
|
|
|
}
|
|
|
|
|
|
|
|
highlightSelectedTheme(themeId);
|
|
|
|
app.alert({
|
|
|
|
|
|
|
|
alert_id: 'admin:theme',
|
|
|
|
app.alert({
|
|
|
|
type: 'success',
|
|
|
|
alert_id: 'admin:theme',
|
|
|
|
title: 'Theme Changed',
|
|
|
|
type: 'success',
|
|
|
|
message: 'Restarting your NodeBB <i class="fa fa-refresh fa-spin"></i>',
|
|
|
|
title: 'Theme Changed',
|
|
|
|
timeout: 3500
|
|
|
|
message: 'Restarting your NodeBB <i class="fa fa-refresh fa-spin"></i>',
|
|
|
|
});
|
|
|
|
timeout: 3500
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|