mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-30 20:31:34 +02:00
Create uiConfig Pug local; render it in the HTML.
This commit is contained in:
@@ -290,3 +290,12 @@ module.exports = (app, webRouter, privateApiRouter, publicApiRouter)->
|
||||
res.locals.moduleIncludes = Modules.moduleIncludes
|
||||
res.locals.moduleIncludesAvailable = Modules.moduleIncludesAvailable
|
||||
next()
|
||||
|
||||
webRouter.use (req, res, next) ->
|
||||
isOl = (Settings.brandPrefix == 'ol-')
|
||||
res.locals.uiConfig =
|
||||
defaultResizerSizeOpen : if isOl then 2 else 24
|
||||
defaultResizerSizeClosed : if isOl then 2 else 24
|
||||
chatResizerSizeOpen : if isOl then 2 else 6
|
||||
chatResizerSizeClosed : 0
|
||||
next()
|
||||
|
||||
@@ -157,6 +157,7 @@ block requirejs
|
||||
window.aceFingerprint = "#{fingerprint(jsPath + lib('ace') + '/ace.js')}"
|
||||
window.aceWorkerPath = "#{aceWorkerPath}";
|
||||
window.pdfCMapsPath = "#{pdfCMapsPath}"
|
||||
window.uiConfig = JSON.parse('!{JSON.stringify(uiConfig).replace(/\//g, "\\/")}');
|
||||
|
||||
script(
|
||||
data-main=buildJsPath("ide.js", {fingerprint:false}),
|
||||
|
||||
Reference in New Issue
Block a user