Bläddra i källkod

use syntax validator for beta programme users only

Brian Gough 10 år sedan
förälder
incheckning
0eaa359f6c

+ 1 - 1
services/web/app/views/project/editor.jade

@@ -130,7 +130,7 @@ 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
+	- var aceWorkerPath = user.betaProgram ? 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}";

+ 4 - 2
services/web/public/coffee/ide/editor/directives/aceEditor.coffee

@@ -11,8 +11,10 @@ define [
 	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)
 	# 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
 	# Ace loads its script itself, so we need to hook in to be able to clear
 	# the cache.
 	# the cache.