mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 18:46:01 +01:00
closed #2184
This commit is contained in:
@@ -29,27 +29,6 @@ var utils = require('./../../public/src/utils'),
|
||||
|
||||
var middleware = {};
|
||||
|
||||
function routeThemeScreenshots(app, themes) {
|
||||
var screenshotPath;
|
||||
|
||||
async.each(themes, function(themeObj, next) {
|
||||
if (themeObj.screenshot) {
|
||||
screenshotPath = path.join(themesPath, themeObj.id, themeObj.screenshot);
|
||||
(function(id, path) {
|
||||
fs.exists(path, function(exists) {
|
||||
if (exists) {
|
||||
app.get(relativePath + '/css/previews/' + id, function(req, res) {
|
||||
res.sendfile(path);
|
||||
});
|
||||
}
|
||||
});
|
||||
})(themeObj.id, screenshotPath);
|
||||
} else {
|
||||
next(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function routeCurrentTheme(app, themeId, themesData) {
|
||||
var themeId = (themeId || 'nodebb-theme-vanilla'),
|
||||
themeObj = (function(id) {
|
||||
@@ -132,7 +111,6 @@ module.exports = function(app, data) {
|
||||
auth.initialize(app, middleware);
|
||||
|
||||
routeCurrentTheme(app, data.currentThemeId, data.themesData);
|
||||
routeThemeScreenshots(app, data.themesData);
|
||||
meta.templates.compile();
|
||||
|
||||
return middleware;
|
||||
|
||||
Reference in New Issue
Block a user