Inject isOverleaf setting globally

This commit is contained in:
Alasdair Smith 2018-08-13 12:13:44 +01:00
parent d7a341f59b
commit 085c2529d9
2 changed files with 5 additions and 0 deletions

View file

@ -333,3 +333,7 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)->
defaultLineHeight : if isOl then 'normal' else 'compact'
renderAnnouncements : !isOl
next()
webRouter.use (req, res, next) ->
res.locals.exposedSettings =
isOverleaf: Settings.overleaf?

View file

@ -70,6 +70,7 @@ html(itemscope, itemtype='http://schema.org/Product')
window.systemMessages = !{JSON.stringify(systemMessages).replace(/\//g, '\\/')};
window.ab = {};
window.user_id = '#{getLoggedInUserId()}';
window.exposedSettings = JSON.parse('!{JSON.stringify(exposedSettings).replace(/\//g, "\\/")}');
- if (typeof(settings.algolia) != "undefined")
script.