+
diff --git a/webdata/main.css b/webdata/main.css
index bf66d6a..6b9907f 100644
--- a/webdata/main.css
+++ b/webdata/main.css
@@ -153,6 +153,10 @@ textarea {
padding: 0 0.5rem;
}
+textarea:focus {
+ outline: none;
+}
+
#keys {
padding: 0;
justify-content: end;
@@ -177,33 +181,48 @@ textarea {
align-items: stretch;
padding: 0;
gap: 0;
+ flex-direction: row;
+}
+
+#text-input .buttons {
+ flex-direction: column;
}
#text-input .buttons > button {
- border-bottom: none;
+ border-top: none;
border-right: none;
}
-#text-input .buttons > button:first-child {
- border-left: none;
+#text-input .buttons > button:last-child {
+ border-bottom: none;
}
-@media (min-aspect-ratio: 4/3) {
- #text-input {
- flex-direction: row;
+/* Only Safari for iOS */
+@supports (-webkit-touch-callout: none) {
+ /* Virtual keyboard can overlay content */
+ #text-input .buttons > button:last-child {
+ display: flex;
+ padding-top: 0.2em;
+ justify-content: center;
}
+}
- #text-input .buttons {
+/* Portrait orientation (not for Safari on iOS) */
+@supports not (-webkit-touch-callout: none) { @media (max-aspect-ratio: 4/3) {
+ #text-input {
flex-direction: column;
}
- #text-input .buttons > button,
- #text-input .buttons > button:first-child {
+ #text-input .buttons {
+ flex-direction: row;
+ }
+
+ #text-input .buttons > button {
border-top: 1px solid black;
- border-left: 1px solid black;
+ border-bottom: none;
}
#text-input .buttons > button:first-child {
- border-top: none;
+ border-left: none;
}
-}
+} }
diff --git a/webdata_test.go b/webdata_test.go
new file mode 100644
index 0000000..7ce8e8b
--- /dev/null
+++ b/webdata_test.go
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2024 Unrud
+ *
+ * This file is part of Remote-Touchpad.
+ *
+ * Remote-Touchpad is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Remote-Touchpad is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Remote-Touchpad. If not, see .
+ */
+
+package main
+
+import (
+ "fmt"
+ "io/fs"
+ "path/filepath"
+ "testing"
+)
+
+func TestWebdataTypesCompleteness(t *testing.T) {
+ if err := fs.WalkDir(webdataFS, ".", func(_ string, d fs.DirEntry, err error) error {
+ if err != nil || d.IsDir() {
+ return err
+ }
+ ext := filepath.Ext(d.Name())
+ if _, haveType := webdataTypes[ext]; !haveType {
+ return fmt.Errorf("missing mime type for extension %#v", ext)
+ }
+ return nil
+ }); err != nil {
+ t.Fatal(err)
+ }
+}