This repository has been archived on 2023-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
python-blog/articles/static/edit-keymap.js

12 lines
394 B
JavaScript

window.onload = function () {
const adminLinkElement = document.querySelector("a#admin-link");
if (adminLinkElement === undefined || adminLinkElement === null) {
return;
}
const adminLocation = adminLinkElement.href;
document.addEventListener("keydown", event => {
if (event.code === "KeyE") {
window.location = adminLocation;
}
})
}