Preview up to Two Megabytes of bib files

This commit is contained in:
Shane Kilkelly 2016-05-19 10:02:25 +01:00
parent 5df5ba868c
commit 3c298ed6ad

View file

@ -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) ->