mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
Fix space-before-function-paren linter rule
This commit is contained in:
@@ -14,33 +14,33 @@ var controllers = {
|
||||
helpers: require('../controllers/helpers')
|
||||
};
|
||||
|
||||
module.exports = function(middleware) {
|
||||
module.exports = function (middleware) {
|
||||
|
||||
middleware.buildHeader = function(req, res, next) {
|
||||
middleware.buildHeader = function (req, res, next) {
|
||||
res.locals.renderHeader = true;
|
||||
res.locals.isAPI = false;
|
||||
async.waterfall([
|
||||
function(next) {
|
||||
function (next) {
|
||||
middleware.applyCSRF(req, res, next);
|
||||
},
|
||||
function(next) {
|
||||
function (next) {
|
||||
async.parallel({
|
||||
config: function(next) {
|
||||
config: function (next) {
|
||||
controllers.api.getConfig(req, res, next);
|
||||
},
|
||||
plugins: function(next) {
|
||||
plugins: function (next) {
|
||||
plugins.fireHook('filter:middleware.buildHeader', {req: req, locals: res.locals}, next);
|
||||
}
|
||||
}, next);
|
||||
},
|
||||
function(results, next) {
|
||||
function (results, next) {
|
||||
res.locals.config = results.config;
|
||||
next();
|
||||
}
|
||||
], next);
|
||||
};
|
||||
|
||||
middleware.renderHeader = function(req, res, data, callback) {
|
||||
middleware.renderHeader = function (req, res, data, callback) {
|
||||
var registrationType = meta.config.registrationType || 'normal';
|
||||
var templateValues = {
|
||||
bootswatchCSS: meta.config['theme:src'],
|
||||
@@ -61,16 +61,16 @@ module.exports = function(middleware) {
|
||||
templateValues.configJSON = JSON.stringify(res.locals.config);
|
||||
|
||||
async.parallel({
|
||||
scripts: function(next) {
|
||||
scripts: function (next) {
|
||||
plugins.fireHook('filter:scripts.get', [], next);
|
||||
},
|
||||
isAdmin: function(next) {
|
||||
isAdmin: function (next) {
|
||||
user.isAdministrator(req.uid, next);
|
||||
},
|
||||
isGlobalMod: function(next) {
|
||||
isGlobalMod: function (next) {
|
||||
user.isGlobalModerator(req.uid, next);
|
||||
},
|
||||
user: function(next) {
|
||||
user: function (next) {
|
||||
var userData = {
|
||||
uid: 0,
|
||||
username: '[[global:guest]]',
|
||||
@@ -88,7 +88,7 @@ module.exports = function(middleware) {
|
||||
next(null, userData);
|
||||
}
|
||||
},
|
||||
isEmailConfirmSent: function(next) {
|
||||
isEmailConfirmSent: function (next) {
|
||||
if (!meta.config.requireEmailConfirmation || !req.uid) {
|
||||
return next(null, false);
|
||||
}
|
||||
@@ -96,7 +96,7 @@ module.exports = function(middleware) {
|
||||
},
|
||||
navigation: async.apply(navigation.get),
|
||||
tags: async.apply(meta.tags.parse, res.locals.metaTags, res.locals.linkTags)
|
||||
}, function(err, results) {
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -137,7 +137,7 @@ module.exports = function(middleware) {
|
||||
templateValues.template = {name: res.locals.template};
|
||||
templateValues.template[res.locals.template] = true;
|
||||
|
||||
templateValues.scripts = results.scripts.map(function(script) {
|
||||
templateValues.scripts = results.scripts.map(function (script) {
|
||||
return {src: script};
|
||||
});
|
||||
|
||||
@@ -145,7 +145,7 @@ module.exports = function(middleware) {
|
||||
modifyTitle(templateValues);
|
||||
}
|
||||
|
||||
plugins.fireHook('filter:middleware.renderHeader', {templateValues: templateValues, req: req, res: res}, function(err, data) {
|
||||
plugins.fireHook('filter:middleware.renderHeader', {templateValues: templateValues, req: req, res: res}, function (err, data) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -155,8 +155,8 @@ module.exports = function(middleware) {
|
||||
});
|
||||
};
|
||||
|
||||
middleware.renderFooter = function(req, res, data, callback) {
|
||||
plugins.fireHook('filter:middleware.renderFooter', {templateValues: data, req: req, res: res}, function(err, data) {
|
||||
middleware.renderFooter = function (req, res, data, callback) {
|
||||
plugins.fireHook('filter:middleware.renderFooter', {templateValues: data, req: req, res: res}, function (err, data) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
@@ -169,7 +169,7 @@ module.exports = function(middleware) {
|
||||
obj.browserTitle = title;
|
||||
|
||||
if (obj.metaTags) {
|
||||
obj.metaTags.forEach(function(tag, i) {
|
||||
obj.metaTags.forEach(function (tag, i) {
|
||||
if (tag.property === 'og:title') {
|
||||
obj.metaTags[i].content = title;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user