diff --git a/client-src/digitize/index.js b/client-src/digitize/index.js index 0c18eae9..7a26eec5 100644 --- a/client-src/digitize/index.js +++ b/client-src/digitize/index.js @@ -11,16 +11,28 @@ filebokz(); // disable submit... setDisabled("submitBtn", true); -const consentCheckbox = document.getElementById("consent"); - // ...until files are added const fileElement = document.querySelector(".filebokz"); +const errorMessageElement = document.querySelector(".warning-msg"); + fileElement.addEventListener("file-added", () => { setDisabled("submitBtn", false); + const fileCount = +document.querySelector(".file-count").textContent; + if (fileCount > 20) { + errorMessageElement.textContent = "Warning: Uploading more than 20 files at once can lead to errors!"; + errorMessageElement.style.display = "block"; + } else { + setDisabled("submitBtn", false); + errorMessageElement.style.display = "none"; + } }); // disable it again when all files are removed fileElement.addEventListener("file-removed", (e) => { + const fileCount = +document.querySelector(".file-count").textContent; + if (fileCount <= 20) { + errorMessageElement.style.display = "none"; + } if (!e.target.classList.contains("has-files")) { setDisabled("submitBtn", true); } diff --git a/sketch_map_tool/templates/digitize.html b/sketch_map_tool/templates/digitize.html index ea7e1238..eca6006d 100644 --- a/sketch_map_tool/templates/digitize.html +++ b/sketch_map_tool/templates/digitize.html @@ -45,6 +45,8 @@ {{ _('Files:') }} ()    {{ _('Max total size: 500 MB') }} + +