mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
simplified buildJSPath
This commit is contained in:
parent
a3e40adbaf
commit
596fc2525b
2 changed files with 5 additions and 6 deletions
|
@ -71,15 +71,14 @@ module.exports = (app, webRouter, apiRouter)->
|
|||
|
||||
res.locals.buildJsPath = (jsFile, opts = {})->
|
||||
p = Path.join(jsPath, jsFile)
|
||||
doFingerPrint = opts.fingerprint != false
|
||||
|
||||
doFingerPrint = opts.fingerprint != false
|
||||
|
||||
if !opts.qs?
|
||||
opts.qs = {}
|
||||
|
||||
if !opts.fingerprint? and doFingerPrint
|
||||
opts.fingerprint = getFingerprint(p)
|
||||
else if doFingerPrint
|
||||
opts.qs.fingerprint = opts.fingerprint
|
||||
if !opts.qs?.fingerprint? and doFingerPrint
|
||||
opts.qs.fingerprint = getFingerprint(p)
|
||||
|
||||
p = url.resolve(staticFilesBase, p)
|
||||
qs = querystring.stringify(opts.qs)
|
||||
|
|
|
@ -129,7 +129,7 @@ block content
|
|||
|
||||
- var pdfPath = 'libs/pdfjs-1.3.91/pdf.worker.js'
|
||||
- var fingerprintedPath = fingerprint(jsPath+pdfPath)
|
||||
- var pdfJsWorkerPath = buildJsPath(pdfPath, {fingerprint:fingerprintedPath})
|
||||
- var pdfJsWorkerPath = buildJsPath(pdfPath, {qs:{fingerprint:fingerprintedPath}})
|
||||
|
||||
|
||||
script(type='text/javascript').
|
||||
|
|
Loading…
Reference in a new issue