diff options
| author | Daniel Hader <[email protected]> | 2026-06-05 19:29:40 -0500 |
|---|---|---|
| committer | Daniel Hader <[email protected]> | 2026-06-05 19:29:40 -0500 |
| commit | c071aca5c5c16d56aafe38ace2b2c158e1b875fc (patch) | |
| tree | aa947a0f6fa53be3de6fb879aa5c4d96bc087cf1 /static | |
| parent | 3ac68b8b59f150e08731a62026ce3ac825655614 (diff) | |
server text sanitation, username/email filters, and code length measurement
Diffstat (limited to 'static')
| -rw-r--r-- | static/main.js | 2 | ||||
| -rw-r--r-- | static/register.html | 5 | ||||
| -rw-r--r-- | static/submission.js | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/static/main.js b/static/main.js index b3bf50f..1c2dbc1 100644 --- a/static/main.js +++ b/static/main.js @@ -83,7 +83,7 @@ function create_problem_element(problem, submissions) { sub_row.appendChild(sub_lang); const sub_size = document.createElement("td"); - sub_size.innerHTML = submission.code.length; + sub_size.innerHTML = `${submission.code_length} bytes`; sub_row.appendChild(sub_size); const sub_subm = document.createElement("td"); diff --git a/static/register.html b/static/register.html index d7e183c..9f3b651 100644 --- a/static/register.html +++ b/static/register.html @@ -21,6 +21,8 @@ <span id="error-message" style="color: red"></span> <br><br> </div> + <p>Usernames should consist only of letters, numbers, underscores, and hyphens.</p> + <p>To help mitigate unauthorized access to my server, a registration code is required to create an account. Please see Daniel for the code.</p> <label for="register-email">Email</label><br> <input type="text" id="register-email" name="email"> <br><br> @@ -30,6 +32,9 @@ <label for="register-password">Password</label><br> <input type="password" id="register-password" name="password"> <br><br> + <label for="register-code">Registration Code</label><br> + <input type="password" id="register-code" name="register_code"> + <br><br> <input type="submit" value="Register"> </form> diff --git a/static/submission.js b/static/submission.js index bbe4075..4fbcf23 100644 --- a/static/submission.js +++ b/static/submission.js @@ -27,7 +27,7 @@ async function init() { problem_div.appendChild(description); document.getElementById("submission-author").innerHTML = `by ${submission.username}`; - document.getElementById("submission-size").innerHTML = `${new Blob([submission.code]).size} bytes`; + document.getElementById("submission-size").innerHTML = `${submission.code_length} bytes`; document.getElementById("submission-details").innerHTML = submission.details; document.getElementById("submission-code").innerHTML = submission.code; |
