diff --git a/src/web/html/index.html b/src/web/html/index.html
index 38bf7ccc..2d4de4bd 100755
--- a/src/web/html/index.html
+++ b/src/web/html/index.html
@@ -145,7 +145,7 @@
-
+
@@ -584,22 +584,22 @@
-
-
+
FAQs
-
-
+
Report a bug
-
-
+
About
-
-
+
Keybindings
diff --git a/src/web/stylesheets/layout/_banner.css b/src/web/stylesheets/layout/_banner.css
index 59856958..1ef5d766 100755
--- a/src/web/stylesheets/layout/_banner.css
+++ b/src/web/stylesheets/layout/_banner.css
@@ -26,6 +26,36 @@
color: var(--banner-url-colour);
}
+#options:focus {
+ background-color: #eef3ec;
+ border: solid black 2px;
+ border-radius: 4px;
+}
+
+#support:focus {
+ background-color: #eef3ec;
+ border: solid black 2px;
+ border-radius: 4px;
+}
+
+#notice:focus {
+ background-color: #eef3ec;
+ border: solid black 2px;
+ border-radius: 4px;
+}
+
+#banner .col a:focus {
+ background-color: #eef3ec;
+ border: solid black 2px;
+ border-radius: 4px;
+}
+
+#notice-wrapper #notice:focus {
+ background-color: #eef3ec;
+ border: solid black 2px;
+ border-radius: 4px;
+}
+
#notice-wrapper {
text-align: center;
overflow: hidden;
diff --git a/src/web/stylesheets/layout/_modals.css b/src/web/stylesheets/layout/_modals.css
index 3cd0ce09..e15bc3e9 100755
--- a/src/web/stylesheets/layout/_modals.css
+++ b/src/web/stylesheets/layout/_modals.css
@@ -78,6 +78,11 @@
border-left: 2px solid var(--primary-border-colour);
}
+p a:focus {
+ color: #0a6ebd;
+ text-decoration: underline;
+}
+
.checkbox label input[type=checkbox]+.checkbox-decorator .check,
.checkbox label input[type=checkbox]+.checkbox-decorator .check::before {
border-color: var(--input-border-colour);
diff --git a/src/web/waiters/ControlsWaiter.mjs b/src/web/waiters/ControlsWaiter.mjs
index b57940a3..5e683f8e 100755
--- a/src/web/waiters/ControlsWaiter.mjs
+++ b/src/web/waiters/ControlsWaiter.mjs
@@ -387,6 +387,18 @@ class ControlsWaiter {
*/
supportButtonClick(e) {
e.preventDefault();
+ const faqs = document.getElementById("faqs");
+ const faqsAElement = faqs.getElementsByTagName("a");
+ for (let i = 0; i < faqsAElement.length; i++) {
+ faqsAElement[i].setAttribute("tabindex", "0");
+ faqsAElement[i].addEventListener("keydown", this.navigateFAQList, false);
+ }
+
+ const tabs = document.querySelectorAll('[role="tab"]');
+
+ for (let i = 0; i < tabs.length; i++) {
+ tabs[i].addEventListener("keydown", this.changeTabs, false);
+ }
const reportBugInfo = document.getElementById("report-bug-info");
const saveLink = this.generateStateUrl(true, true, null, null, "https://gchq.github.io/CyberChef/");
@@ -403,6 +415,64 @@ ${navigator.userAgent}
}
+ /**
+ * @param {Event} ev
+ */
+ changeTabs(ev) {
+ const tab = ev.target;
+ ev.preventDefault();
+ ev.stopPropagation();
+
+ if (ev.key === "ArrowRight") {
+ const nextTab = tab.parentElement;
+ if (nextTab.nextElementSibling === null) {
+ tab.parentElement.parentElement.firstElementChild.firstElementChild.focus();
+ } else {
+ nextTab.nextElementSibling.firstElementChild.focus();
+ }
+
+ } else if (ev.key === "ArrowLeft") {
+ const prevTab = tab.parentElement;
+
+ if (prevTab.previousElementSibling === null) {
+ tab.parentElement.parentElement.lastElementChild.firstElementChild.focus();
+ } else {
+ prevTab.previousElementSibling.firstElementChild.focus();
+ }
+ } else if (ev.key === "Tab" && !ev.shiftKey && ev.target === document.getElementById("tab-1")) {
+ document.getElementById("faqs").querySelector("[class='btn btn-primary']").focus();
+ } else if (ev.key === "Tab" && !ev.shiftKey && ev.target === document.getElementById("tab-2")) {
+ document.getElementById("report-bug").querySelector("[class='btn btn-primary']").focus();
+ } else if (ev.key === "Tab" && !ev.shiftKey && ev.target === document.getElementById("tab-3")) {
+ document.getElementById("about").querySelector("[href]").focus();
+ } else if (ev.key === "Tab" && !ev.shiftKey && ev.target === document.getElementById("tab-4")) {
+ const button = document.getElementById("support-modal").getElementsByClassName("modal-footer");
+ const close = button[0].firstElementChild;
+ close.focus();
+ } else if (ev.key === "Enter" || ev.key === "Space" || ev.key === " ") {
+ tab.click();
+ }
+ }
+
+ /**
+ * @param {Event} ev
+ */
+ navigateFAQList(ev) {
+
+ const el = ev.target.nextElementSibling;
+ if (ev.key === "Enter" || ev.key === "Space" || ev.key === " ") {
+ ev.preventDefault();
+ const question = el.classList;
+ if (question !== undefined && question.value) {
+ if (!question.value.includes("show")) {
+ question.add("show");
+ } else if (question.contains("show")) {
+ question.remove("show");
+ }
+ }
+ }
+ }
+
/**
* Shows the stale indicator to show that the input or recipe has changed
* since the last bake.