Przeglądaj źródła

fix missing variables in pdf sync

Brian Gough 10 lat temu
rodzic
commit
830d15136d

+ 4 - 4
services/web/app/coffee/Features/Compile/CompileController.coffee

@@ -129,11 +129,11 @@ module.exports = CompileController =
 			return next(new Error("invalid h parameter"))
 		if not v?.match(/^\d+\.\d+$/)
 			return next(new Error("invalid v parameter"))
-		url = CompileController._getUrl(project_id, user_id, "sync/pdf")
-		destination = {url: url, qs: {page, h, v}}
 		# whether this request is going to a per-user container
 		CompileController._compileAsUser req, (error, user_id) ->
 			return next(error) if error?
+			url = CompileController._getUrl(project_id, user_id, "sync/pdf")
+			destination = {url: url, qs: {page, h, v}}
 			CompileController.proxyToClsi(project_id, destination, req, res, next)
 
 	proxySyncCode: (req, res, next = (error) ->) ->
@@ -145,10 +145,10 @@ module.exports = CompileController =
 			return next(new Error("invalid line parameter"))
 		if not column?.match(/^\d+$/)
 			return next(new Error("invalid column parameter"))
-		url = CompileController._getUrl(project_id, user_id, "sync/code")
-		destination = {url:url, qs: {file, line, column}}
 		CompileController._compileAsUser req, (error, user_id) ->
 			return next(error) if error?
+			url = CompileController._getUrl(project_id, user_id, "sync/code")
+			destination = {url:url, qs: {file, line, column}}
 			CompileController.proxyToClsi(project_id, destination, req, res, next)
 
 	proxyToClsi: (project_id, url, req, res, next = (error) ->) ->

+ 3 - 0
services/web/public/coffee/ide/pdf/controllers/PdfController.coffee

@@ -301,6 +301,9 @@ define [
 			$scope.startedFreeTrial = true
 
 	App.factory "synctex", ["ide", "$http", "$q", (ide, $http, $q) ->
+		# enable per-user containers if querystring includes isolated=true
+		perUserCompile = window.location?.search?.match(/isolated=true/)? or undefined
+
 		synctex =
 			syncToPdf: (cursorPosition) ->
 				deferred = $q.defer()