diff --git a/app/core/src/main/resources/static/js/darkmode.js b/app/core/src/main/resources/static/js/darkmode.js index 0cfd37d37..abfe737c9 100644 --- a/app/core/src/main/resources/static/js/darkmode.js +++ b/app/core/src/main/resources/static/js/darkmode.js @@ -45,25 +45,6 @@ function setMode(mode) { tables.forEach((table) => { table.classList.add("table-dark"); }); - - // Handle dynamically created accordion elements - var accordionItems = document.querySelectorAll(".accordion-item"); - accordionItems.forEach((item) => { - item.style.color = "var(--md-sys-color-on-surface)"; - item.style.backgroundColor = "var(--md-sys-color-surface-5)"; - item.style.border = "1px solid var(--md-sys-color-outline-variant)"; - }); - var accordionButtons = document.querySelectorAll(".accordion-button"); - accordionButtons.forEach((button) => { - button.style.color = "var(--md-sys-color-on-surface)"; - button.style.backgroundColor = "var(--md-sys-color-surface-5)"; - button.style.borderColor = "var(--md-sys-color-outline-variant)"; - }); - var accordionBodies = document.querySelectorAll(".accordion-body"); - accordionBodies.forEach((body) => { - body.style.color = "var(--md-sys-color-on-surface)"; - body.style.backgroundColor = "var(--md-sys-color-surface-5)"; - }); } else if (mode === "off") { if (elements && elements.darkModeIcon) { elements.darkModeIcon.textContent = "light_mode"; diff --git a/app/core/src/main/resources/static/js/githubVersion.js b/app/core/src/main/resources/static/js/githubVersion.js index 20a89ace9..ffc22ed08 100644 --- a/app/core/src/main/resources/static/js/githubVersion.js +++ b/app/core/src/main/resources/static/js/githubVersion.js @@ -320,8 +320,9 @@ async function showUpdateModal() { // Update modal with full information const modalBody = document.getElementById('updateModalBody'); if (fullUpdateInfo && fullUpdateInfo.new_versions) { - // Check if dark mode is active - const isDarkMode = localStorage.getItem("dark-mode") === "on"; + const storedMode = localStorage.getItem("dark-mode"); + const isDarkMode = storedMode === "on" || + (storedMode === null && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches); const darkClasses = isDarkMode ? { accordionItem: 'bg-dark border-secondary text-light', accordionButton: 'bg-dark text-light border-secondary', @@ -337,9 +338,10 @@ async function showUpdateModal() {
${updateAvailableUpdates}
${fullUpdateInfo.new_versions.map((version, index) => ` -
-

-

-
+
${version.announcement.title}

${version.announcement.message}

${version.compatibility.breaking_changes ? ` @@ -373,27 +376,7 @@ async function showUpdateModal() { } modalBody.insertAdjacentHTML('beforeend', detailedVersionsHtml); - // Apply dark mode styling if active - if (isDarkMode) { - var accordionItems = document.querySelectorAll("#versionsAccordion .accordion-item"); - accordionItems.forEach((item) => { - item.style.color = "var(--md-sys-color-on-surface)"; - item.style.backgroundColor = "var(--md-sys-color-surface-5)"; - item.style.border = "1px solid var(--md-sys-color-outline-variant)"; - }); - var accordionButtons = document.querySelectorAll("#versionsAccordion .accordion-button"); - accordionButtons.forEach((button) => { - button.style.color = ""; - button.style.backgroundColor = ""; - button.style.borderColor = ""; - }); - var accordionBodies = document.querySelectorAll("#versionsAccordion .accordion-body"); - accordionBodies.forEach((body) => { - body.style.color = "var(--md-sys-color-on-surface)"; - body.style.backgroundColor = "var(--md-sys-color-surface-5)"; - }); - } - } else { + } else { // Remove loading spinner if failed to load const spinner = document.getElementById('loadingSpinner'); if (spinner) { diff --git a/build.gradle b/build.gradle index 1c18c0fb6..6f36a814f 100644 --- a/build.gradle +++ b/build.gradle @@ -57,7 +57,7 @@ repositories { allprojects { group = 'stirling.software' - version = '1.0.0' + version = '1.1.2' configurations.configureEach { exclude group: 'commons-logging', module: 'commons-logging'