This commit is contained in:
Julian Lam
2014-09-29 17:51:18 -04:00
parent b877a4e7b4
commit 632fb3a618
3 changed files with 21 additions and 22 deletions

View File

@@ -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;