diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..08cb523 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +go.sum diff --git a/publish.sh b/publish.sh new file mode 100755 index 0000000..95216d8 --- /dev/null +++ b/publish.sh @@ -0,0 +1,3 @@ +#! /bin/sh + +rsync -va static fozzie.woozle.org:/srv/vail/ diff --git a/static/index.html b/static/index.html index 0ca745f..a8a3498 100644 --- a/static/index.html +++ b/static/index.html @@ -15,6 +15,11 @@ +
+
+ +
+
@@ -35,9 +40,9 @@ Repeaters
@@ -114,6 +122,9 @@
+
+ +
@@ -143,7 +154,7 @@ max="9999" value="4000">

-
+
@@ -180,9 +191,6 @@
-
-

Errors

-
diff --git a/static/vail.css b/static/vail.css index 997631d..491a1bd 100644 --- a/static/vail.css +++ b/static/vail.css @@ -18,6 +18,13 @@ text-align: center; } +.right { + text-align: right; +} +.maximized .key { + height: 100vh; +} + .wide { width: 100%; } diff --git a/static/vail.js b/static/vail.js index 2c30ca6..41954df 100644 --- a/static/vail.js +++ b/static/vail.js @@ -240,6 +240,9 @@ class Vail { e.addEventListener("mousedown", e => this.keyButton(e)) e.addEventListener("mouseup", e => this.keyButton(e)) } + for (let e of document.querySelectorAll("button.maximize")) { + e.addEventListener("click", e => this.maximize(e)) + } // Listen for keystrokes document.addEventListener("keydown", e => this.key(e)) @@ -254,7 +257,7 @@ class Vail { this.inputInit("#rx-delay", e => {this.rxDelay = Number(e.target.value)}) // Show what repeater we're on - let repeater = (new URL(location)).searchParams.get("repeater") || "Default" + let repeater = (new URL(location)).searchParams.get("repeater") || "General Chaos" document.querySelector("#repeater").textContent = repeater // Request MIDI access @@ -264,6 +267,19 @@ class Vail { } } + maximize(e) { + let element = e.target + while (! element.classList.contains("mdl-card")) { + element = element.parentElement + if (! element) { + console.log("Maximize button: couldn't find parent card") + return + } + } + element.classList.toggle("maximized") + console.log(element) + } + openSocket() { // Set up WebSocket let wsUrl = new URL(window.location) @@ -338,12 +354,13 @@ class Vail { error(msg) { let now = new Date() - let e = document.querySelector("#errors") - if (e) { - let p = e.appendChild(document.createElement("p")) - p.innerText = "[" + now.toLocaleTimeString() + "] " + msg - e.scrollTop = e.scrollHeight + let el = document.querySelector("#snackbar") + let data = { } + el.MaterialSnackbar.showSnackbar({ + message: msg, + timeout: 2000 + }) this.buzzer.ErrorTone() } @@ -474,6 +491,9 @@ class Vail { this.beginTx() } else { this.endTx() + if (this.buzzer.ac.state != "running") { + this.error("Browser won't let me play sound yet. Try pressing a button first.") + } } } }