infrastructure for using ace syntax checking

This commit is contained in:
Brian Gough 2016-09-14 15:17:24 +01:00
parent 6c716ca252
commit 0a350c8e3f
3 changed files with 9 additions and 2 deletions

View file

@ -176,6 +176,8 @@ module.exports = (grunt) ->
name: "libs"
},{
name: "ace/mode-latex"
},{
name: "ace/worker-latex"
}
]

View file

@ -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}),

View file

@ -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?