feat: capture ctrl+u for git repo redirect
This commit is contained in:
parent
cf2a5c2ffb
commit
086a8a665c
@ -2,9 +2,24 @@ import API from "./API";
|
|||||||
import UI from "./UI";
|
import UI from "./UI";
|
||||||
import Input from "./Input";
|
import Input from "./Input";
|
||||||
|
|
||||||
|
const pkg = require("../../package.json");
|
||||||
|
|
||||||
declare const Handlebars: any;
|
declare const Handlebars: any;
|
||||||
|
|
||||||
(() => {
|
(() => {
|
||||||
|
let isCtrl = false;
|
||||||
|
document.addEventListener('keyup', (e) => {
|
||||||
|
if (e.ctrlKey) isCtrl = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
document.addEventListener('keydown', (e) => {
|
||||||
|
if (e.ctrlKey) isCtrl = true;
|
||||||
|
if (isCtrl && e.key === "u") {
|
||||||
|
window.open(pkg.repository.url, "_blank");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Input.registerShortcut(Input.KONAMI_CODE, () => {
|
Input.registerShortcut(Input.KONAMI_CODE, () => {
|
||||||
window.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ", "_blank");
|
window.open("https://www.youtube.com/watch?v=dQw4w9WgXcQ", "_blank");
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": ["ES2022", "DOM"],
|
"lib": ["ES2022", "DOM"],
|
||||||
"target": "ES2022"
|
"target": "ES2022",
|
||||||
|
"moduleResolution": "nodenext"
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user