diff options
| author | Daniel Hader <[email protected]> | 2026-05-30 13:21:00 -0500 |
|---|---|---|
| committer | Daniel Hader <[email protected]> | 2026-05-30 13:21:00 -0500 |
| commit | 5e19bada513378eda6a16d7ea13a0db9679e3836 (patch) | |
| tree | 698bcf236fed033e2e0d7e24f014c9ed89ca48d3 | |
| parent | bcff4d006a0600ecf86f18ecdaa74e0df31766f0 (diff) | |
favicon
| -rw-r--r-- | static/favicon.ico | bin | 0 -> 2686 bytes | |||
| -rw-r--r-- | static/index.html | 1 | ||||
| -rw-r--r-- | static/login.html | 1 | ||||
| -rw-r--r-- | static/main.js | 22 | ||||
| -rw-r--r-- | static/register.html | 1 |
5 files changed, 16 insertions, 9 deletions
diff --git a/static/favicon.ico b/static/favicon.ico Binary files differnew file mode 100644 index 0000000..a1e69a6 --- /dev/null +++ b/static/favicon.ico diff --git a/static/index.html b/static/index.html index 67a18aa..6ee2f31 100644 --- a/static/index.html +++ b/static/index.html @@ -4,6 +4,7 @@ <head> <meta charset="utf-8" /> <title>Code Golf Leaderboard</title> + <link rel="icon" href="favicon.ico"> <link rel="stylesheet" href="default.css"> <script type="text/javascript" src="main.js"></script> </head> diff --git a/static/login.html b/static/login.html index fc10aef..0d33801 100644 --- a/static/login.html +++ b/static/login.html @@ -4,6 +4,7 @@ <head> <meta charset="utf-8" /> <title>Code Golf Login</title> + <link rel="icon" href="favicon.ico"> <link rel="stylesheet" href="default.css"> <script type="text/javascript" src="login.js"></script> </head> diff --git a/static/main.js b/static/main.js index 4af948a..23bb356 100644 --- a/static/main.js +++ b/static/main.js @@ -1,13 +1,17 @@ async function me() { - const response = await fetch("/me"); - if (response.ok) { - const result = await response.json(); - // this is technically a XSS risk (TODO: deal with it) - // in principle it only affects the person who chose their username, but... - document.getElementById("logged-in").innerHTML = `Logged in as ${result.username}`; - document.getElementById("logout-links").hidden = false; - } else { - document.getElementById("login-links").hidden = false; + try { + const response = await fetch("/me"); + if (response.ok) { + const result = await response.json(); + // this is technically a XSS risk (TODO: deal with it) + // in principle it only affects the person who chose their username, but... + document.getElementById("logged-in").innerHTML = `Logged in as ${result.username}`; + document.getElementById("logout-links").hidden = false; + } else { + document.getElementById("login-links").hidden = false; + } + } catch (error) { + console.log("hi"); } } diff --git a/static/register.html b/static/register.html index 6483e6b..d7e183c 100644 --- a/static/register.html +++ b/static/register.html @@ -4,6 +4,7 @@ <head> <meta charset="utf-8" /> <title>Code Golf Login</title> + <link rel="icon" href="favicon.ico"> <link rel="stylesheet" href="default.css"> <script type="text/javascript" src="register.js"></script> </head> |
