use syntax validator for beta programme users only

This commit is contained in:
Brian Gough 2016-09-15 14:16:28 +01:00
parent 975b70e4fe
commit 0eaa359f6c
2 changed files with 5 additions and 3 deletions

View file

@ -130,7 +130,7 @@ 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
- var aceWorkerPath = user.betaProgram ? buildJsPath("ace", {cdn:false,fingerprint:false}) : "" // don't use worker for cdn
script(type='text/javascript').
window.pdfJsWorkerPath = "#{pdfJsWorkerPath}";

View file

@ -11,8 +11,10 @@ define [
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}");
if window.aceWorkerPath != ""
ace.config.set('workerPath', "#{window.aceWorkerPath}")
else
ace.config.setDefaultValue("session", "useWorker", false)
# Ace loads its script itself, so we need to hook in to be able to clear
# the cache.