20 lines
646 B
JavaScript
20 lines
646 B
JavaScript
(function () {
|
|
document.addEventListener('keydown', function (e) {
|
|
if (!e.altKey || !e.shiftKey) return;
|
|
switch (e.key) {
|
|
case 'E':
|
|
e.preventDefault();
|
|
window.location.href = window.location.pathname + '?edit';
|
|
break;
|
|
case 'N':
|
|
e.preventDefault();
|
|
if (typeof newPage === 'function') newPage();
|
|
break;
|
|
case 'M':
|
|
e.preventDefault();
|
|
if (window.location.pathname !== '/' && typeof movePage === 'function') movePage();
|
|
break;
|
|
}
|
|
});
|
|
})();
|