Skip to content

Commit bb8745d

Browse files
committed
ci: add prettier
https://github.com/pre-commit/mirrors-prettier has been archived but that is fine for what we use it for.
1 parent 36073b6 commit bb8745d

File tree

2 files changed

+81
-79
lines changed

2 files changed

+81
-79
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ repos:
55
- id: ruff
66
args: [--fix]
77
- id: ruff-format
8+
- repo: https://github.com/pre-commit/mirrors-prettier
9+
rev: v3.1.0
10+
hooks:
11+
- id: prettier
12+
files: \.(html)$
813
- repo: https://github.com/pre-commit/pre-commit-hooks
914
rev: v5.0.0
1015
hooks:
Lines changed: 76 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,84 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html>
3-
<meta charset=UTF-8>
4-
<title>Grizzly &sdot; Post Launch Delay</title>
5-
<head>
6-
<style>
7-
body {
8-
background-color: #222;
9-
color: #ccc;
10-
font-family: monospace;
11-
font-size: 1.2em;
12-
}
13-
button {
14-
background-color: #444;
15-
border: 2px solid;
16-
border-color: #ccc;
17-
color: inherit;
18-
cursor: pointer;
19-
font-family: inherit;
20-
font-size: inherit;
21-
padding: .1em .4em;
22-
}
23-
</style>
24-
<script>
25-
const args = window.location.search.replace('?', '')
26-
const target = args ? `/grz_continue?${args}` : '/grz_continue'
27-
let countInterval = null
3+
<meta charset="UTF-8" />
4+
<title>Grizzly &sdot; Post Launch Delay</title>
5+
<head>
6+
<style>
7+
body {
8+
background-color: #222;
9+
color: #ccc;
10+
font-family: monospace;
11+
font-size: 1.2em;
12+
}
13+
button {
14+
background-color: #444;
15+
border: 2px solid;
16+
border-color: #ccc;
17+
color: inherit;
18+
cursor: pointer;
19+
font-family: inherit;
20+
font-size: inherit;
21+
padding: 0.1em 0.4em;
22+
}
23+
</style>
24+
<script>
25+
const args = window.location.search.replace("?", "");
26+
const target = args ? `/grz_continue?${args}` : "/grz_continue";
27+
let countInterval = null;
2828

29-
// parse args
30-
let limit = 300
31-
if (args) {
32-
for (let kv of args.split('&')) {
33-
let [k, v] = kv.split('=')
34-
if (k === 'post_launch_delay') {
35-
limit = Math.max(Number.parseInt(v), 0)
36-
break
29+
// parse args
30+
let limit = 300;
31+
if (args) {
32+
for (let kv of args.split("&")) {
33+
let [k, v] = kv.split("=");
34+
if (k === "post_launch_delay") {
35+
limit = Math.max(Number.parseInt(v), 0);
36+
break;
37+
}
3738
}
38-
}
39-
}
40-
let remaining = limit
39+
}
40+
let remaining = limit;
4141

42-
function countDown() {
43-
remaining -= 1
44-
setTimeout(updateDisplay, 0)
45-
if (remaining <= 0)
46-
setTimeout(next, 0)
47-
}
42+
function countDown() {
43+
remaining -= 1;
44+
setTimeout(updateDisplay, 0);
45+
if (remaining <= 0) setTimeout(next, 0);
46+
}
4847

49-
function next() {
50-
if (countInterval) {
51-
clearInterval(countInterval)
52-
}
53-
document.getElementById('msg').innerText = `> Redirecting...`
54-
setTimeout(() => {
55-
window.location = target
56-
}, 0)
57-
}
48+
function next() {
49+
if (countInterval) {
50+
clearInterval(countInterval);
51+
}
52+
document.getElementById("msg").innerText = `> Redirecting...`;
53+
setTimeout(() => {
54+
window.location = target;
55+
}, 0);
56+
}
5857

59-
function updateDisplay() {
60-
remainingSeconds = Math.max(remaining, 0)
61-
document.getElementById('msg').innerText = (
62-
`> Continuing automatically in: ${remainingSeconds}s`
63-
)
64-
}
58+
function updateDisplay() {
59+
remainingSeconds = Math.max(remaining, 0);
60+
document.getElementById("msg").innerText =
61+
`> Continuing automatically in: ${remainingSeconds}s`;
62+
}
6563

66-
window.onload = () => {
67-
setTimeout(updateDisplay, 0)
68-
if (remaining) {
69-
countInterval = setInterval(countDown, 1000)
70-
}
71-
else {
72-
document.getElementById('btn').style.display = 'none'
73-
document.getElementById('prompt').style.display = 'none'
74-
setTimeout(countDown, 0)
75-
}
76-
}
77-
</script>
78-
</head>
79-
<body>
80-
<h4>Grizzly &sdot; Post Launch Delay</h4>
81-
<div>&gt; Browser launched.</div>
82-
<div id='prompt'>&gt; Connect debugger, etc...</div>
83-
<div id='msg'></div>
84-
<div>&nbsp;</div>
85-
<button id='btn' onclick='next()'>Continue</button>
86-
</body>
64+
window.onload = () => {
65+
setTimeout(updateDisplay, 0);
66+
if (remaining) {
67+
countInterval = setInterval(countDown, 1000);
68+
} else {
69+
document.getElementById("btn").style.display = "none";
70+
document.getElementById("prompt").style.display = "none";
71+
setTimeout(countDown, 0);
72+
}
73+
};
74+
</script>
75+
</head>
76+
<body>
77+
<h4>Grizzly &sdot; Post Launch Delay</h4>
78+
<div>&gt; Browser launched.</div>
79+
<div id="prompt">&gt; Connect debugger, etc...</div>
80+
<div id="msg"></div>
81+
<div>&nbsp;</div>
82+
<button id="btn" onclick="next()">Continue</button>
83+
</body>
8784
</html>

0 commit comments

Comments
 (0)