diff --git a/src/front-end/js/book.js b/src/front-end/js/book.js index 67741b70..64438e57 100644 --- a/src/front-end/js/book.js +++ b/src/front-end/js/book.js @@ -644,36 +644,38 @@ aria-label="Show hidden lines">'; } } function showHelp() { - document.getElementById("help-overlay").style.display = "block"; - let help = `
Press ← or → to navigate between chapters
"; - help += "Press s to search in the book
"; - help += "Press ? to show this help
"; - help += "Press Esc to hide this help
"; + document.getElementById('help-overlay').style.display = 'block'; + let help = 'Press ← or → to navigate between chapters
'; + help += 'Press s to search in the book
'; + help += 'Press ? to show this help
'; + help += 'Press Esc to hide this help
'; - document.getElementById("help-overlay").innerHTML = help; + document.getElementById('help-overlay').innerHTML = help; - document.addEventListener('keydown', function (e) { - if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { return; } + document.addEventListener('keydown', function(e) { + if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) { + return; + } switch (e.key) { - case 'Escape': - e.preventDefault(); - hideHelp(); - break; + case 'Escape': + e.preventDefault(); + hideHelp(); + break; } }); } function hideHelp() { - document.getElementById("help-overlay").style.display = "none"; + document.getElementById('help-overlay').style.display = 'none'; } // Usually needs the Shift key to be pressed switch (e.key) { - case '?': - e.preventDefault(); - showHelp(); - break; + case '?': + e.preventDefault(); + showHelp(); + break; } // Rest of the keys are only active when the Shift key is not pressed