From 830d15136d1f8058012a3aa355303bdeca115f66 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 14 Jun 2016 08:40:15 +0100 Subject: [PATCH] fix missing variables in pdf sync --- .../app/coffee/Features/Compile/CompileController.coffee | 8 ++++---- .../coffee/ide/pdf/controllers/PdfController.coffee | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/services/web/app/coffee/Features/Compile/CompileController.coffee b/services/web/app/coffee/Features/Compile/CompileController.coffee index c19ad6e2da..7a84635bed 100755 --- a/services/web/app/coffee/Features/Compile/CompileController.coffee +++ b/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) ->) -> diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 4bbc637815..58d7c34564 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/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()