updates
Browse files- static/index.html +25 -6
- static/style.css +2 -1
static/index.html
CHANGED
@@ -385,6 +385,10 @@
|
|
385 |
const generateTerms = document.getElementById("generate-terms");
|
386 |
const generateButton = document.getElementById("generate-button");
|
387 |
|
|
|
|
|
|
|
|
|
388 |
const generateImageContainer = document.querySelector(
|
389 |
".display-generate .image-container"
|
390 |
);
|
@@ -421,6 +425,18 @@
|
|
421 |
else generateButton.classList.remove("active");
|
422 |
};
|
423 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
424 |
generateTab.addEventListener("click", (event) => {
|
425 |
event.target.classList.add("active");
|
426 |
verifyTab.classList.remove("active");
|
@@ -465,6 +481,9 @@
|
|
465 |
});
|
466 |
|
467 |
function submitForm() {
|
|
|
|
|
|
|
468 |
const file = document.getElementById("fileUpload").files[0];
|
469 |
|
470 |
let fileReader = new FileReader();
|
@@ -479,8 +498,8 @@
|
|
479 |
spinner = document.querySelector(".display-verify .spinner");
|
480 |
|
481 |
if (placeholder) placeholder.remove();
|
482 |
-
if (document.getElementById("
|
483 |
-
document.getElementById("
|
484 |
spinner.style.display = "block";
|
485 |
|
486 |
outputContainer.style.display = "none";
|
@@ -563,7 +582,7 @@
|
|
563 |
setCertificateOutputFromValidation
|
564 |
);
|
565 |
|
566 |
-
truepicDisplay.setAttribute("id", "
|
567 |
truepicDisplay.setAttribute("active", "");
|
568 |
var truepic = document.createElement("img");
|
569 |
truepic.src = path;
|
@@ -604,8 +623,8 @@
|
|
604 |
|
605 |
try {
|
606 |
if (placeholder) placeholder.remove();
|
607 |
-
if (document.getElementById("
|
608 |
-
document.getElementById("
|
609 |
|
610 |
spinner.style.display = "block";
|
611 |
|
@@ -614,7 +633,7 @@
|
|
614 |
|
615 |
var truepicDisplay = document.createElement("truepic-display");
|
616 |
|
617 |
-
truepicDisplay.setAttribute("id", "
|
618 |
truepicDisplay.setAttribute("active", "");
|
619 |
var truepic = document.createElement("img");
|
620 |
truepic.src = path;
|
|
|
385 |
const generateTerms = document.getElementById("generate-terms");
|
386 |
const generateButton = document.getElementById("generate-button");
|
387 |
|
388 |
+
const fileUpload = document.getElementById("fileUpload");
|
389 |
+
const verifyButton = document.getElementById("verify-button");
|
390 |
+
const verifyTerms = document.getElementById("verify-terms");
|
391 |
+
|
392 |
const generateImageContainer = document.querySelector(
|
393 |
".display-generate .image-container"
|
394 |
);
|
|
|
425 |
else generateButton.classList.remove("active");
|
426 |
};
|
427 |
|
428 |
+
[fileUpload, verifyTerms].forEach((item) => {
|
429 |
+
item.addEventListener("change", async (event) => {
|
430 |
+
setVerifyButtonStatus();
|
431 |
+
});
|
432 |
+
});
|
433 |
+
|
434 |
+
const setVerifyButtonStatus = () => {
|
435 |
+
if (fileUpload.value && verifyTerms.checked)
|
436 |
+
verifyButton.classList.add("active");
|
437 |
+
else verifyButton.classList.remove("active");
|
438 |
+
};
|
439 |
+
|
440 |
generateTab.addEventListener("click", (event) => {
|
441 |
event.target.classList.add("active");
|
442 |
verifyTab.classList.remove("active");
|
|
|
481 |
});
|
482 |
|
483 |
function submitForm() {
|
484 |
+
if (!fileUpload.value || !verifyTerms.checked)
|
485 |
+
return
|
486 |
+
|
487 |
const file = document.getElementById("fileUpload").files[0];
|
488 |
|
489 |
let fileReader = new FileReader();
|
|
|
498 |
spinner = document.querySelector(".display-verify .spinner");
|
499 |
|
500 |
if (placeholder) placeholder.remove();
|
501 |
+
if (document.getElementById("verifryresult"))
|
502 |
+
document.getElementById("verifryresult").remove(); // JCL make sure to remove the correct one
|
503 |
spinner.style.display = "block";
|
504 |
|
505 |
outputContainer.style.display = "none";
|
|
|
582 |
setCertificateOutputFromValidation
|
583 |
);
|
584 |
|
585 |
+
truepicDisplay.setAttribute("id", "verifryresult");
|
586 |
truepicDisplay.setAttribute("active", "");
|
587 |
var truepic = document.createElement("img");
|
588 |
truepic.src = path;
|
|
|
623 |
|
624 |
try {
|
625 |
if (placeholder) placeholder.remove();
|
626 |
+
if (document.getElementById("genresult"))
|
627 |
+
document.getElementById("genresult").remove(); // JCL make sure to remove the correct one
|
628 |
|
629 |
spinner.style.display = "block";
|
630 |
|
|
|
633 |
|
634 |
var truepicDisplay = document.createElement("truepic-display");
|
635 |
|
636 |
+
truepicDisplay.setAttribute("id", "genresult");
|
637 |
truepicDisplay.setAttribute("active", "");
|
638 |
var truepic = document.createElement("img");
|
639 |
truepic.src = path;
|
static/style.css
CHANGED
@@ -327,9 +327,10 @@ img.thumbnail {
|
|
327 |
border-radius: 0;
|
328 |
}
|
329 |
|
330 |
-
.btn-primary:hover, .btn-primary:active {
|
331 |
background-color: rgba(206, 206, 206, 1);
|
332 |
border-color: rgba(206, 206, 206, 1);
|
|
|
333 |
}
|
334 |
|
335 |
.btn-primary.active {
|
|
|
327 |
border-radius: 0;
|
328 |
}
|
329 |
|
330 |
+
.btn-primary:hover, .btn-primary:active, .btn-primary:focus {
|
331 |
background-color: rgba(206, 206, 206, 1);
|
332 |
border-color: rgba(206, 206, 206, 1);
|
333 |
+
box-shadow: none !important;
|
334 |
}
|
335 |
|
336 |
.btn-primary.active {
|