mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-20 04:34:04 +00:00
infrastructure for using ace syntax checking
This commit is contained in:
parent
6c716ca252
commit
0a350c8e3f
3 changed files with 9 additions and 2 deletions
|
@ -176,6 +176,8 @@ module.exports = (grunt) ->
|
||||||
name: "libs"
|
name: "libs"
|
||||||
},{
|
},{
|
||||||
name: "ace/mode-latex"
|
name: "ace/mode-latex"
|
||||||
|
},{
|
||||||
|
name: "ace/worker-latex"
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
|
@ -130,10 +130,11 @@ block content
|
||||||
- var pdfPath = 'libs/pdfjs-1.3.91p1/pdf.worker.js'
|
- var pdfPath = 'libs/pdfjs-1.3.91p1/pdf.worker.js'
|
||||||
- var fingerprintedPath = fingerprint(jsPath+pdfPath)
|
- var fingerprintedPath = fingerprint(jsPath+pdfPath)
|
||||||
- var pdfJsWorkerPath = buildJsPath(pdfPath, {cdn:false,qs:{fingerprint:fingerprintedPath}}) // don't use worker for cdn
|
- 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').
|
script(type='text/javascript').
|
||||||
window.pdfJsWorkerPath = "#{pdfJsWorkerPath}";
|
window.pdfJsWorkerPath = "#{pdfJsWorkerPath}";
|
||||||
|
window.aceWorkerPath = "#{aceWorkerPath}";
|
||||||
|
|
||||||
script(
|
script(
|
||||||
data-main=buildJsPath("ide.js", {fingerprint:false}),
|
data-main=buildJsPath("ide.js", {fingerprint:false}),
|
||||||
|
|
|
@ -9,7 +9,11 @@ define [
|
||||||
"ide/editor/directives/aceEditor/cursor-position/CursorPositionManager"
|
"ide/editor/directives/aceEditor/cursor-position/CursorPositionManager"
|
||||||
], (App, Ace, SearchBox, UndoManager, AutoCompleteManager, SpellCheckManager, HighlightsManager, CursorPositionManager) ->
|
], (App, Ace, SearchBox, UndoManager, AutoCompleteManager, SpellCheckManager, HighlightsManager, CursorPositionManager) ->
|
||||||
EditSession = ace.require('ace/edit_session').EditSession
|
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
|
# Ace loads its script itself, so we need to hook in to be able to clear
|
||||||
# the cache.
|
# the cache.
|
||||||
if !ace.config._moduleUrl?
|
if !ace.config._moduleUrl?
|
||||||
|
|
Loading…
Reference in a new issue