Sfoglia il codice sorgente

simplified buildJSPath

Henry Oswald 10 anni fa
parent
commit
596fc2525b

+ 4 - 5
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)

+ 1 - 1
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').