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

13 lines
394 B
JavaScript
Raw Normal View History

window.onload = function () {
2020-12-25 13:39:33 +01:00
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;
}
})
}