From f50540aefe0223e19e0fb6cf530f920ea1f59380 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 28 Apr 2021 10:17:23 -0600 Subject: [PATCH] Indicate when a repeater is local-only --- static/index.html | 12 +++++++++++- static/repeaters.mjs | 3 +++ static/sw.js | 2 +- static/vail.css | 8 ++++++++ static/vail.mjs | 6 ++++-- 5 files changed, 27 insertions(+), 4 deletions(-) diff --git a/static/index.html b/static/index.html index d1710e9..d21c728 100644 --- a/static/index.html +++ b/static/index.html @@ -89,6 +89,7 @@ +
Straight Key @@ -325,6 +326,7 @@ Over -.- Correction ........ ? / Say Again ..--.. + Speak Slower --.- .-. ...
@@ -429,7 +431,15 @@ I also didn't have a lot of money to spend on equipment, but I did have a computer, phone, and gamepad. Nothing else like this exists on the Internet, as far as I can tell.

- + +

What does "local" mean next to the repeater name?

+

+ It means this repeater doesn't repeat anything: + nothing you key in will be sent anywhere. + These are to help people practice and learn, + without worrying about anyone else hearing them fumble around. +

+

Why do I hear a low tone?

This is the "drop tone", and will be accompanied by an error. diff --git a/static/repeaters.mjs b/static/repeaters.mjs index 9af9cb0..df93647 100644 --- a/static/repeaters.mjs +++ b/static/repeaters.mjs @@ -141,6 +141,9 @@ export class Fortune { let fortune = GetFortune() this.keyer.EnqueueAsciiString(`${fortune}\x04 `) + this.rx(0, 0, { + note: "local", + }) } Transmit(time, duration, squelch=true) { diff --git a/static/sw.js b/static/sw.js index fb5be13..e9f2f2e 100644 --- a/static/sw.js +++ b/static/sw.js @@ -17,7 +17,7 @@ function install(event) { self.addEventListener("fetch", e => cacheFetch(e)) function cacheFetch(event) { let fetchInit = {} - if (event.request.match(/(css|js|html)$/)) { + if (event.request.url.match(/\.(css|mjs|js|html)$/)) { fetchInit.cache = "no-cache" } event.respondWith( diff --git a/static/vail.css b/static/vail.css index 221b068..44675f4 100644 --- a/static/vail.css +++ b/static/vail.css @@ -109,6 +109,14 @@ img { background-color: orange; } +#note { + position: absolute; + top: 0.5em; + right: 5em; + font-size: 80%; + color: #888; +} + .input-methods td { text-align: left; } diff --git a/static/vail.mjs b/static/vail.mjs index efd400e..adbdf7a 100644 --- a/static/vail.mjs +++ b/static/vail.mjs @@ -26,7 +26,7 @@ class VailClient { this.sent = [] this.lagTimes = [0] this.rxDurations = [0] - this.clockOffset = "unknown" // How badly our clock is off of the server's + this.clockOffset = null // How badly our clock is off of the server's this.rxDelay = 0 // Milliseconds to add to incoming timestamps this.beginTxTime = null // Time when we began transmitting this.debug = localStorage.debug @@ -192,9 +192,10 @@ class VailClient { * @param {dict} stats Stuff the repeater class would like us to know about */ receive(when, duration, stats) { - this.clockOffset = stats.clockOffset || "unknown" + this.clockOffset = stats.clockOffset || "?" let now = Date.now() when += this.rxDelay + console.log(stats) if (duration > 0) { if (when < now) { @@ -212,6 +213,7 @@ class VailClient { let longestRxDuration = this.rxDurations.reduce((a,b) => Math.max(a,b)) let suggestedDelay = ((averageLag + longestRxDuration) * 1.2).toFixed(0) + this.updateReading("#note", stats.note || "") this.updateReading("#lag-value", averageLag) this.updateReading("#longest-rx-value", longestRxDuration) this.updateReading("#suggested-delay-value", suggestedDelay)