feat(regions): public region list and touch-friendly maps
ci / lint (push) Skipped
ci / test (push) Skipped
ci / build (push) Skipped
ci / image (push) Skipped
ci / lint (pull_request) Successful in 11m21s
ci / test (pull_request) Successful in 13m31s
ci / build (pull_request) Successful in 18m20s
ci / image (pull_request) Successful in 5m47s

GET /api/v1/public/regions lists the platform regions with their
location and whether a checker is online, without authentication and to
any origin, for the website's front page. Each instance answers from
memory for 30 seconds; organizations' own regions are never listed.

On touch screens one finger scrolls the page and two move the map, the
pins are larger, and a tap no longer leaves rows highlighted. The
gesture hints are translated, and the regions table drops the key and
owner columns on phones so the location fits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
This commit is contained in:
Sebastian UnterschützandClaude Opus 5.5 committed 2026-11-28 20:48:30 +01:00
1 parent 6c246b145f
commit 23717afec9
14 files changed
+273 -74

No files matched your search

+6
View File
@@ -158,6 +158,12 @@
transform: scale(1.1);
box-shadow: 0 2px 8px rgb(0 0 0 / 0.35);
}
@media (pointer: coarse) {
.region-pin {
padding: 6px 11px 6px 8px;
font-size: 12px;
}
}
.region-pin:focus-visible { outline: 2px solid var(--color-maintenance); outline-offset: 2px; }
.region-pick {
width: 14px;
+21 -4
View File
@@ -648,8 +648,24 @@ for (const el of document.querySelectorAll("input[data-tz-default]")) {
let map;
try {
// Scrolling the page must not zoom the map; the buttons, a double
// click and pinching do.
map = new gl.Map({ container: box, style: mapStyle(server), center: [10.45, 51.17], zoom: 3, scrollZoom: false, attributionControl: { compact: true } });
// click and pinching do. On touch screens one finger scrolls the page
// and two move the map.
const touch = window.matchMedia?.("(pointer: coarse)").matches ?? false;
map = new gl.Map({
container: box,
style: mapStyle(server),
center: [10.45, 51.17],
zoom: 3,
// With cooperative gestures, scrolling zooms only with Ctrl or ⌘.
scrollZoom: touch,
cooperativeGestures: touch,
locale: {
"CooperativeGesturesHandler.MobileHelpText": box.dataset.touchHint,
"CooperativeGesturesHandler.WindowsHelpText": box.dataset.scrollHint.replace("{key}", box.dataset.ctrlKey),
"CooperativeGesturesHandler.MacHelpText": box.dataset.scrollHint.replace("{key}", "⌘"),
},
attributionControl: { compact: true },
});
} catch {
box.hidden = true;
return;
@@ -696,9 +712,10 @@ for (const el of document.querySelectorAll("input[data-tz-default]")) {
holder.classList.toggle("is-hover", on);
row.classList.toggle("is-hover", on);
};
// Mouse only: a tap would leave the highlight behind.
for (const el of [pin, row]) {
el.addEventListener("mouseenter", () => hover(true));
el.addEventListener("mouseleave", () => hover(false));
el.addEventListener("pointerenter", (ev) => ev.pointerType === "mouse" && hover(true));
el.addEventListener("pointerleave", () => hover(false));
}
if (selecting) {
// The checkbox stays the source of truth; its change event keeps
+4 -1
View File
@@ -33,8 +33,11 @@ templ regionMap(mode, items string) {
data-region-map={ mode }
data-region-items={ items }
data-map-server={ MapServer }
data-touch-hint={ i18n.T(ctx, "regions.map_touch_hint") }
data-scroll-hint={ i18n.T(ctx, "regions.map_scroll_hint", "Key", "{key}") }
data-ctrl-key={ i18n.T(ctx, "regions.map_ctrl_key") }
hidden
class="region-map mb-3 h-72 w-full overflow-hidden border border-rule"
class="region-map mb-3 h-60 w-full overflow-hidden border border-rule sm:h-72"
></div>
}
+92 -53
View File
@@ -93,7 +93,46 @@ func regionMap(mode, items string) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" hidden class=\"region-map mb-3 h-72 w-full overflow-hidden border border-rule\"></div>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" data-touch-hint=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "regions.map_touch_hint")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 36, Col: 57}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\" data-scroll-hint=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "regions.map_scroll_hint", "Key", "{key}")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 37, Col: 75}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\" data-ctrl-key=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(i18n.T(ctx, "regions.map_ctrl_key")).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 38, Col: 53}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\" hidden class=\"region-map mb-3 h-60 w-full overflow-hidden border border-rule sm:h-72\"></div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -120,7 +159,7 @@ func locationFields(lat, lon *float64) templ.Component {
}
ctx = templ.InitializeContext(ctx)
ctx = templ.ClearChildren(ctx)
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<div class=\"flex flex-wrap gap-3\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<div class=\"flex flex-wrap gap-3\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -130,90 +169,90 @@ func locationFields(lat, lon *float64) templ.Component {
{i18n.T(ctx, "regions.latitude"), "latitude", coord(lat), "-90", "90"},
{i18n.T(ctx, "regions.longitude"), "longitude", coord(lon), "-180", "180"},
} {
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<label class=\"mb-4 block\"><span class=\"mb-1 block text-xs font-medium uppercase tracking-wider text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(f.label)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 52, Col: 94}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</span> <input type=\"number\" step=\"any\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 56, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var7)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "\" data-number data-nullable data-location-field=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 59, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var8)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\" value=\"")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "<label class=\"mb-4 block\"><span class=\"mb-1 block text-xs font-medium uppercase tracking-wider text-muted\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.value).Resolve(ctx)
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(f.label)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 60, Col: 20}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 55, Col: 94}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\" min=\"")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "</span> <input type=\"number\" step=\"any\" name=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.min).Resolve(ctx)
templ_7745c5c3_Var10, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 61, Col: 16}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 59, Col: 18}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\" max=\"")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\" data-number data-nullable data-location-field=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.max).Resolve(ctx)
templ_7745c5c3_Var11, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.name).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 62, Col: 16}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 62, Col: 33}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var11)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\" class=\"w-36 border border-rule bg-transparent px-2.5 py-1.5 font-mono text-sm outline-none focus:border-ink\"></label>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "\" value=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var12 string
templ_7745c5c3_Var12, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.value).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 63, Col: 20}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var12)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\" min=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.min).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 64, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var13)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\" max=\"")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var14 string
templ_7745c5c3_Var14, templ_7745c5c3_Err = templruntime.NewAttributeExpression(f.max).Resolve(ctx)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regionmap.templ`, Line: 65, Col: 16}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var14)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\" class=\"w-36 border border-rule bg-transparent px-2.5 py-1.5 font-mono text-sm outline-none focus:border-ink\"></label>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "</div>")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "</div>")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+4 -4
View File
@@ -79,8 +79,8 @@ templ regionsBody(v RegionsView) {
<thead class="border-b border-rule text-xs uppercase tracking-wider text-muted">
<tr>
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "sso.field.name") }</th>
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "regions.key") }</th>
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "regions.owner") }</th>
<th class="hidden py-2 pr-4 font-medium sm:table-cell">{ i18n.T(ctx, "regions.key") }</th>
<th class="hidden py-2 pr-4 font-medium sm:table-cell">{ i18n.T(ctx, "regions.owner") }</th>
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "regions.instances") }</th>
<th class="py-2 pr-4 font-medium">{ i18n.T(ctx, "regions.location") }</th>
<th class="py-2"></th>
@@ -97,8 +97,8 @@ templ regionsBody(v RegionsView) {
data-live={ strconv.FormatInt(r.Instances, 10) }
>
<td class="py-2.5 pr-4">{ r.Name }</td>
<td class="py-2.5 pr-4 font-mono text-xs">{ r.Key }</td>
<td class="py-2.5 pr-4">
<td class="hidden py-2.5 pr-4 font-mono text-xs sm:table-cell">{ r.Key }</td>
<td class="hidden py-2.5 pr-4 sm:table-cell">
if r.Platform {
<span class="text-muted">{ i18n.T(ctx, "regions.platform") }</span>
} else {
+7 -7
View File
@@ -137,27 +137,27 @@ func regionsBody(v RegionsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</th><th class=\"py-2 pr-4 font-medium\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</th><th class=\"hidden py-2 pr-4 font-medium sm:table-cell\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "regions.key"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regions.templ`, Line: 82, Col: 68}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regions.templ`, Line: 82, Col: 89}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</th><th class=\"py-2 pr-4 font-medium\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "</th><th class=\"hidden py-2 pr-4 font-medium sm:table-cell\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(i18n.T(ctx, "regions.owner"))
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regions.templ`, Line: 83, Col: 70}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regions.templ`, Line: 83, Col: 91}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil {
@@ -269,20 +269,20 @@ func regionsBody(v RegionsView) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</td><td class=\"py-2.5 pr-4 font-mono text-xs\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "</td><td class=\"hidden py-2.5 pr-4 font-mono text-xs sm:table-cell\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(r.Key)
if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regions.templ`, Line: 100, Col: 56}
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/web/regions.templ`, Line: 100, Col: 77}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</td><td class=\"py-2.5 pr-4\">")
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "</td><td class=\"hidden py-2.5 pr-4 sm:table-cell\">")
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
+6 -4
View File
@@ -1,13 +1,13 @@
<!doctype html><html><body data-msg-network="net">
<form id="monitor">
<div id="select-map" data-region-map="select" data-region-items="#monitor-regions" data-map-server="stub" hidden style="width:300px;height:200px"></div>
<div id="select-map" data-region-map="select" data-region-items="#monitor-regions" data-map-server="stub" data-touch-hint="t" data-scroll-hint="{key} s" data-ctrl-key="Ctrl" hidden style="width:300px;height:200px"></div>
<div id="monitor-regions">
<label><input type="checkbox" name="regions" value="r1" data-multi checked data-lat="50.11" data-lon="8.68" data-name="Frankfurt" data-live="2"></label>
<label><input type="checkbox" name="regions" value="r2" data-multi data-lat="40.71" data-lon="-74.0" data-name="New York" data-live="0"></label>
<label><input type="checkbox" name="regions" value="r3" data-multi data-name="Office" data-live="1"></label>
</div>
</form>
<div id="edit-map" data-region-map="edit" data-region-items="#region-list" data-map-server="stub" hidden style="width:300px;height:200px"></div>
<div id="edit-map" data-region-map="edit" data-region-items="#region-list" data-map-server="stub" data-touch-hint="t" data-scroll-hint="{key} s" data-ctrl-key="Ctrl" hidden style="width:300px;height:200px"></div>
<table><tbody id="region-list">
<tr data-lat="50.11" data-lon="8.68" data-name="Frankfurt" data-live="2"><td><button type="button" id="toggle" data-location-toggle="location-r1">set</button></td></tr>
<tr id="location-r1" hidden><td><form data-api="/org/regions/r1" data-method="patch" data-next="#saved" data-location-form id="row-form">
@@ -71,9 +71,11 @@ window.maplibregl = {
check("marker click ticks checkbox", box("r2").checked, true);
check("marker follows", markers()[1].classList.contains("is-checked"), true);
check("row follows", box("r2").closest("label").classList.contains("is-checked"), true);
markers()[0].dispatchEvent(new Event("mouseenter"));
markers()[0].dispatchEvent(new PointerEvent("pointerenter", { pointerType: "touch" }));
check("a tap leaves no highlight", box("r1").closest("label").classList.contains("is-hover"), false);
markers()[0].dispatchEvent(new PointerEvent("pointerenter", { pointerType: "mouse" }));
check("hovering a marker lights its row", box("r1").closest("label").classList.contains("is-hover"), true);
box("r2").closest("label").dispatchEvent(new Event("mouseenter"));
box("r2").closest("label").dispatchEvent(new PointerEvent("pointerenter", { pointerType: "mouse" }));
check("hovering a row lights its marker", markers()[1].parentElement.classList.contains("is-hover"), true);
box("r1").click();
check("checkbox untick clears marker", markers()[0].classList.contains("is-checked"), false);
+1 -1
View File
@@ -1,5 +1,5 @@
<!doctype html><html><body data-msg-network="net">
<div id="map" data-region-map="select" data-region-items="#items" data-map-server="./missing" hidden></div>
<div id="map" data-region-map="select" data-region-items="#items" data-map-server="./missing" data-touch-hint="t" data-scroll-hint="{key} s" data-ctrl-key="Ctrl" hidden></div>
<div id="items"><input type="checkbox" data-lat="1" data-lon="2" data-name="x" data-live="1"></div>
<pre id="out"></pre>
<script>