 			$scope.pdf.compileInProgress = false
 			$scope.pdf.autoCompileDisabled = false
 
-			buildPdfDownloadUrl = (path)->
-				if pdfDownloadDomain?
-					return "#{pdfDownloadDomain}#{path}"
-				else
-					return path
+
 			# make a cache to look up files by name
 			fileByPath = {}
 			if response?.outputFiles?

				$scope.pdf.view = 'errors'
				$scope.pdf.failure = true
				$scope.shouldShowLogs = true
				fetchLogs(fileByPath)
			else if response.status == 'clsi-maintenance'
				$scope.pdf.view = 'errors'
				$scope.pdf.clsiMaintenance = true

			if response.status == "timedout"
				$scope.pdf.view = 'errors'
				$scope.pdf.timedout = true
				fetchLogs(fileByPath, {pdfDownloadDomain:pdfDownloadDomain})
			else if response.status == "terminated"
				$scope.pdf.view = 'errors'
				$scope.pdf.compileTerminated = true
				fetchLogs(fileByPath, {pdfDownloadDomain:pdfDownloadDomain})
			else if response.status in ["validation-fail", "validation-pass"]
				$scope.pdf.view = 'pdf'
				$scope.pdf.url = buildPdfDownloadUrl pdfDownloadDomain, last_pdf_url
				$scope.shouldShowLogs = true
				$scope.pdf.failedCheck = true if response.status is "validation-fail"
				event_tracking.sendMB "syntax-check-#{response.status}"
				fetchLogs(fileByPath, { validation: true, pdfDownloadDomain:pdfDownloadDomain})
			else if response.status == "exited"
				$scope.pdf.view = 'pdf'
				$scope.pdf.compileExited = true
				$scope.pdf.url = buildPdfDownloadUrl pdfDownloadDomain, last_pdf_url
				$scope.shouldShowLogs = true
				fetchLogs(fileByPath, {pdfDownloadDomain:pdfDownloadDomain})
			else if response.status == "autocompile-backoff"
				if $scope.pdf.isAutoCompileOnLoad # initial autocompile
					$scope.pdf.view = 'uncompiled'
