From 3c298ed6ad5550d2d3b8d2eb8ec922ca332101e9 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Thu, 19 May 2016 10:02:25 +0100 Subject: [PATCH] Preview up to Two Megabytes of bib files --- .../ide/binary-files/controllers/BinaryFileController.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee b/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee index e914c41401..473878bc29 100644 --- a/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee +++ b/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee @@ -3,6 +3,8 @@ define [ ], (App) -> App.controller "BinaryFileController", ["$scope", "$rootScope", "$http", "$timeout", ($scope, $rootScope, $http, $timeout) -> + TWO_MEGABYTES = 2 * 1024 * 1024 + $scope.bibtexPreview = loading: false error: false @@ -20,7 +22,7 @@ define [ return file.name.split(".").pop()?.toLowerCase() $scope.loadBibtexFilePreview = () -> - url = "/project/#{project_id}/file/#{$scope.openFile.id}?range=0-5000" + url = "/project/#{project_id}/file/#{$scope.openFile.id}?range=0-#{TWO_MEGABYTES}" $scope.bibtexPreview.loading = true $http.get(url) .success (data) ->