From 61b79de3e850c3fbcee28ae7e3f31da5337f6dd1 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 4 Jun 2014 19:35:05 -0400 Subject: [PATCH] closes #1641 --- src/middleware/middleware.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/middleware/middleware.js b/src/middleware/middleware.js index 2fa0ccd7a0..85d8acd44b 100644 --- a/src/middleware/middleware.js +++ b/src/middleware/middleware.js @@ -283,6 +283,10 @@ middleware.renderHeader = function(req, res, callback) { next(err, tree ? tree.toCSS({cleancss: true}) : ''); }); }, + customJS: function(next) { + templateValues.useCustomJS = parseInt(meta.config.useCustomJS, 10) === 1; + next(null, templateValues.useCustomJS ? meta.config.customJS : ''); + }, title: function(next) { if (uid) { user.getSettings(uid, function(err, settings) { @@ -314,6 +318,7 @@ middleware.renderHeader = function(req, res, callback) { templateValues.isAdmin = results.isAdmin || false; templateValues.user = results.user; templateValues.customCSS = results.customCSS; + templateValues.customJS = results.customJS; app.render('header', templateValues, callback); });