diff --git a/services/web/app/coffee/infrastructure/ExpressLocals.coffee b/services/web/app/coffee/infrastructure/ExpressLocals.coffee index b18cbb73f4..b9ee12f365 100644 --- a/services/web/app/coffee/infrastructure/ExpressLocals.coffee +++ b/services/web/app/coffee/infrastructure/ExpressLocals.coffee @@ -64,28 +64,34 @@ module.exports = (app, webRouter, apiRouter)-> webRouter.use (req, res, next)-> res.locals.jsPath = jsPath + res.locals.fullJsPath = url.resolve(staticFilesBase, jsPath) + imgPath = "/img/" cssPath = "/stylesheets/" - res.locals.buildJsPath = (jsFile, opts = {})-> + p = Path.join(jsPath, jsFile) + doFingerPrint = opts.fingerprint != false + if !opts.qs? opts.qs = {} - if !opts.fingerprint? - opts.fingerprint = getFingerprint(jsPath + jsFile) - else + + if !opts.fingerprint? and doFingerPrint + opts.fingerprint = getFingerprint(p) + else if doFingerPrint opts.qs.fingerprint = opts.fingerprint - p = Path.join(jsPath, jsFile) + p = url.resolve(staticFilesBase, p) qs = querystring.stringify(opts.qs) - if qs? + + if qs? and qs.length > 0 p = p + "?" + qs return p res.locals.buildCssPath = (cssFile)-> p = Path.join(cssPath, cssFile) - return url.resolve(staticFilesBase, p) + "?fingerprint=" + getFingerprint(cssPath + cssFile) + return url.resolve(staticFilesBase, p) + "?fingerprint=" + getFingerprint(p) res.locals.buildImgPath = (imgFile)-> p = Path.join(imgPath, imgFile) diff --git a/services/web/app/views/layout.jade b/services/web/app/views/layout.jade index 4c5d504a94..fd87360125 100644 --- a/services/web/app/views/layout.jade +++ b/services/web/app/views/layout.jade @@ -124,8 +124,8 @@ html(itemscope, itemtype='http://schema.org/Product') window.csrfToken = "#{csrfToken}"; block scripts - script(src=buildJsPath("libs/jquery-1.11.1.min.js")) - script(src=buildJsPath("libs/angular-1.3.15.min.js")) + script(src=buildJsPath("libs/jquery-1.11.1.min.js", {fingerprint:false})) + script(src=buildJsPath("libs/angular-1.3.15.min.js", {fingerprint:false})) script. window.sharelatex = { siteUrl: '#{settings.siteUrl}', @@ -194,8 +194,8 @@ html(itemscope, itemtype='http://schema.org/Product') } }; script( - data-main=jsPath+'main.js', - baseurl=jsPath, + data-main=buildJsPath('main.js'), + baseurl=fullJsPath, src=buildJsPath('libs/require.js') ) diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index 75037fb6ed..c35ae8fbdd 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -100,7 +100,7 @@ block content window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)}; window.requirejs = { "paths" : { - "mathjax": "#{buildJsPath('/libs/mathjax/MathJax.js', {qs:{config:'TeX-AMS_HTML'}})}", + "mathjax": "#{buildJsPath('/libs/mathjax/MathJax.js', {qs:{config:'TeX-AMS_HTML', fingerprint:false}})}", "moment": "libs/moment-2.7.0", "libs/pdf": "libs/pdfjs-1.3.91/pdf" }, @@ -136,10 +136,11 @@ block content window.pdfJsWorkerPath = "#{pdfJsWorkerPath}"; script( - data-main=jsPath+"ide.js", - baseurl=jsPath, - data-ace-base=jsPath+'ace', + data-main=buildJsPath("ide.js"), + baseurl=fullJsPath, + data-ace-base=buildJsPath('ace', {fingerprint:false}), src=buildJsPath('libs/require.js') ) + diff --git a/services/web/config/settings.defaults.coffee b/services/web/config/settings.defaults.coffee index 85b12cec56..e4c565c315 100644 --- a/services/web/config/settings.defaults.coffee +++ b/services/web/config/settings.defaults.coffee @@ -116,7 +116,7 @@ module.exports = settings = # cdn: # web: - # host:"https://www.somewhere.com" + # host:"http://www.sharelatex.dev:3000" # Where your instance of ShareLaTeX can be found publically. Used in emails # that are sent out, generated links, etc. diff --git a/services/web/public/coffee/ide/pdfng/directives/pdfJs.coffee b/services/web/public/coffee/ide/pdfng/directives/pdfJs.coffee index 98361b9ff7..f1c161ffc6 100644 --- a/services/web/public/coffee/ide/pdfng/directives/pdfJs.coffee +++ b/services/web/public/coffee/ide/pdfng/directives/pdfJs.coffee @@ -1,23 +1,14 @@ define [ "base" "ide/pdfng/directives/pdfViewer" - "text!libs/pdfListView/TextLayer.css" - "text!libs/pdfListView/AnnotationsLayer.css" - "text!libs/pdfListView/HighlightsLayer.css" ], ( App pdfViewer - textLayerCss - annotationsLayerCss - highlightsLayerCss + ) -> if PDFJS? PDFJS.workerSrc = window.pdfJsWorkerPath - style = $("