From 634062814b1ee6a2ede6601ec1ee26dafd23e297 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 9 Nov 2026 15:56:05 +0000 Subject: [PATCH] Module pages ask in their own box, not with the browser's confirm()/prompt() Inside an AgOpenWeb web card the page's frame has no allow-modals (official Docs/ADD_ON_CARDS.md): confirm() returns false and prompt() null without showing anything, so Save and restart, Install, Restart, the TM171 and receiver actions and the settings defaults did nothing there. The Teensy, XIAO, sprayer and seed drill pages now ask with an in-page box (ask / askText) and their handlers await the answer; the wording is unchanged. Sprayer 0.10.5 and seed drill 0.2.6 with their .bin rebuilt, the XIAO C3 / S3 .bin rebuilt (esp32 core 3.3.12); the Teensy .hex is left to the IDE. The simulator check fails on any browser dialog and opens the sprayer and Teensy pages inside a frame with the card's sandbox, where the box must open, fit 480 x 320 and answer. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01VKEBDGEvHbKp3vpaXLUKir --- Firmware/simulator/README.md | 4 +- Firmware/simulator/smoke-test.js | 112 ++++++++++++++++-- Firmware/v4.5_AiO_WEB/README.md | 3 + .../v4.5_AiO_WEB/v4.5_XIAO_ESP32/README.md | 2 + Firmware/v4.5_AiO_WEB/v4.5_XIAO_ESP32/xPage.h | 45 +++++-- .../v4.5_XIAO_ESP32_bin/README.md | 2 +- .../v4.5_XIAO_ESP32_bin/v4.5_XIAO_ESP32C3.bin | Bin 1146048 -> 1151088 bytes .../v4.5_XIAO_ESP32C3_USB.bin | Bin 1211584 -> 1216624 bytes .../v4.5_XIAO_ESP32_bin/v4.5_XIAO_ESP32S3.bin | Bin 1032784 -> 1037296 bytes .../v4.5_XIAO_ESP32S3_USB.bin | Bin 1098320 -> 1102832 bytes Firmware/v4.5_AiO_WEB/zWebPage.h | 79 +++++++----- Seeder/Seeder_ESP32/README.md | 10 +- Seeder/Seeder_ESP32/Seeder_ESP32.ino | 4 +- Seeder/Seeder_ESP32/Seeder_ESP32.ino.bin | Bin 1114368 -> 1117312 bytes .../Seeder_ESP32/Seeder_ESP32.ino.merged.bin | Bin 4194304 -> 4194304 bytes Seeder/Seeder_ESP32/dPage.h | 41 +++++-- Sprayer/Sprayer_ESP32/README.md | 8 +- Sprayer/Sprayer_ESP32/Sprayer_ESP32.ino | 4 +- Sprayer/Sprayer_ESP32/Sprayer_ESP32.ino.bin | Bin 1069280 -> 1071728 bytes .../Sprayer_ESP32.ino.merged.bin | Bin 4194304 -> 4194304 bytes Sprayer/Sprayer_ESP32/sPage.h | 41 +++++-- 21 files changed, 282 insertions(+), 73 deletions(-) diff --git a/Firmware/simulator/README.md b/Firmware/simulator/README.md index 4c7991f..7ed6c18 100644 --- a/Firmware/simulator/README.md +++ b/Firmware/simulator/README.md @@ -29,7 +29,7 @@ One row per day, in short; the details are in the sections of this file (the lin | Date | What changed | |---|---| -| 9 Nov 2026 | **Set up AgOpenWeb from your measures** 1.3: the turn clears the front corner, the drawbar meets the tyre, turns by headland, reasons ([the page](#set-up-agopenweb-from-your-measures)). Seed drill page: 19 sections offline. Shorter start page and strip notes. [Action](#how-it-is-built) on Node 24. | +| 9 Nov 2026 | **Set up AgOpenWeb from your measures** 1.3: front corner, drawbar at the tyre, turns by headland, reasons ([the page](#set-up-agopenweb-from-your-measures)). Seed drill: 19 sections offline; short start page. [Action](#how-it-is-built) on Node 24. Check: pages in a web card's frame ([How it is built](#how-it-is-built)). | | 8 Nov 2026 | **Set up AgOpenWeb from your measures**: a calculator that turns the tractor and implement measures into the U-turn, headland and tramline settings, with the reasons, a drawing, examples and drawbars kept off the rear tyres ([the page](#set-up-agopenweb-from-your-measures)). | | 7 Nov 2026 | The seed drill page's four tabs and Firmware tab checked, with a made-up newer `.bin` "on GitHub"; `firmware.json` lists the seed drill `.bin` once it is on `main`; the modules' names on the network ([How it is built](#how-it-is-built)). | | 4 Nov 2026 | The Teensy's clock and temperature, the receivers' and the TM171's temperatures and the XIAO's in the pretend modules' answers. | @@ -55,7 +55,7 @@ One row per day, in short; the details are in the sections of this file (the lin | `sim-xiao.js` | the XIAO page's requests (v4.5_XIAO_ESP32.ino) answered by a pretend XIAO, with the module behind it | | `sim-seeder.js` | the seed drill module page's requests (Seeder_ESP32 zNet.ino) answered by a pretend Relay24_ESP32, sowing what the tractor sows | | `sim-sprayer.js` | the sprayer module page's requests (Sprayer_ESP32 zNet.ino) answered by a pretend ESP32, spraying what the tractor sprays | -| `smoke-test.js` | the check: `node Firmware/simulator/smoke-test.js _site [screenshots]` (needs the `playwright` package) | +| `smoke-test.js` | the check: `node Firmware/simulator/smoke-test.js _site [screenshots]` (needs the `playwright` package). It also opens the sprayer and Teensy pages inside a frame with the sandbox of an AgOpenWeb web card (`/Boards/_card`, served by the check only), where the browser's own pop-ups show nothing: the pages' own question box must open, fit 480 × 320 and answer; a browser pop-up on any page fails the check | To run it on your own computer: `python3 Firmware/simulator/build.py` and open `_site/index.html` in a browser (a `file://` page works). The check needs Node and `npm install playwright && npx playwright install chromium`. diff --git a/Firmware/simulator/smoke-test.js b/Firmware/simulator/smoke-test.js index 33bd067..73c8e2c 100644 --- a/Firmware/simulator/smoke-test.js +++ b/Firmware/simulator/smoke-test.js @@ -11,19 +11,30 @@ // page and the seed drill and sprayer modules' pages, waits for the pretend module, clicks every tab and fails on // a script error in the page or a tab that shows nothing. GitHub itself is not asked: the version check gets the // site's firmware.json (or a copy with a newer build in it) instead of https://renatorgr.github.io/Boards/firmware.json. Also installs the firmware's own .hex on a parked module, end to end, saves the first section the -// seed drill's relays follow and the sprayer's calibration (their password prompt is answered). +// seed drill's relays follow and the sprayer's calibration (the pages' own password question is answered). Also opens the sprayer +// and Teensy pages inside a frame with the sandbox of an AgOpenWeb web card, where the browser's confirm() and prompt() do +// nothing: the pages' own question box must show there, fit the card and answer. A browser dialog on any page fails the check. "use strict"; const fs = require("fs"), path = require("path"), http = require("http"); const {chromium} = require("playwright"); const site = path.resolve(process.argv[2] || "_site"), shots = process.argv[3] ? path.resolve(process.argv[3]) : ""; const TYPES = {".html": "text/html; charset=utf-8", ".js": "text/javascript", ".css": "text/css"}; const fail = []; +// an AgOpenWeb web card's frame (AgOpenWeb Docs/ADD_ON_CARDS.md): no allow-modals, so alert / confirm / prompt show nothing in it +const CARD_SANDBOX = "allow-scripts allow-same-origin allow-forms allow-popups allow-downloads"; // the whole check takes about two minutes; a browser that hangs must not hold the Action for hours const watchdog = setTimeout(() => { console.log("FAILED: the check did not finish in 6 minutes"); process.exit(1); }, 6 * 60 * 1000); const server = http.createServer((q, r) => { const u = decodeURIComponent(q.url.split("?")[0]); if (!u.startsWith("/Boards/")) { r.writeHead(404); r.end(); return; } + if (u === "/Boards/_card") { // the check only: a pretend AgOpenWeb web card around a page of the site (?src=/Boards/...), served from + // the same address as the page because Chromium refuses a loopback page inside a frame of a page from nowhere (about:blank) + const src = (new URL(q.url, "http://127.0.0.1").searchParams.get("src") || "").replace(/"/g, """); + r.writeHead(200, {"Content-Type": "text/html; charset=utf-8"}); + r.end(''); + return; + } let f = path.join(site, u.slice("/Boards/".length)); if (!f.startsWith(site)) { r.writeHead(403); r.end(); return; } if (fs.existsSync(f) && fs.statSync(f).isDirectory()) f = path.join(f, "index.html"); @@ -40,6 +51,9 @@ async function page(browser, url, what, newer) { const pg = await browser.newPage({viewport: {width: 1000, height: 1100}}); pg.on("pageerror", e => fail.push(what + ": " + e)); pg.on("console", m => { if (m.type() === "error" && !/Failed to load resource|net::ERR/.test(m.text())) fail.push(what + ": console " + m.text()); }); + // inside an AgOpenWeb web card the browser's alert / confirm / prompt show nothing (the frame has no allow-modals): the pages ask + // with their own question box (#ask) instead, so a browser dialog is a fault + pg.on("dialog", d => { fail.push(what + ": the browser's own dialog opened («" + d.message() + "»); it would show nothing in a web card"); d.dismiss(); }); await pg.route(/^https:\/\/(api\.github\.com|github\.com|raw\.githubusercontent\.com)\//, r => r.abort()); await pg.route("https://renatorgr.github.io/Boards/firmware.json", r => r.fulfill({status: 200, contentType: "application/json", headers: {"Access-Control-Allow-Origin": "*"}, body: published(newer)})); @@ -59,6 +73,48 @@ async function expectSoon(pg, what, sel, re, ms = 5000) { } catch (e) { /* reported by expect() below */ } await expect(pg, what, sel, re); } +// the pages' own question box (ask / askText in the pages) answered with OK as soon as it opens, as a person would; `text` is typed +// into its field first (the module's password, when it asks for one). Stays on after the page reloads itself (a restart) +async function answerAsk(pg, text) { + const js = "(()=>{if(window.__askAuto)return;window.__askAuto=1;" + + "const go=()=>{const a=document.getElementById('ask');if(!a||a.hidden)return;const i=document.getElementById('askIn');" + + "if(i&&!i.hidden)i.value=" + JSON.stringify(text || "") + ";document.getElementById('askYes').click();};" + + "const start=()=>{const a=document.getElementById('ask');if(!a)return;new MutationObserver(go).observe(a,{attributes:true,attributeFilter:['hidden']});go();};" + + "document.readyState==='loading'?document.addEventListener('DOMContentLoaded',start):start();})()"; + await pg.addInitScript(js); + await pg.evaluate(js); +} +// a page of the site inside an AgOpenWeb web card: the server's /Boards/_card, an iframe with the card's sandbox at the smallest +// card size, 480 x 320. There the browser's confirm() and prompt() return false / null without showing anything, which the check +// first makes sure of (otherwise the frame is not testing what a card does). Gives the page and its frame (null: not loaded) +async function card(browser, port, src, what) { + const pg = await page(browser, "http://127.0.0.1:" + port + "/Boards/_card?src=" + encodeURIComponent(src), what); + pg.removeAllListeners("dialog"); pg.removeAllListeners("console"); + let native = 0, probing = true; // the check's own confirm() and prompt() below: Chromium logs "Ignored call to 'confirm()'" for them + pg.on("dialog", d => { native++; d.dismiss(); }); + pg.on("console", m => { if (m.type() === "error" && !/Failed to load resource|net::ERR/.test(m.text()) && !(probing && /Ignored call to '(confirm|prompt)\(\)'/.test(m.text()))) fail.push(what + ": console " + m.text()); }); + await pg.waitForTimeout(2500); + const base = "http://127.0.0.1:" + port + src.split("#")[0], fr = pg.frames().find(f => f.url().startsWith(base)); + if (!fr) { fail.push(what + ": the page did not load inside the frame"); return [pg, null]; } + const r = await fr.evaluate(() => [window.confirm("test"), window.prompt("test")]); + if (native || r[0] !== false || r[1] !== null) fail.push(what + ": the frame does not behave as a web card (confirm " + r[0] + ", prompt " + r[1] + ", dialogs " + native + ")"); + await pg.waitForTimeout(300); probing = false; + return [pg, fr]; +} +// the question box open in the card: its text, whether it asks to type something, inside the 480 x 320, the OK button 44 px high +async function askShown(fr, what, re, withInput) { + await fr.waitForTimeout(200); + if (!(await fr.locator("#ask").isVisible())) { fail.push(what + ": the question box did not open"); return; } + await expect(fr, what, "#askText", re); + if ((await fr.locator("#askIn").isVisible()) !== withInput) fail.push(what + ": the question " + (withInput ? "has no field to type in" : "should not ask to type anything")); + const b = await fr.locator(".askBox").boundingBox(), y = await fr.locator("#askYes").boundingBox(); + if (!b || b.x < 0 || b.y < 0 || b.x + b.width > 480 || b.y + b.height > 320) fail.push(what + ": the question box does not fit the card (" + JSON.stringify(b) + ")"); + if (!y || y.height < 44) fail.push(what + ": the OK button is under 44 px high (" + (y && y.height) + ")"); +} +async function askClosed(fr, what, how) { + await fr.waitForTimeout(200); + if (await fr.locator("#ask").isVisible()) fail.push(what + ": " + how + " does not close the question"); +} async function teensy(browser, port, q, name) { const what = "Teensy page " + (q || "(defaults)"); @@ -206,7 +262,7 @@ async function teensy(browser, port, q, name) { await pg.click('nav button[data-t="settings"]'); await pg.waitForTimeout(500); await pg.click("#fs button[type=submit]"); await pg.waitForTimeout(800); await expect(pg, what, "#setMsg", /Saved/); - pg.on("dialog", d => d.accept()); + await answerAsk(pg); await pg.click('nav button[data-t="imu"]'); await pg.waitForTimeout(300); await pg.click("#tmCalBtn"); await pg.waitForTimeout(2500); await expect(pg, what, "#tmCal2", /in progress|starting/); @@ -265,7 +321,7 @@ async function teensy(browser, port, q, name) { if (hex) { const what = "XIAO page, module firmware over the link"; const pg = await page(browser, "http://127.0.0.1:" + port + "/Boards/xiao/?park=1", what); - pg.on("dialog", d => d.accept()); + await answerAsk(pg); await pg.waitForTimeout(2500); await pg.click('nav button[data-t="prog"]'); await pg.waitForTimeout(800); await expect(pg, what, "#tFw", /_AiO_WEB/); @@ -307,7 +363,7 @@ async function teensy(browser, port, q, name) { { const what = "Seed drill page"; const pg = await page(browser, "http://127.0.0.1:" + port + "/Boards/seeder/", what); - pg.on("dialog", d => d.accept("agopengps")); + await answerAsk(pg, "agopengps"); await pg.waitForTimeout(2500); await expect(pg, what, "h1", /^Seeder module$/); await expect(pg, what, "#sub", /^on the cable as 192\.168\.5\.123 · program talking/); @@ -400,7 +456,7 @@ async function teensy(browser, port, q, name) { await pg.route("https://api.github.com/repos/renatorgr/Boards/contents/Seeder/Seeder_ESP32?ref=main", r => r.fulfill({status: 200, contentType: "application/json", headers: cors, body: JSON.stringify([{type: "file", name: "Seeder_ESP32.ino.bin", size: bin.length, download_url: raw}])})); await pg.route(raw, r => r.fulfill({status: 200, contentType: "application/octet-stream", headers: cors, body: bin})); - pg.on("dialog", d => d.accept("agopengps")); + await answerAsk(pg, "agopengps"); await pg.waitForTimeout(2500); if (!(await pg.locator("#t-firmware").isVisible())) fail.push(what + ": #firmware in the address does not open the Firmware tab"); await expect(pg, what, "#ghVer", /built 31 Dec 2099 23:59 — newer than the installed one$/); @@ -424,7 +480,7 @@ async function teensy(browser, port, q, name) { { const what = "Sprayer page"; const pg = await page(browser, "http://127.0.0.1:" + port + "/Boards/sprayer/", what); - pg.on("dialog", d => d.accept("agopengps")); + await answerAsk(pg, "agopengps"); await pg.waitForTimeout(2500); await expect(pg, what, "h1", /^Sprayer module$/); await expect(pg, what, "#sub", /^on Farm WiFi as 192\.168\.5\.123 · program talking/); @@ -526,7 +582,7 @@ async function teensy(browser, port, q, name) { await pg.route("https://api.github.com/repos/renatorgr/Boards/contents/Sprayer/Sprayer_ESP32?ref=main", r => r.fulfill({status: 200, contentType: "application/json", headers: cors, body: JSON.stringify([{type: "file", name: "Sprayer_ESP32.ino.bin", size: bin.length, download_url: raw}])})); await pg.route(raw, r => r.fulfill({status: 200, contentType: "application/octet-stream", headers: cors, body: bin})); - pg.on("dialog", d => d.accept("agopengps")); + await answerAsk(pg, "agopengps"); await pg.waitForTimeout(2500); if (!(await pg.locator("#t-firmware").isVisible())) fail.push(what + ": #firmware in the address does not open the Firmware tab"); await expect(pg, what, "#ghVer", /built 31 Dec 2099 23:59 — newer than the installed one$/); @@ -543,6 +599,48 @@ async function teensy(browser, port, q, name) { await shot(pg, "sprayer-firmware-updated"); await pg.close(); } + // the sprayer page inside a web card: Save and restart (Module tab) asks yes / no (Escape is a no), Restart (Firmware tab) asks + // the password in the box (Cancel does nothing, Enter after the password restarts the module) + { + const what = "Sprayer page in a web card"; + const [pg, fr] = await card(browser, port, "/Boards/sprayer/#module", what); + if (fr) { + if (!(await fr.locator("#t-module").isVisible())) fail.push(what + ": #module in the address does not open the Module tab"); + await fr.fill("#pwW", "agopengps"); + await fr.click("button:has-text('Save and restart the module')"); + await askShown(fr, what, /^Save and restart the module\? Its Wi-Fi goes off/, false); + await shot(pg, "sprayer-card-ask"); + await fr.locator("#askYes").press("Escape"); await askClosed(fr, what, "Escape"); + await expect(fr, what, "#msgWifi", /^$/); + await fr.click('nav button[data-t="firmware"]'); await fr.waitForTimeout(300); + await fr.click("button[onclick*='/api/restart']"); + await askShown(fr, what, /^Password of the own Wi-Fi network$/, true); + await shot(pg, "sprayer-card-password"); + await fr.click("#askNo"); await askClosed(fr, what, "Cancel"); + await expect(fr, what, "#msgProg", /^$/); + await fr.click("button[onclick*='/api/restart']"); + await fr.fill("#askIn", "agopengps"); await fr.locator("#askIn").press("Enter"); await askClosed(fr, what, "Enter"); + await expectSoon(fr, what, "#msgProg", /^done, restarting/); + } + await pg.close(); + } + // the Teensy page inside a web card: Restart Teensy asks yes / no + { + const what = "Teensy page in a web card"; + const [pg, fr] = await card(browser, port, "/Boards/teensy/?park=1", what); + if (fr) { + await fr.click('nav button[data-t="firmware"]'); await fr.waitForTimeout(300); + await fr.click("#reboot"); + await askShown(fr, what, /^Restart the Teensy\? Autosteer and GPS stop for a few seconds\.$/, false); + await shot(pg, "teensy-card-ask"); + await fr.click("#askNo"); await askClosed(fr, what, "Cancel"); + await expect(fr, what, "#fwMsg", /^$/); + await fr.click("#reboot"); + await fr.click("#askYes"); await askClosed(fr, what, "OK"); + await expectSoon(fr, what, "#fwMsg", /^Restarting/); + } + await pg.close(); + } // the seed drill's module with the network cable unplugged: sections closed, the program's request still outlined { const what = "Seed drill page, network lost"; diff --git a/Firmware/v4.5_AiO_WEB/README.md b/Firmware/v4.5_AiO_WEB/README.md index dbecff2..eaf66fc 100644 --- a/Firmware/v4.5_AiO_WEB/README.md +++ b/Firmware/v4.5_AiO_WEB/README.md @@ -31,6 +31,7 @@ One row per day, in short; the details are in the sections of this file (the lin | Date | What changed | |---|---| +| 9 Nov 2026 | The page's questions (TM171, receiver set-up, settings, firmware, restart) in its own box: the browser's pop-ups show nothing inside an AgOpenWeb web card, so those buttons did nothing there ([Web page](#web-page)). | | 7 Nov 2026 | Add-on card (`_aowcard._tcp`) under a unique name, on the Connections card. Status cards reordered, steering settings folded into Steering; Machine tab reads the sprayer's PGN 161 (rate, alarms) ([Web page](#web-page)). Shorter notes, short headers. | | 4 Nov 2026 | Built at **450 MHz** (cooler; the loop has time to spare). Temperatures on the cards: the Teensy with its clock ([Firmware tab](#web-page)), the u-blox [receivers](#identification), the [TM171](#imu-tm171-or-bno085) and the [XIAO](#xiao-esp32c3--esp32s3). | | 3 Nov 2026 | [Steering loop at 100 Hz](#settings) as a choice. [IMU frozen](#imu-tm171-or-bno085) warning. [Notes about this installation](#settings). [Main loop](#main-loop) fixes: GNSS data lost on the two-F9P board, page loads held the steering. [Dual F9P](#dual-f9p-second-f9p-on-the-gps2-port) says why there is no heading. Old [update marker](#firmware-update-over-the-network) gone. | @@ -73,6 +74,8 @@ Open `http:///`, normally `http://192.168.5.126/` (the third number f Dark or light: the ☀ / ☾ button at the top (remembered by the browser), otherwise the device's setting. +Every question the page asks (write to the TM171, load the receiver's settings, switch the WAS check off, install firmware, restart…) opens in a box of the page itself, not a browser pop-up: inside an AgOpenWeb web card the browser's pop-ups show nothing, so those buttons did nothing there (official `Docs/ADD_ON_CARDS.md`: the card's frame has no `allow-modals`). + **Without a module:** the [simulator](https://renatorgr.github.io/Boards/) shows this page and the XIAO's with a pretend module behind them (any GPS, IMU, steering and program; tractor driving or parked), rebuilt from the code on every change. See [`Firmware/simulator`](../simulator). | Tab | | diff --git a/Firmware/v4.5_AiO_WEB/v4.5_XIAO_ESP32/README.md b/Firmware/v4.5_AiO_WEB/v4.5_XIAO_ESP32/README.md index 7146f4a..74fdcce 100644 --- a/Firmware/v4.5_AiO_WEB/v4.5_XIAO_ESP32/README.md +++ b/Firmware/v4.5_AiO_WEB/v4.5_XIAO_ESP32/README.md @@ -23,6 +23,7 @@ Version 4.5, the same number as the Teensy firmware it goes with (v4.5_AiO_WEB). | Date | What changed | |---|---| +| 9 Nov 2026 | The page's questions (save and restart, install, the module's firmware, subnet) in its own box: the browser's pop-ups show nothing inside an AgOpenWeb web card, so those buttons did nothing there ([What it does](#what-it-does)). | | 7 Nov 2026 | Add-on card (`_aowcard._tcp`) under the XIAO's own WiFi name ([What it does](#what-it-does)). Program → module shows up to 64 sections (PGN 229); the WiFi settings save in one row; a shorter note in the Module firmware card; short file headers. | | 4 Nov 2026 | The XIAO's temperature in its card, here and on the Teensy page; the Teensy's clock and temperature in the [Module card](#what-it-does). | | 3 Nov 2026 | An [update over Wi-Fi](#update-over-wifi-from-a-file) on a weak link no longer stops after a 5 s pause (it waits up to 20 s), and an upload that is cut off is written in Messages. | @@ -61,6 +62,7 @@ Version 4.5, the same number as the Teensy firmware it goes with (v4.5_AiO_WEB). | **Firmware** | Version, the newest version on GitHub with **Install from GitHub**, **program update over WiFi** (a `.bin` file, see below), restart. One password field for all. **Module (Teensy) firmware**: the module's firmware installed from this page over the link, and its previous firmware put back (see below). **Download the report**: the XIAO's state and settings (no passwords), the module status and both message lists in one `.json` file, to send when something goes wrong. | - Changes (WiFi, update, restart) **ask for the password of the XIAO's own network**, to confirm. + - The question before each one (save and restart, install, the module's firmware, the subnet) opens in a box of the page itself, not a browser pop-up: inside an AgOpenWeb web card the browser's pop-ups show nothing, so those buttons did nothing there. - Typed once, it is filled in both tabs until the page is closed. - The page never shows or stores it. - Just viewing the page needs nothing more than being on the network. diff --git a/Firmware/v4.5_AiO_WEB/v4.5_XIAO_ESP32/xPage.h b/Firmware/v4.5_AiO_WEB/v4.5_XIAO_ESP32/xPage.h index 3d79f64..4849149 100644 --- a/Firmware/v4.5_AiO_WEB/v4.5_XIAO_ESP32/xPage.h +++ b/Firmware/v4.5_AiO_WEB/v4.5_XIAO_ESP32/xPage.h @@ -88,6 +88,15 @@ h3{font-size:14px;margin:14px 0 4px} a{color:var(--acc)} .tbtn{margin-left:auto;flex:none;border:1px solid var(--line);background:var(--soft);color:var(--ink);border-radius:999px;padding:3px 11px;font:inherit;font-size:13px;font-weight:650;cursor:pointer} @media (max-width:520px){header .sub{display:none}} +/* the page's own question box (ask / askText in the script): the browser's confirm() and prompt() show nothing inside an + AgOpenWeb web card (its frame has no allow-modals), so the page never uses them; buttons 44 px high, as the cards ask */ +.ask{position:fixed;inset:0;z-index:9;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;padding:12px} +.ask[hidden],.ask [hidden]{display:none!important} +.askBox{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:16px;width:100%;max-width:440px;max-height:100%;overflow:auto;box-shadow:0 8px 30px rgba(0,0,0,.35)} +.askBox p{margin:0 0 12px;white-space:pre-line} +.askBox input{display:block;width:100%;font:inherit;padding:9px 10px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--ink);margin:0 0 12px} +.askBtns{display:flex;gap:10px;justify-content:flex-end} +.askBtns button{min-height:44px;min-width:96px} @@ -194,9 +203,25 @@ a{color:var(--acc)} +