mirror of https://github.com/nealey/vail.git
Some bugfixes
This commit is contained in:
parent
7cdafb0dbb
commit
cd965e73d8
|
@ -0,0 +1 @@
|
|||
go.sum
|
|
@ -0,0 +1,3 @@
|
|||
#! /bin/sh
|
||||
|
||||
rsync -va static fozzie.woozle.org:/srv/vail/
|
|
@ -15,6 +15,11 @@
|
|||
<link rel="stylesheet" href="vail.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="snackbar" class="mdl-js-snackbar mdl-snackbar">
|
||||
<div class="mdl-snackbar__text"></div>
|
||||
<button class="mdl-snackbar__action" type="button"></button>
|
||||
</div>
|
||||
|
||||
<div class="mdl-layout mdl-js-layout">
|
||||
<header class="mdl-layout__header mdl-layout__header--scroll">
|
||||
<div class="mdl-layout__header-row">
|
||||
|
@ -35,9 +40,9 @@
|
|||
<span class="mdl-layout-title">Repeaters</span>
|
||||
<nav class="mdl-navigation">
|
||||
<a class="mdl-navigation__link" href="?repeater=">General Chaos</a>
|
||||
<a class="mdl-navigation__link" href="?repeater=beg">1-15 WPM</a>
|
||||
<a class="mdl-navigation__link" href="?repeater=int">16-20 WPM</a>
|
||||
<a class="mdl-navigation__link" href="?repeater=adv">21-99 WPM</a>
|
||||
<a class="mdl-navigation__link" href="?repeater=1-15+WPM">1-15 WPM</a>
|
||||
<a class="mdl-navigation__link" href="?repeater=16-20+WPM">16-20 WPM</a>
|
||||
<a class="mdl-navigation__link" href="?repeater=21-99+WPM">21-99 WPM</a>
|
||||
</nav>
|
||||
<hr>
|
||||
<nav class="mdl-navigation">
|
||||
|
@ -90,13 +95,16 @@
|
|||
<tr>
|
||||
<td>
|
||||
<kbd>.</kbd> or <kbd>z</kbd>
|
||||
<br>
|
||||
right-click for Dah
|
||||
</td>
|
||||
<td>
|
||||
<kbd>/</kbd> or <kbd>x</kbd>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
Right-click on Dit = Dah
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="mdl-tabs__panel" id="tools">
|
||||
|
@ -114,6 +122,9 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mdl-card__actions right">
|
||||
<button class="maximize" title="maximize">↕</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mdl-card mdl-shadow--4dp">
|
||||
|
@ -180,9 +191,6 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<p>Errors</p>
|
||||
<div id="errors"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -18,6 +18,13 @@
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
.right {
|
||||
text-align: right;
|
||||
}
|
||||
.maximized .key {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.wide {
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
@ -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.")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue