🔀 Merge pull request #523 from Lissy93/FEATURE/improved-network-request-controls

[FEATURE] Clearer info on network requests
This commit is contained in:
Alicia Sykes
2022-04-02 13:26:19 +01:00
committed by GitHub
4 changed files with 248 additions and 148 deletions

View File

@@ -61,6 +61,8 @@ const HomeMixin = {
},
/* Checks if any of the icons are Font Awesome glyphs */
checkIfFontAwesomeNeeded() {
if (this.appConfig.enableFontAwesome === false) return false;
if (this.appConfig.enableFontAwesome) return true;
let isNeeded = this.checkIfIconLibraryNeeded('fa-');
const currentTheme = localStorage[localStorageKeys.THEME]; // Some themes require FA
if (['material', 'material-dark'].includes(currentTheme)) isNeeded = true;
@@ -68,7 +70,7 @@ const HomeMixin = {
},
/* Injects font-awesome's script tag, only if needed */
initiateFontAwesome() {
if (this.appConfig.enableFontAwesome || this.checkIfFontAwesomeNeeded()) {
if (this.checkIfFontAwesomeNeeded()) {
const fontAwesomeScript = document.createElement('script');
const faKey = this.appConfig.fontAwesomeKey || Defaults.fontAwesomeKey;
fontAwesomeScript.setAttribute('src', `${iconCdns.fa}/${faKey}.js`);
@@ -77,7 +79,9 @@ const HomeMixin = {
},
/* Checks if any of the icons are Material Design Icons */
checkIfMdiNeeded() {
return this.checkIfIconLibraryNeeded('mdi-');
const userOverride = this.appConfig.enableMaterialDesignIcons;
if (userOverride === false) return false;
return userOverride || this.checkIfIconLibraryNeeded('mdi-');
},
/* Injects Material Design Icons, only if needed */
initiateMaterialDesignIcons() {

View File

@@ -296,7 +296,13 @@
"title": "Enable Font-Awesome?",
"type": "boolean",
"default": true,
"description": "Should load font-awesome assets"
"description": "If true, font-awesome will be loaded, if false they will not be. If left empty, icons will only be loaded if needed"
},
"enableMaterialDesignIcons": {
"title": "Enable Font-Awesome?",
"type": "boolean",
"default": false,
"description": "If true, material-design-icons will be loaded, if false they will not be. If left empty, icons will only be loaded if needed"
},
"fontAwesomeKey": {
"title": "Font-Awesome API Key",