Skip to content

Commit

Permalink
Merge pull request #110 from veraPDF/feature/large-pdf-names
Browse files Browse the repository at this point in the history
Fix the case if the title of a document is too long
  • Loading branch information
daryaromanchuk authored Sep 1, 2023
2 parents 302486c + e939c40 commit a7abff0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/main/resources/assets/css/verapdf.css
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,11 @@ table {

.error-form-data {
color: red;
}

#configure-validator-header, #result-details {
overflow-wrap: anywhere;
color: #707070;
font-style: italic;
font-size: 0.95em;
}
9 changes: 4 additions & 5 deletions src/main/resources/assets/js/verapdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $(document).on('change', '.btn-file :file', function () {
}
}
$('a[href="#validate"]').attr("disabled","disabled");
$('#configure-validator-header').text(`Configure Validator for ${$('#fileInput')[0].files[0].name}`);
$('#configure-validator-header').text($('#fileInput')[0].files[0].name);
reader.readAsBinaryString(file)
})

Expand Down Expand Up @@ -151,17 +151,16 @@ function changeOutputFormat (newFormat) {

function callVeraPdfService () {
var formData = new FormData($('form')[0])

$('#results').empty()
$.when($('#results').empty()).then(addFileConfigurationToResult());
var spinHtml = $('#spinner-template').html()
$('#results').html(spinHtml)
pdfaValidator.validate(formData, flavour, function () {
$.when(renderResult()).then(addFileConfigurationToResult()).then((showDownloadBtn()));
$.when(renderResult()).then(showDownloadBtn());
}, outputFormat)
}

function addFileConfigurationToResult () {
$("#result-details").text(`Validation results for ${$('#fileInput')[0].files[0].name} are shown below.`);
$("#result-details").text($('#fileInput')[0].files[0].name);
}

function showDownloadBtn () {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/org/verapdf/rest/views/restclient.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<div class="row setup-content" id="configure">
<div class="col-xs-12">
<div class="col-md-12">
<h3 id="configure-validator-header">Configure Validator</h3>
<h3>Configure Validator for <span id="configure-validator-header"/></h3>
<div class="form-group">
<label class="control-label">Validation Profile:</label>
<select id="flavour" class="form-control" onchange="changeFlavour(this.value)">
Expand Down Expand Up @@ -113,7 +113,7 @@
<div class="col-md-12">
<div class="list-group voffset2">
<h2 class="list-group-item-heading">Validation Results</h2>
<p id="result-details" class="list-group-item-text">Validation results are shown below.</p>
<p class="list-group-item-text">Validation results for <span id="result-details"></span> are shown below.</p>
<div id="results"></div>
<button id="download-results-btn" class="btn btn-primary btn-lg pull-right" type="button" onclick = "downloadResult()">Download</button>
</div>
Expand Down

0 comments on commit a7abff0

Please sign in to comment.