← Commit history

Fix notify buttons ({label} not {text}) + full window-array capture + top-3 + selected-machine shot + embed docs

John Lauer ·024ff2e83f ·2mo ago ·parent 535a695
1 file changed +4−2
web-control-demo.html+4−2
@@ -391,10 +391,12 @@ for (const w of mine) {   cNotify.btn.onclick = function () {     notifyId = "webdemo-" + (Math.floor(Math.random() * 1e9));     setRes(cNotify.res, "pending", "asking permission...", "approve the toast");-    postVerb("notify_user", { title: "Hello from a web page", body: "Sticky toast. Click a button on it (or ignore it), then hit 'Check toast state'.", scenario: "reminder", id: notifyId, buttons: [{ text: "Got it", id: "ack" }, { text: "Dismiss", id: "dismiss" }] }, chosenTarget()).then(function (res) {+    postVerb("notify_user", { title: "Hello from a web page", body: "Sticky toast. Click Got it or Dismiss, then Check toast state.", scenario: "reminder", id: notifyId, buttons: [{ label: "Got it" }, { label: "Dismiss" }] }, chosenTarget()).then(function (res) {+      var act = res.j && res.j.action;+      if (res.s === 200 && act && String(act).toLowerCase().indexOf("error") === 0) { setRes(cNotify.res, "err", "notify rejected", String(act).slice(0, 140)); return; }       if (res.s === 200) {         if (res.j.id) notifyId = res.j.id;-        setRes(cNotify.res, "ok", "Toast shown (id " + notifyId + ")", "click a button on it, then Check toast state");+        setRes(cNotify.res, "ok", "Toast shown (id " + notifyId + ")", "click Got it / Dismiss on it, then Check toast state");         if (!cNotify.card.querySelector("button.chk")) {           var cb = document.createElement("button"); cb.className = "chk"; cb.textContent = "Check toast state";           cb.style.cssText = "margin-top:6px;background:#12181f";