From 48721c85ebcfa973ee81719d2467ca80e4253dc9 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Fri, 01 May 2026 17:30:03 +0000
Subject: [PATCH] =Edmonton Ink hard test begins! Real testing of the managers and reset routes will commence. So far, just ensuring our classes are all loaded correctly: Site() and its sub-classes Membership, Login, etc. Care should be taken to load conditionally on 'init', as we finish defining most settings by 'plugins_loaded' at priority 5

---
 assets/js/concise/UtilityFunctions.js |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/assets/js/concise/UtilityFunctions.js b/assets/js/concise/UtilityFunctions.js
index efbf22f..2731174 100644
--- a/assets/js/concise/UtilityFunctions.js
+++ b/assets/js/concise/UtilityFunctions.js
@@ -1010,3 +1010,28 @@
 	window.decodeHelper.innerHTML = text;
 	return window.decodeHelper.value;
 }
+
+
+window.focusNextElement = function() {
+	//add all elements we want to include in our selection
+	var focussableElements =
+		'a:not([disabled]), button:not([disabled]), input[type=text]:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])';
+	if (document.activeElement && document.activeElement.form) {
+		var focussable = Array.prototype.filter.call(
+			document.activeElement.form.querySelectorAll(focussableElements),
+			function (element) {
+				//check for visibility while always include the current activeElement
+				return (
+					element.offsetWidth > 0 ||
+					element.offsetHeight > 0 ||
+					element === document.activeElement
+				);
+			}
+		);
+		var index = focussable.indexOf(document.activeElement);
+		if (index > -1) {
+			var nextElement = focussable[index + 1] || focussable[0];
+			nextElement.focus();
+		}
+	}
+}

--
Gitblit v1.10.0