-
Notifications
You must be signed in to change notification settings - Fork 595
Commit
Co-authored-by: Bruno Kambere <[email protected]> Co-authored-by: snyk-bot <[email protected]> Co-authored-by: Simon Smith <[email protected]>
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,4 @@ | |
"url": "https://github.com/Ylianst/MeshCentral.git" | ||
}, | ||
"readme": "readme.md" | ||
} | ||
} |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
document.addEventListener('DOMContentLoaded', function () { | ||
|
||
const themeSwitcher = document.getElementById('theme-switcher'); | ||
const themeStylesheet = document.getElementById('theme-stylesheet'); | ||
|
||
// Load saved theme from local storage | ||
const savedTheme = localStorage.getItem('theme'); | ||
if (savedTheme) { | ||
const safeTheme = encodeURIComponent(savedTheme); | ||
themeStylesheet.href = `styles/themes/${safeTheme}/bootstrap.min.css`; | ||
themeSwitcher.value = savedTheme; | ||
} | ||
|
||
// Change theme on selection | ||
themeSwitcher.addEventListener('change', function () { | ||
const selectedTheme = themeSwitcher.value; | ||
const safeTheme = encodeURIComponent(selectedTheme); | ||
themeStylesheet.href = `styles/themes/${safeTheme}/bootstrap.min.css`; | ||
// Save selected theme to local storage | ||
localStorage.setItem('theme', selectedTheme); | ||
}); | ||
|
||
// Initialize Select2 on all select elements with the 'select2' class | ||
$('.select2').select2({ | ||
theme: 'bootstrap-5', | ||
width: $( this ).data( 'width' ) ? $( this ).data( 'width' ) : $( this ).hasClass( 'w-100' ) ? '100%' : 'style', | ||
placeholder: $( this ).data( 'placeholder' ), | ||
}); | ||
}); |
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.