Browse Source

Merge pull request #297 from sharelatex/roll-out-chktex

Roll out chktex
Brian Gough 10 years ago
parent
commit
7fcae775ee

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

@@ -29,8 +29,8 @@ module.exports = CompileController =
 				options.compiler = req.body.compiler
 			if req.body?.draft
 				options.draft = req.body.draft
-			if req.body?.check
-				options.check = if req.body.check is "validate" then "validate" else undefined
+			if req.body?.check in ['validate', 'error', 'silent']
+				options.check = req.body.check
 			logger.log {options:options, project_id:project_id, user_id:user_id}, "got compile request"
 			CompileManager.compile project_id, user_id, options, (error, status, outputFiles, clsiServerId, limits, validationProblems) ->
 				return next(error) if error?

+ 1 - 1
services/web/app/views/beta_program/opt_in.jade

@@ -22,7 +22,7 @@ block content
 											ul.list-unstyled.text-center
 												li 
 													i.fa.fa-fw.fa-book
-													|  #{translate("mendeley_integration")}
+													|  #{translate("syntax_checking")}
 								.row.text-centered
 									.col-md-12
 										if user.betaProgram

+ 5 - 7
services/web/app/views/project/editor/pdf.jade

@@ -36,13 +36,11 @@ div.full-size.pdf(ng-controller="PdfController")
 						i.fa.fa-fw(ng-class="{'fa-check': draft}")
 						|  #{translate("fast")} 
 						span.subdued [draft]
-				if user.betaProgram
-					li.dropdown-header #{translate("file_checks")}
-					li
-						a(href, ng-click="recompile({check:true})")
-							i.fa.fa-fw()
-							|  #{translate("run_syntax_check")}
-							span.beta-feature-badge
+				li.dropdown-header #{translate("file_checks")}
+				li
+					a(href, ng-click="recompile({check:true})")
+						i.fa.fa-fw()
+						|  #{translate("run_syntax_check")}
 		a(
 			href
 			ng-click="stop()"

+ 5 - 2
services/web/public/coffee/ide/editor/EditorManager.coffee

@@ -46,8 +46,11 @@ define [
 
 			done = () =>
 				if options.gotoLine?
-					@$scope.$broadcast "editor:gotoLine", options.gotoLine, options.gotoColumn
-			
+					# allow Ace to display document before moving, delay until next tick
+					setTimeout () =>
+						@$scope.$broadcast "editor:gotoLine", options.gotoLine, options.gotoColumn
+					,0
+
 			if doc.id == @$scope.editor.open_doc_id and !options.forceReopen
 				@$scope.$apply () =>
 					done()

+ 1 - 0
services/web/public/coffee/ide/editor/directives/aceEditor/cursor-position/CursorPositionManager.coffee

@@ -55,4 +55,5 @@ define [], () ->
 
 		gotoLine: (line, column) ->
 			@editor.gotoLine(line, column)
+			@editor.scrollToLine(line,true,true)
 			@editor.focus()

+ 7 - 2
services/web/public/coffee/ide/pdf/controllers/PdfController.coffee

@@ -86,7 +86,7 @@ define [
 			return $http.post url, {
 				rootDoc_id: options.rootDocOverride_id or null
 				draft: $scope.draft
-				check: if options.check then "validate" else null
+				check: if options.check then "validate" else "silent"
 				_csrf: window.csrfToken
 			}, {params: params}
 
@@ -195,12 +195,17 @@ define [
 				qs.clsiserverid = response.clsiServerId
 			for file in response.outputFiles
 				if IGNORE_FILES.indexOf(file.path) == -1
+					isOutputFile = file.path.match(/^output\./)
 					$scope.pdf.outputFiles.push {
 						# Turn 'output.blg' into 'blg file'.
-						name: if file.path.match(/^output\./) then "#{file.path.replace(/^output\./, "")} file" else file.path
+						name: if isOutputFile then "#{file.path.replace(/^output\./, "")} file" else file.path
 						url: "/project/#{project_id}/output/#{file.path}" + createQueryString qs
+						main: if isOutputFile then true else false
 					}
 
+			# sort the output files into order, main files first, then others
+			$scope.pdf.outputFiles.sort (a,b) -> (b.main - a.main) || a.name.localeCompare(b.name)
+
 
 		fetchLogs = (fileByPath, options) ->