From c815ba6ed298281412a502e4aee4f95dee1e6fe8 Mon Sep 17 00:00:00 2001 From: Paulo Reis Date: Mon, 13 Jun 2016 15:34:16 +0100 Subject: [PATCH 1/7] Added Paulo Reis photo for the about page. --- services/web/public/img/about/paulo_reis.jpg | Bin 0 -> 8371 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 services/web/public/img/about/paulo_reis.jpg diff --git a/services/web/public/img/about/paulo_reis.jpg b/services/web/public/img/about/paulo_reis.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e928bfb1e8b9047a091767ef21bc336824bc2fa4 GIT binary patch literal 8371 zcmeHMdpwi>+rPIV=PXh=WK9;zjyBtn#vCSdu87La#&Q_joceZBk#uk%$rmtzbrg>a08A!e2mpXAAP*R>Aa&mQca;3R5oE)b|=tLYAD+aEbLQkD(etcgJ!a0C1;tK=#p$IEC5<;KJV)H`8 z0|o#diz8971S*z{z~iZS5*1GY0R25DW_*O+-IF~lx5p!={RNkZUokEFfim_-97zB$ z51f|5;tAL!*i0PIt|X~h`C~F<3Il<{fMn>5eV9xN1dyNd9;Te~V_ZE&YIb~Siu5cV zl`?O7U69=r*&n{8$W6;S;JExO9-R^=Sr=poMoLMN_yePWq@^U!kyC!ixihhV)aF8_ zZG!pCh0f+AFc&r}AI@7ejR7kne@Yi3E|mPKc*QjZ7Qi${EJNqWusO2Stk1qDrKiU= zLHtbJiFIdU7t3>EKRFY-cwBytO~oHFI3+&B?lggKNo|6aU`)m0s5lA&N2KD3U{#2# zp;nv# zp4~P9$8DRVJ9}Foo8pJGSdB1?qDBRW26IF#L{xB4h>#j(j+7Xug0grRgG5LmqCj(` z2h$m0#TRf8M6@v)iv+a=eq5?6-DX-B{AP}vb}}+D5*$$|7nvi$l_f5*!a=8g7CQ&*L6YD>gxJri z0D?n*j-Fv^4v@+G=g{EbS+hcsbp+_s&)k?XEOd_!V}33f+W27u`!$=PA~`)f>GdRmkOO}O|vThDdV%#lF*R|FnFpPN5EqRIfe)Oas=i`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ing 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() From 2840a7757fe953e38d17befb43a108ae7e3fd094 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 14 Jun 2016 12:32:54 +0100 Subject: [PATCH 3/7] fix bug in synctex position calculation for syncToCode --- .../ide/pdf/controllers/PdfController.coffee | 25 ++++++++++++++++--- .../coffee/ide/pdfng/directives/pdfJs.coffee | 6 ++++- .../ide/pdfng/directives/pdfViewer.coffee | 6 ++++- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 58d7c34564..f6f1006e4a 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -353,18 +353,35 @@ define [ deferred.reject() return deferred.promise + # FIXME: this actually works better if it's halfway across the + # page (or the visible part of the page). Synctex doesn't + # always find the right place in the file when the point is at + # the edge of the page, it sometimes returns the start of the + # next paragraph instead. + h = position.offset.left + + # Compute the vertical position to pass to synctex, which + # works with coordinates increasing from the top of the page + # down. This matches the browser's DOM coordinate of the + # click point, but the pdf position is measured from the + # bottom of the page so we need to invert it. + if options.fromPdfPosition and position.pageSize?.height? + v = (position.pageSize.height - position.offset.top) or 0 # measure from pdf point (inverted) + else + v = position.offset.top or 0 # measure from html click position + # It's not clear exactly where we should sync to if it wasn't directly # clicked on, but a little bit down from the very top seems best. if options.includeVisualOffset - position.offset.top = position.offset.top + 80 + v += 72 # use the same value as in pdfViewer highlighting visual offset $http({ url: "/project/#{ide.project_id}/sync/pdf", method: "GET", params: { page: position.page + 1 - h: position.offset.left.toFixed(2) - v: position.offset.top.toFixed(2) + h: h.toFixed(2) + v: v.toFixed(2) clsiserverid:ide.clsiServerId isolated: perUserCompile } @@ -395,7 +412,7 @@ define [ $scope.syncToCode = () -> synctex - .syncToCode($scope.pdf.position, includeVisualOffset: true) + .syncToCode($scope.pdf.position, includeVisualOffset: true, fromPdfPosition: true) .then (data) -> {doc, line} = data ide.editorManager.openDoc(doc, gotoLine: line) diff --git a/services/web/public/coffee/ide/pdfng/directives/pdfJs.coffee b/services/web/public/coffee/ide/pdfng/directives/pdfJs.coffee index 2df89bc35f..310a9ba7f8 100644 --- a/services/web/public/coffee/ide/pdfng/directives/pdfJs.coffee +++ b/services/web/public/coffee/ide/pdfng/directives/pdfJs.coffee @@ -50,7 +50,11 @@ define [ scope.scale = { scaleMode: 'scale_mode_fit_width' } if (position = localStorage("pdf.position.#{attrs.key}")) - scope.position = { page: +position.page, offset: { "top": +position.offset.top, "left": +position.offset.left } } + scope.position = + page: +position.page, + offset: + "top": +position.offset.top + "left": +position.offset.left #scope.position = pdfListView.getPdfPosition(true) diff --git a/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee b/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee index f0ec8d61b1..b719dfb0f2 100644 --- a/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee +++ b/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee @@ -187,7 +187,8 @@ define [ # console.log 'converted to offset = ', pdfOffset newPosition = { "page": topPageIdx, - "offset" : { "top" : pdfOffset[1], "left": 0 } + "offset" : { "top" : pdfOffset[1], "left": 0} + "pageSize": { "height": viewport.viewBox[3], "width": viewport.viewBox[2] } } return newPosition @@ -208,6 +209,8 @@ define [ return $scope.document.getPdfViewport(page.pageNum).then (viewport) -> page.viewport = viewport pageOffset = viewport.convertToViewportPoint(offset.left, offset.top) + # if the passed-in position doesn't have the page height/width add them now + position.pageSize ?= {"height": viewport.viewBox[3], "width": viewport.viewBox[2]} # console.log 'addition offset =', pageOffset # console.log 'total', pageTop + pageOffset[1] Math.round(pageTop + pageOffset[1] + currentScroll) ## 10 is margin @@ -515,6 +518,7 @@ define [ pageNum = scope.pages[first.page].pageNum + # use a visual offset of 72pt to match the offset in PdfController syncToCode scope.document.getPdfViewport(pageNum).then (viewport) -> position = { page: first.page From 991d3c7aa1308fb1ee9e641a9f42b02332894878 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 14 Jun 2016 12:49:06 +0100 Subject: [PATCH 4/7] avoid exception when switching between full and split pdf view --- .../coffee/ide/pdfng/directives/pdfViewer.coffee | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee b/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee index b719dfb0f2..5f87ff25e9 100644 --- a/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee +++ b/services/web/public/coffee/ide/pdfng/directives/pdfViewer.coffee @@ -516,7 +516,15 @@ define [ first = highlights[0] - pageNum = scope.pages[first.page].pageNum + # switching between split and full pdf views can cause + # highlights to appear before rendering + if !scope.pages + return # ignore highlight scroll if still rendering + + pageNum = scope.pages[first.page]?.pageNum + + if !pageNum? + return # ignore highlight scroll if page not found # use a visual offset of 72pt to match the offset in PdfController syncToCode scope.document.getPdfViewport(pageNum).then (viewport) -> From ecd9bed1c2d0903096bc898c8364147479442aa2 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 14 Jun 2016 14:21:56 +0100 Subject: [PATCH 5/7] enable per-user containers by default --- .../coffee/ide/pdf/controllers/PdfController.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 58d7c34564..7c08c50110 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -5,8 +5,8 @@ define [ ], (App, LogParser, BibLogParser) -> App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, localStorage) -> - # enable per-user containers if querystring includes isolated=true - perUserCompile = window.location?.search?.match(/isolated=true/)? or undefined + # enable per-user containers + perUserCompile = true autoCompile = true # pdf.view = uncompiled | pdf | errors @@ -301,8 +301,8 @@ 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 + # enable per-user containers by default + perUserCompile = true synctex = syncToPdf: (cursorPosition) -> From ed6c384b6858952a01a770bc9871581fb342898f Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 14 Jun 2016 14:51:33 +0100 Subject: [PATCH 6/7] fix urls of downloaded files to those provided by clsi --- .../web/public/coffee/ide/pdf/controllers/PdfController.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 58d7c34564..9915f8a627 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -125,7 +125,8 @@ define [ file.name = "#{file.path.replace(/^output\./, "")} file" else file.name = file.path - file.url = "/project/#{project_id}/output/#{file.path}" + if not file.url? + file.url = "/project/#{project_id}/output/#{file.path}" if response.clsiServerId? file.url = file.url + "?clsiserverid=#{response.clsiServerId}" $scope.pdf.outputFiles.push file From d6964feb2fff97a7876a87f84ab6a1a3f72a7621 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Tue, 14 Jun 2016 16:30:06 +0100 Subject: [PATCH 7/7] Revert "enable per-user containers by default" This reverts commit e80b8cd907605d9a7aad16496d49efff4bb08810. --- .../coffee/ide/pdf/controllers/PdfController.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee index 559f23f03f..9b7c2d5bc8 100644 --- a/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee +++ b/services/web/public/coffee/ide/pdf/controllers/PdfController.coffee @@ -5,8 +5,8 @@ define [ ], (App, LogParser, BibLogParser) -> App.controller "PdfController", ($scope, $http, ide, $modal, synctex, event_tracking, localStorage) -> - # enable per-user containers - perUserCompile = true + # enable per-user containers if querystring includes isolated=true + perUserCompile = window.location?.search?.match(/isolated=true/)? or undefined autoCompile = true # pdf.view = uncompiled | pdf | errors @@ -302,8 +302,8 @@ define [ $scope.startedFreeTrial = true App.factory "synctex", ["ide", "$http", "$q", (ide, $http, $q) -> - # enable per-user containers by default - perUserCompile = true + # enable per-user containers if querystring includes isolated=true + perUserCompile = window.location?.search?.match(/isolated=true/)? or undefined synctex = syncToPdf: (cursorPosition) ->