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

15 lines
495 B
JavaScript
Raw Normal View History

2021-01-04 21:32:03 +01:00
'use strict';
// Explicitely not using ES 6 features because the compressor doesn't support them.
window.onload = function () {
2021-01-04 21:32:03 +01:00
var adminLinkElement = document.querySelector("a#admin-link");
if (adminLinkElement === undefined || adminLinkElement === null) {
return;
}
2021-01-04 21:32:03 +01:00
var adminLocation = adminLinkElement.href;
document.addEventListener("keydown", function(event) {
if (event.code === "KeyE") {
window.location = adminLocation;
}
})
}