diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index a11638db5b..69e4584bf1 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -217,12 +217,7 @@ module.exports = ProjectController = autoComplete: user.ace.autoComplete pdfViewer : user.ace.pdfViewer } - sharelatex : { - siteUrl: Settings.siteUrl, - jsPath: res.locals.jsPath - } privilegeLevel: privilegeLevel - loadPdfjs: (user.ace.pdfViewer == "pdfjs") chatUrl: Settings.apis.chat.url anonymous: anonymous languages: Settings.languages diff --git a/services/web/app/coffee/infrastructure/ExpressLocals.coffee b/services/web/app/coffee/infrastructure/ExpressLocals.coffee index 7a9570e0ec..6e14526d88 100644 --- a/services/web/app/coffee/infrastructure/ExpressLocals.coffee +++ b/services/web/app/coffee/infrastructure/ExpressLocals.coffee @@ -17,12 +17,10 @@ logger.log "Generating file fingerprints..." for path in [ "#{jsPath}libs/require.js", "#{jsPath}ide.js", - "#{jsPath}app/main.js", - "#{jsPath}list.js", + "#{jsPath}main.js", "#{jsPath}libs/pdf.js", "#{jsPath}libs/pdf.worker.js", - "/stylesheets/style.css", - "/brand/plans.css" + "/stylesheets/style.css" ] filePath = Path.join __dirname, "../../../", "public#{path}" exists = fs.existsSync filePath diff --git a/services/web/app/views/layout.jade b/services/web/app/views/layout.jade index c4fb0ee1fd..0b374dd0ab 100644 --- a/services/web/app/views/layout.jade +++ b/services/web/app/views/layout.jade @@ -80,7 +80,10 @@ html(itemscope, itemtype='http://schema.org/Product') }; script. - window.sharelatex = {} + window.sharelatex = { + siteUrl: '#{settings.siteUrl}', + jsPath: '#{jsPath}' + }; - if (typeof(settings.algolia) != "undefined") script. diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index d1e59753da..225903af92 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -82,7 +82,6 @@ block content //- and doesn't prematurely end the script tag. script(type='text/javascript'). window.project_id = "!{project_id}" - window.sharelatex = !{JSON.stringify(sharelatex).replace(/\//g, '\\/')}; window.userSettings = !{JSON.stringify(userSettings).replace(/\//g, '\\/')}; window.user = !{JSON.stringify(user).replace(/\//g, '\\/')}; window.csrfToken = "!{csrfToken}"; @@ -99,6 +98,9 @@ block content }, "libs/pdf": { deps: ["libs/compatibility"] + }, + "ace/ext-searchbox": { + deps: ["ace/ace"] } } }; @@ -112,7 +114,7 @@ block content - var fingerprintedPath = fingerprint(jsPath+'libs/pdf.worker.js') - var pdfJsWorkerPath = jsPath+'libs/pdf.worker.js?fingerprint='+fingerprintedPath script(type='text/javascript'). - window.sharelatex.pdfJsWorkerPath = "#{pdfJsWorkerPath}" + window.pdfJsWorkerPath = "#{pdfJsWorkerPath}"; script( data-main=jsPath+'ide.js', diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index 9a83b457c4..524ed93d09 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee @@ -66,7 +66,7 @@ define [ name: "find", bindKey: win: "Ctrl-F", mac: "Command-F" exec: (editor) -> - Ace.require("ace/ext/searchbox").Search(editor, true) + ace.require("ace/ext/searchbox").Search(editor, true) readOnly: true editor.commands.removeCommand "replace" diff --git a/services/web/public/coffee/ide/pdf/directives/pdfJs.coffee b/services/web/public/coffee/ide/pdf/directives/pdfJs.coffee index fcd6def34c..5a9739fe49 100644 --- a/services/web/public/coffee/ide/pdf/directives/pdfJs.coffee +++ b/services/web/public/coffee/ide/pdf/directives/pdfJs.coffee @@ -17,8 +17,9 @@ define [ annotationsLayerCss highlightsLayerCss ) -> + console.log "SETTING workerSrc", PDFJS, window.pdfJsWorkerPath if PDFJS? - PDFJS.workerSrc = "#{window.sharelatex.pdfJsWorkerPath}" + PDFJS.workerSrc = window.pdfJsWorkerPath style = $("