Просмотр исходного кода

Move clsiServerId and compileGroup from ide to ide.$scope.pdf (#5314)

GitOrigin-RevId: 6050898614b4fc9dee52e893149acfda17c324a0
Alf Eaton 4 лет назад
Родитель
Сommit
ffc72416ff

+ 1 - 1
services/web/frontend/js/features/pdf-preview/contexts/pdf-preview-context.js

@@ -55,7 +55,7 @@ export default function PdfPreviewProvider({ children }) {
   const [, setLogEntryAnnotations] = useScopeValue('pdf.logEntryAnnotations')
   const [, setLogEntryAnnotations] = useScopeValue('pdf.logEntryAnnotations')
 
 
   // the id of the CLSI server which ran the compile
   // the id of the CLSI server which ran the compile
-  const [, setClsiServerId] = useScopeValue('ide.clsiServerId')
+  const [, setClsiServerId] = useScopeValue('pdf.clsiServerId')
 
 
   // whether to display the editor and preview side-by-side or full-width ("flat")
   // whether to display the editor and preview side-by-side or full-width ("flat")
   const [pdfLayout, setPdfLayout] = useScopeValue('ui.pdfLayout')
   const [pdfLayout, setPdfLayout] = useScopeValue('ui.pdfLayout')

+ 2 - 0
services/web/frontend/js/ide/pdf/PdfManager.js

@@ -35,6 +35,8 @@ export default PdfManager = class PdfManager {
       highlights: [],
       highlights: [],
       position: null,
       position: null,
       lastCompileTimestamp: null,
       lastCompileTimestamp: null,
+      clsiServerId: null,
+      compileGroup: null,
     }
     }
   }
   }
 }
 }

+ 6 - 6
services/web/frontend/js/ide/pdf/controllers/PdfController.js

@@ -374,11 +374,11 @@ App.controller(
       let qs = {}
       let qs = {}
       // add a query string parameter for the compile group
       // add a query string parameter for the compile group
       if (response.compileGroup != null) {
       if (response.compileGroup != null) {
-        ide.compileGroup = qs.compileGroup = response.compileGroup
+        $scope.pdf.compileGroup = qs.compileGroup = response.compileGroup
       }
       }
       // add a query string parameter for the clsi server id
       // add a query string parameter for the clsi server id
       if (response.clsiServerId != null) {
       if (response.clsiServerId != null) {
-        ide.clsiServerId = qs.clsiserverid = response.clsiServerId
+        $scope.pdf.clsiServerId = qs.clsiserverid = response.clsiServerId
       }
       }
 
 
       // TODO(das7pad): drop this hack once 2747f0d40af8729304 has landed in clsi
       // TODO(das7pad): drop this hack once 2747f0d40af8729304 has landed in clsi
@@ -573,8 +573,8 @@ App.controller(
           method: 'GET',
           method: 'GET',
           url: buildPdfDownloadUrl(options.pdfDownloadDomain, file.url),
           url: buildPdfDownloadUrl(options.pdfDownloadDomain, file.url),
           params: {
           params: {
-            compileGroup: ide.compileGroup,
-            clsiserverid: ide.clsiServerId,
+            compileGroup: $scope.pdf.compileGroup,
+            clsiserverid: $scope.pdf.clsiServerId,
           },
           },
         }
         }
         return $http(opts)
         return $http(opts)
@@ -844,7 +844,7 @@ App.controller(
         url: `/project/${$scope.project_id}/compile/stop`,
         url: `/project/${$scope.project_id}/compile/stop`,
         method: 'POST',
         method: 'POST',
         params: {
         params: {
-          clsiserverid: ide.clsiServerId,
+          clsiserverid: $scope.pdf.clsiServerId,
         },
         },
         headers: {
         headers: {
           'X-Csrf-Token': window.csrfToken,
           'X-Csrf-Token': window.csrfToken,
@@ -865,7 +865,7 @@ App.controller(
         url: `/project/${$scope.project_id}/output`,
         url: `/project/${$scope.project_id}/output`,
         method: 'DELETE',
         method: 'DELETE',
         params: {
         params: {
-          clsiserverid: ide.clsiServerId,
+          clsiserverid: $scope.pdf.clsiServerId,
         },
         },
         headers: {
         headers: {
           'X-Csrf-Token': window.csrfToken,
           'X-Csrf-Token': window.csrfToken,

+ 2 - 2
services/web/frontend/js/ide/pdf/controllers/PdfSynctexController.js

@@ -107,7 +107,7 @@ App.factory('synctex', function (ide, $http, $q) {
           file: path,
           file: path,
           line: row + 1,
           line: row + 1,
           column,
           column,
-          clsiserverid: ide.clsiServerId,
+          clsiserverid: ide.$scope.pdf.clsiServerId,
         },
         },
       })
       })
         .then(response => {
         .then(response => {
@@ -172,7 +172,7 @@ App.factory('synctex', function (ide, $http, $q) {
           page: position.page + 1,
           page: position.page + 1,
           h: h.toFixed(2),
           h: h.toFixed(2),
           v: v.toFixed(2),
           v: v.toFixed(2),
-          clsiserverid: ide.clsiServerId,
+          clsiserverid: ide.$scope.pdf.clsiServerId,
         },
         },
       })
       })
         .then(response => {
         .then(response => {