Skip to content

Commit

Permalink
[BETA] Meshcentral Bootstrap 5 User Interface (#6450)
Browse files Browse the repository at this point in the history
Co-authored-by: Bruno Kambere <[email protected]>
Co-authored-by: snyk-bot <[email protected]>
Co-authored-by: Simon Smith <[email protected]>
  • Loading branch information
4 people authored Oct 19, 2024
1 parent 63930c4 commit 5193fef
Show file tree
Hide file tree
Showing 23 changed files with 24,368 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@
"url": "https://github.com/Ylianst/MeshCentral.git"
},
"readme": "readme.md"
}
}
7 changes: 7 additions & 0 deletions public/scripts/bootstrap.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions public/scripts/fontawesome/all.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/scripts/jquery.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions public/scripts/select2.full.min.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions public/scripts/sweetalert2.all.min.js

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions public/scripts/themes/theme-switcher.js
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' ),
});
});
6 changes: 6 additions & 0 deletions public/styles/bootstrap.min.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions public/styles/fontawesome/all.min.css

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions public/styles/select2-bootstrap-5-theme.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/styles/select2.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 5193fef

Please sign in to comment.