diff --git a/services/web/Gruntfile.coffee b/services/web/Gruntfile.coffee index ece9e5bf11..147ab3a66f 100644 --- a/services/web/Gruntfile.coffee +++ b/services/web/Gruntfile.coffee @@ -176,6 +176,8 @@ module.exports = (grunt) -> name: "libs" },{ name: "ace/mode-latex" + },{ + name: "ace/worker-latex" } ] diff --git a/services/web/app/views/project/editor.jade b/services/web/app/views/project/editor.jade index d1a45417c5..df854115fc 100644 --- a/services/web/app/views/project/editor.jade +++ b/services/web/app/views/project/editor.jade @@ -130,10 +130,11 @@ block content - var pdfPath = 'libs/pdfjs-1.3.91p1/pdf.worker.js' - var fingerprintedPath = fingerprint(jsPath+pdfPath) - var pdfJsWorkerPath = buildJsPath(pdfPath, {cdn:false,qs:{fingerprint:fingerprintedPath}}) // don't use worker for cdn - + - var aceWorkerPath = buildJsPath("ace", {cdn:false,fingerprint:false}) // don't use worker for cdn script(type='text/javascript'). window.pdfJsWorkerPath = "#{pdfJsWorkerPath}"; + window.aceWorkerPath = "#{aceWorkerPath}"; script( data-main=buildJsPath("ide.js", {fingerprint:false}), diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee index 800d6bd194..b4c15b3539 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor.coffee @@ -9,7 +9,11 @@ define [ "ide/editor/directives/aceEditor/cursor-position/CursorPositionManager" ], (App, Ace, SearchBox, UndoManager, AutoCompleteManager, SpellCheckManager, HighlightsManager, CursorPositionManager) -> EditSession = ace.require('ace/edit_session').EditSession - + + # set the path for ace workers if using a CDN (from editor.jade) + if window.aceWorkerPath? + ace.config.set('workerPath', "#{window.aceWorkerPath}"); + # Ace loads its script itself, so we need to hook in to be able to clear # the cache. if !ace.config._moduleUrl?