diff --git a/js/script.js b/js/script.js index 8cbb149..2b289a0 100644 --- a/js/script.js +++ b/js/script.js @@ -211,6 +211,11 @@ let CONFIG = { * Show a twenty-four-hour clock instead of a twelve-hour clock with AM/PM. */ twentyFourHourClock: true, + + /** + * File extension for icon images + */ + iconExtension: 'png' }; // Get invertedColors preference from cookies @@ -386,13 +391,25 @@ class Help { const fgcolor = invertValue ? getComputedStyle(document.documentElement).getPropertyValue('--background') : getComputedStyle(document.documentElement).getPropertyValue('--foreground'); + const commandListWithIcons = this._commands - .map(({ category, name, key, url, icon }) => { + .map(({ category, name, key, url, icon }, i) => { + const iconEl = CONFIG.iconExtension !== 'svg' + ? `` + : `` + if (category === currentCategory) { return ` +
  • - + ${iconEl} ${name}
  • @@ -412,10 +429,9 @@ class Help { color: ${fgcolor}; background-color:${bgcolor}; border: 4px solid ${fgcolor}; - background-color: ${bgcolor}; } - ${key} + ${key} ${name}