fix missing variables in pdf sync

This commit is contained in:
Brian Gough 2016-06-14 08:40:15 +01:00
parent c815ba6ed2
commit 830d15136d
2 changed files with 7 additions and 4 deletions

View file

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

View file

@ -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()