From 596fc2525b14eeb42f95107a34ff8ef0f5123b65 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Wed, 20 Jul 2016 14:48:58 +0100 Subject: [PATCH] simplified buildJSPath --- .../web/app/coffee/infrastructure/ExpressLocals.coffee | 9 ++++----- services/web/app/views/project/editor.jade | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/services/web/app/coffee/infrastructure/ExpressLocals.coffee b/services/web/app/coffee/infrastructure/ExpressLocals.coffee index b9ee12f365..8e45f9c7ee 100644 --- a/services/web/app/coffee/infrastructure/ExpressLocals.coffee +++ b/services/web/app/coffee/infrastructure/ExpressLocals.coffee @@ -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) diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index c35ae8fbdd..254af18497 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -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').