From 2f1ade9723eaae158731263cebc26ca4b3bb89e0 Mon Sep 17 00:00:00 2001 From: Simone Bortolin Date: Mon, 12 Dec 2022 23:08:37 +0100 Subject: Add web root script and Restore V1 Procedure (#32) * Add web root script (V3) ** Web serial, LineBreakTransformer, minimal UI ** Step 2 in fallback to avoid kernel panic ** Some new alert * Restore V1 Procedure * Minor update on V1 and V2 procedure (see #43) Co-authored-by: Ernesto Castellotti --- assets/img/web-root-procedure/sfp-sfp.jpg | Bin 0 -> 198218 bytes assets/img/web-root-procedure/ttl-sfp.jpg | Bin 0 -> 183990 bytes assets/js/modal.js | 6 ++++-- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 assets/img/web-root-procedure/sfp-sfp.jpg create mode 100644 assets/img/web-root-procedure/ttl-sfp.jpg (limited to 'assets') diff --git a/assets/img/web-root-procedure/sfp-sfp.jpg b/assets/img/web-root-procedure/sfp-sfp.jpg new file mode 100644 index 0000000..28ad636 Binary files /dev/null and b/assets/img/web-root-procedure/sfp-sfp.jpg differ diff --git a/assets/img/web-root-procedure/ttl-sfp.jpg b/assets/img/web-root-procedure/ttl-sfp.jpg new file mode 100644 index 0000000..74334e6 Binary files /dev/null and b/assets/img/web-root-procedure/ttl-sfp.jpg differ diff --git a/assets/js/modal.js b/assets/js/modal.js index 2cae945..c18d751 100644 --- a/assets/js/modal.js +++ b/assets/js/modal.js @@ -1,12 +1,12 @@ var modals = document.querySelectorAll("[data-modal]"); var modalToogles = document.querySelectorAll("[data-toogle=modal]"); - [...modals].forEach(modal => { var closeBtns = modal.getElementsByClassName("close"); [...closeBtns].forEach(closeBtn => { closeBtn.addEventListener("click", (event) => { modal.style.display = "none"; + modal.dispatchEvent( new Event('modal-close')); }); }) }); @@ -15,11 +15,13 @@ var modalToogles = document.querySelectorAll("[data-toogle=modal]"); toogle.addEventListener("click", (event) => { var modal = document.querySelector(toogle.getAttribute('data-target')); modal.style.display = "block"; + modal.dispatchEvent(new Event('modal-open')); }); }); window.addEventListener("click", function(event) { - if ([...modals].includes(event.target)) { + if ([...modals].filter(modal => modal.getAttribute("data-modal-backdrop") !== "static").includes(event.target)) { + event.target.dispatchEvent( new Event('modal-close')); event.target.style.display = "none"; } }); -- cgit v1.2.3