From 5ccca11a448ea315a6e64453e630694ba2c20e66 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Thu, 21 Nov 2024 20:59:05 +0100 Subject: Rename "rsrc" directories to "static" Stop using "rsrc" as name for the directories which contain static files and rename them to "static". This affects the global static directory and the static sub-directories in the theme directories. If you've stored your own files in the old global "rsrc" directory, you must move them to the new "static" directory. --- theme/default/static/main.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 theme/default/static/main.js (limited to 'theme/default/static/main.js') diff --git a/theme/default/static/main.js b/theme/default/static/main.js new file mode 100644 index 0000000..164c50f --- /dev/null +++ b/theme/default/static/main.js @@ -0,0 +1,15 @@ +//============================================================================== +// Elements which contains the location of the previous and next site +//============================================================================== +const prev = document.getElementById("prev-site"); +const next = document.getElementById("next-site"); + +//============================================================================== +// Handle arrow keys and change the location to the desired direction +//============================================================================== +document.addEventListener("keyup", function(e) { + if(!e.ctrlKey && !e.shiftKey && !e.altKey) { + (e.keyCode === 37 && prev) && (window.location.href = prev.getAttribute("href")); + (e.keyCode === 39 && next) && (window.location.href = next.getAttribute("href")); + } +}, false); -- cgit v1.2.3