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 @@ +
+ 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. +
+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)