Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions inspector/static/inspector.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
document.addEventListener("keydown", (e) => {
if (e.key !== "/" || e.ctrlKey || e.metaKey || e.altKey) return;
const t = e.target;
if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || (t instanceof HTMLElement && t.isContentEditable)) return;
const input = document.getElementById("project-input");
if (!input) return;
e.preventDefault();
input.focus();
input.select();
});
5 changes: 3 additions & 2 deletions inspector/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
{% block head %}{% endblock %}
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🕵️</text></svg>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="/static/inspector.js" defer></script>
</head>
<body>
<main>
<h1><a href="/">Inspector</a></h1>
<form action="/">
{% if h2 %}
<input type="text" name="project" placeholder="Project name" value="{{ h2 }}" autocomplete="off">
<input id="project-input" type="text" name="project" placeholder="Project name" value="{{ h2 }}" autocomplete="off">
{% else %}
<input type="text" name="project" placeholder="Project name" autocomplete="off">
<input id="project-input" type="text" name="project" placeholder="Project name" autocomplete="off">
{% endif %}
<input type="submit">
</form>
Expand Down