diff --git a/install/package.json b/install/package.json index d700ce2647..65b80201a4 100644 --- a/install/package.json +++ b/install/package.json @@ -74,10 +74,10 @@ "nodebb-plugin-soundpack-default": "1.0.0", "nodebb-plugin-spam-be-gone": "0.5.4", "nodebb-rewards-essentials": "0.0.11", - "nodebb-theme-lavender": "5.0.5", - "nodebb-theme-persona": "9.0.22", + "nodebb-theme-lavender": "5.0.6", + "nodebb-theme-persona": "9.0.23", "nodebb-theme-slick": "1.2.6", - "nodebb-theme-vanilla": "10.0.20", + "nodebb-theme-vanilla": "10.0.21", "nodebb-widget-essentials": "4.0.7", "nodemailer": "^4.6.5", "passport": "^0.4.0", diff --git a/src/middleware/header.js b/src/middleware/header.js index f845d8b4bb..f6ee601b06 100644 --- a/src/middleware/header.js +++ b/src/middleware/header.js @@ -69,6 +69,7 @@ module.exports = function (middleware) { async.waterfall([ function (next) { async.parallel({ + scripts: async.apply(plugins.fireHook, 'filter:scripts.get', []), isAdmin: function (next) { user.isAdministrator(req.uid, next); }, @@ -194,6 +195,8 @@ module.exports = function (middleware) { templateValues.userJSON = jsesc(JSON.stringify(results.user), { isScriptContext: true }); templateValues.useCustomCSS = parseInt(meta.config.useCustomCSS, 10) === 1 && meta.config.customCSS; templateValues.customCSS = templateValues.useCustomCSS ? (meta.config.renderedCustomCSS || '') : ''; + templateValues.useCustomJS = parseInt(meta.config.useCustomJS, 10) === 1; + templateValues.customJS = templateValues.useCustomJS ? meta.config.customJS : ''; templateValues.useCustomHTML = parseInt(meta.config.useCustomHTML, 10) === 1; templateValues.customHTML = templateValues.useCustomHTML ? meta.config.customHTML : ''; templateValues.maintenanceHeader = parseInt(meta.config.maintenanceMode, 10) === 1 && !results.isAdmin; @@ -203,6 +206,11 @@ module.exports = function (middleware) { templateValues.privateUserInfo = parseInt(meta.config.privateUserInfo, 10) === 1; templateValues.privateTagListing = parseInt(meta.config.privateTagListing, 10) === 1; + templateValues.scripts = results.scripts.map(function (script) { + return { src: script }; + }); + addTimeagoLocaleScript(templateValues.scripts, res.locals.config.userLang); + templateValues.template = { name: res.locals.template }; templateValues.template[res.locals.template] = true; @@ -237,20 +245,6 @@ module.exports = function (middleware) { }, next); }, function (data, next) { - async.parallel({ - scripts: async.apply(plugins.fireHook, 'filter:scripts.get', []), - }, function (err, results) { - next(err, data, results); - }); - }, - function (data, results, next) { - data.templateValues.scripts = results.scripts.map(function (script) { - return { src: script }; - }); - addTimeagoLocaleScript(data.templateValues.scripts, res.locals.config.userLang); - - data.templateValues.useCustomJS = parseInt(meta.config.useCustomJS, 10) === 1; - data.templateValues.customJS = data.templateValues.useCustomJS ? meta.config.customJS : ''; data.templateValues.isSpider = req.isSpider(); req.app.render('footer', data.templateValues, next); },