From 36a692e34b1738551d3ad86e9c29759bcbf6001b Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Thu, 28 Apr 2022 19:13:45 +0200 Subject: [PATCH] List of loaded pdf --- public/js/organization.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/js/organization.js b/public/js/organization.js index ff00955..5494364 100644 --- a/public/js/organization.js +++ b/public/js/organization.js @@ -23,6 +23,7 @@ var loadPDF = async function(pdfBlob, filename, pdfIndex) { type: 'application/pdf' })); document.getElementById('input_pdf').files = dataTransfer.files; + updateListePDF(); let pdfLetter = String.fromCharCode(96 + i+1).toUpperCase(); @@ -152,6 +153,14 @@ var stateCheckboxAll = function() { document.querySelector('#checkbox_all_pages').checked = (document.querySelectorAll('.checkbox-page:checked').length == document.querySelectorAll('.checkbox-page').length); }; +var updateListePDF = function() { + document.querySelector('#list_pdf').innerHTML = ""; + for (var i = 0; i < document.querySelector('#input_pdf').files.length; i++) { + const pdfFile = document.querySelector('#input_pdf').files.item(i); + document.querySelector('#list_pdf').insertAdjacentHTML('beforeend', '
  • '+decodeURI(pdfFile.name)+'
  • '); + } +} + var createEventsListener = function() { document.querySelector('#checkbox_all_pages').addEventListener('change', function() { let checkboxAll = this;