mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-09-26 14:07:58 +00:00
fix(docs): reflect preset URL in page header
This commit is contained in:
@@ -212,6 +212,48 @@
|
||||
});
|
||||
}
|
||||
|
||||
function isDefaultPreset(config) {
|
||||
return (
|
||||
config.startMs === parseTimestamp(DEFAULTS.start, "start") &&
|
||||
config.endMs === parseTimestamp(DEFAULTS.end, "end") &&
|
||||
config.freq === Number(DEFAULTS.freq) &&
|
||||
config.bw === Number(DEFAULTS.bw) &&
|
||||
config.sf === Number(DEFAULTS.sf) &&
|
||||
config.cr === Number(DEFAULTS.cr) &&
|
||||
config.tx === Number(DEFAULTS.tx)
|
||||
);
|
||||
}
|
||||
|
||||
function presetDurationText(config) {
|
||||
const hours = (config.endMs - config.startMs) / (60 * 60 * 1000);
|
||||
if (Number.isInteger(hours)) return hours + (hours === 1 ? " hour" : " hours");
|
||||
return formatCountdown(config.endMs - config.startMs);
|
||||
}
|
||||
|
||||
function presetDurationLabel(config) {
|
||||
const hours = (config.endMs - config.startMs) / (60 * 60 * 1000);
|
||||
if (Number.isInteger(hours)) return hours + "-hour";
|
||||
return presetDurationText(config);
|
||||
}
|
||||
|
||||
function presetPageTitle(config) {
|
||||
return (isDefaultPreset(config) ? "Default temporary" : "Temporary") +
|
||||
" radio test · " + config.freqText + " MHz";
|
||||
}
|
||||
|
||||
function presetPageSummary(config) {
|
||||
return "The " + (isDefaultPreset(config) ? "default" : "configured") +
|
||||
" window is " + formatZoned(config.startMs, config.tz) + " through " +
|
||||
formatZoned(config.endMs, config.tz) + " (" + presetDurationText(config) +
|
||||
"), using " + config.freqText + " MHz, " + config.bwText + " kHz, SF" +
|
||||
config.sf + ", CR" + config.cr + ", " + config.txText + " dBm.";
|
||||
}
|
||||
|
||||
function presetEyebrow(config) {
|
||||
return "MeshCore · " + (isDefaultPreset(config) ? "default " : "") +
|
||||
presetDurationLabel(config) + " temporary preset test";
|
||||
}
|
||||
|
||||
function phaseAt(config, nowMs) {
|
||||
if (nowMs < config.startMs) return "before";
|
||||
if (nowMs < config.endMs) return "active";
|
||||
@@ -475,6 +517,13 @@
|
||||
});
|
||||
}
|
||||
|
||||
function setPageText(selector, value) {
|
||||
if (!global.document) return;
|
||||
global.document.querySelectorAll(selector).forEach(function (element) {
|
||||
element.textContent = value;
|
||||
});
|
||||
}
|
||||
|
||||
function setCommand(root, name, value) {
|
||||
setText(root, '[data-command="' + name + '"]', value);
|
||||
root.querySelectorAll('[data-copy-command="' + name + '"]').forEach(function (button) {
|
||||
@@ -676,6 +725,9 @@
|
||||
return;
|
||||
}
|
||||
|
||||
setPageText('[data-role="preset-test-page-title"]', presetPageTitle(config));
|
||||
setPageText('[data-role="preset-test-page-summary"]', presetPageSummary(config));
|
||||
setText(root, '[data-role="preset-test-eyebrow"]', presetEyebrow(config));
|
||||
setText(root, '[data-field="freq-display"]', config.freq.toFixed(3));
|
||||
setText(root, '[data-field="bw-display"]', config.bwText);
|
||||
setText(root, '[data-field="sf"]', String(config.sf));
|
||||
@@ -880,6 +932,12 @@
|
||||
PresetTestError: PresetTestError,
|
||||
configFromSearch: configFromSearch,
|
||||
configFromGenerator: configFromGenerator,
|
||||
isDefaultPreset: isDefaultPreset,
|
||||
presetDurationText: presetDurationText,
|
||||
presetDurationLabel: presetDurationLabel,
|
||||
presetPageTitle: presetPageTitle,
|
||||
presetPageSummary: presetPageSummary,
|
||||
presetEyebrow: presetEyebrow,
|
||||
validateTimeZone: validateTimeZone,
|
||||
browserTimeZone: browserTimeZone,
|
||||
supportedTimeZones: supportedTimeZones,
|
||||
|
||||
+6
-5
@@ -1,9 +1,10 @@
|
||||
# Default temporary radio test · 910.1 MHz · September 21–23, 2026
|
||||
# <span data-role="preset-test-page-title">Default temporary radio test · 910.1 MHz · September 21–23, 2026</span>
|
||||
|
||||
Use this page to join the shared temporary radio test without overwriting the
|
||||
node's saved primary radio settings. The default window is **Monday,
|
||||
September 21, 2026 at 5:00 PM through Wednesday, September 23 at 5:00 PM
|
||||
Pacific time** (48 hours), using **910.1 MHz, 500 kHz, SF8, CR7**.
|
||||
node's saved primary radio settings. <span data-role="preset-test-page-summary">The
|
||||
default window is <strong>Monday, September 21, 2026 at 5:00 PM through
|
||||
Wednesday, September 23 at 5:00 PM Pacific time</strong> (48 hours), using
|
||||
<strong>910.1 MHz, 500 kHz, SF8, CR7</strong>.</span>
|
||||
|
||||
The page reads the complete test definition from its URL. Change the query
|
||||
parameters to reuse it for a different window, display time zone, or radio
|
||||
@@ -14,7 +15,7 @@ tuple; no source edit is required.
|
||||
|
||||
<div data-role="content">
|
||||
<section class="preset-test-hero" aria-labelledby="preset-test-title">
|
||||
<p class="preset-test-eyebrow">MeshCore · default 48-hour temporary preset test</p>
|
||||
<p class="preset-test-eyebrow" data-role="preset-test-eyebrow">MeshCore · default 48-hour temporary preset test</p>
|
||||
<div class="preset-test-hero-row">
|
||||
<div>
|
||||
<h2 id="preset-test-title">
|
||||
|
||||
Reference in New Issue
Block a user