@@ -87,7 +90,10 @@
} else {
assetCard.innerHTML = `
-
Asset ${i + 1}: @T["Empty"]
+
+ Asset ${i + 1}: @T["Empty"]
+
+
@@ -236,10 +242,14 @@
let cardAtIndex = document.querySelector(`[data-card-index="${index}"]`)
let cardBodyAtIndex = cardAtIndex.children[0];
- cardBodyAtIndex.children[0].children[1].textContent = `Asset ${newIndex + 1}`;
+ cardBodyAtIndex.children[1].children[0].children[0].children[0].nextSibling.textContent = ` ${newIndex + 1}`;
+ cardBodyAtIndex.children[0].children[0].children[0].textContent = `Asset ${newIndex + 1}:`;
+ cardBodyAtIndex.children[0].children[0].children[0].ariaLabel = cardBodyAtIndex.children[0].children[0].children[0].ariaLabel.replace(/\s\d+\:/, ` ${newIndex + 1}:`);
let cardAtTarget = document.querySelector(`[data-card-index="${newIndex}"]`)
let cardBodyAtTarget = cardAtTarget.children[0];
- cardBodyAtTarget.children[0].children[1].textContent = `Asset ${index - 0 + 1}`;
+ cardBodyAtTarget.children[1].children[0].children[0].children[0].nextSibling.textContent = ` ${index - 0 + 1}`;
+ cardBodyAtTarget.children[0].children[0].children[0].textContent = `Asset ${index - 0 + 1}:`;
+ cardBodyAtTarget.children[0].children[0].children[0].ariaLabel = cardBodyAtTarget.children[0].children[0].children[0].ariaLabel.replace(/\s\d+\:/, ` ${newIndex + 1}:`);
cardAtIndex.insertBefore(cardBodyAtTarget, null);
cardAtTarget.insertBefore(cardBodyAtIndex, null);
diff --git a/src/Views/Shared/_BatchButton.cshtml b/src/Views/Shared/_BatchButton.cshtml
index 5fe2fdc..91504c4 100644
--- a/src/Views/Shared/_BatchButton.cshtml
+++ b/src/Views/Shared/_BatchButton.cshtml
@@ -1,8 +1,11 @@
+@using Microsoft.AspNetCore.Mvc.Localization
+@inject IViewLocalizer T
+
\ No newline at end of file
diff --git a/src/wwwroot/js/site.js b/src/wwwroot/js/site.js
index a30dea4..0fd7bda 100644
--- a/src/wwwroot/js/site.js
+++ b/src/wwwroot/js/site.js
@@ -2,6 +2,16 @@
const container = document.createElement('div');
container.id = 'toastContainer';
container.className = 'toast-container position-fixed bottom-0 end-0 p-3';
+ container.setAttribute("aria-live", "polite");
+ container.setAttribute("aria-atomic", "true");
+
+ const liveRegion = document.createElement('div');
+ liveRegion.id = 'toastLiveRegion';
+ liveRegion.className = 'visually-hidden';
+ liveRegion.setAttribute('aria-live', 'assertive');
+ liveRegion.setAttribute('aria-atomic', 'true');
+ container.appendChild(liveRegion);
+
document.body.appendChild(container);
return container;
}
@@ -16,7 +26,7 @@ function showToast(message, type) {
toast.innerHTML = `
`;
if (useDarkElements) {
@@ -24,7 +34,14 @@ function showToast(message, type) {
toast.classList.add("text-dark");
}
toastContainer.appendChild(toast);
- const bsToast = new bootstrap.Toast(toast, { delay: 5000 });
+
+ const liveRegion = document.getElementById('toastLiveRegion');
+ if (liveRegion) {
+ liveRegion.textContent = '';
+ setTimeout(() => liveRegion.textContent = message, 500);
+ }
+
+ const bsToast = new bootstrap.Toast(toast, { delay: 10000 });
bsToast.show();
toast.addEventListener('hidden.bs.toast', () => toast.remove());
}