aboutsummaryrefslogtreecommitdiff
path: root/priv/home.html.eex
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2024-07-17 13:41:06 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2024-07-17 13:41:06 +0000
commit06f7696c0976c75c13435f84a2101c1203c18b95 (patch)
tree9ea52c784f4bc5013c8e8af32e82c0a497889b32 /priv/home.html.eex
downloadmediasync-06f7696c0976c75c13435f84a2101c1203c18b95.tar
mediasync-06f7696c0976c75c13435f84a2101c1203c18b95.tar.gz
mediasync-06f7696c0976c75c13435f84a2101c1203c18b95.zip
Initial commit
Diffstat (limited to 'priv/home.html.eex')
-rw-r--r--priv/home.html.eex41
1 files changed, 41 insertions, 0 deletions
diff --git a/priv/home.html.eex b/priv/home.html.eex
new file mode 100644
index 0000000..5936e6c
--- /dev/null
+++ b/priv/home.html.eex
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html lang="en">
+
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>home | mediasync</title>
+ <link rel="stylesheet" href="/static/main.css">
+</head>
+
+<body>
+ <form action="/host_room" method="post">
+ <input name="_csrf_token" type="hidden" value="<%= Plug.CSRFProtection.get_csrf_token() %>">
+ <label for="host_room_input_video_url">video url:</label>
+ <input name="video_url" id="host_room_input_video_url" type="url"
+ maxlength="<%= Application.get_env(:mediasync, :max_video_url_size) %>" required><br>
+
+ <script>
+ "use strict";
+ /* The built-in validation for <input type="url"> seems very half-hearted in my
+ testing (Firefox 127.0.2), so let's replace it with something complete. */
+ (() => {
+ const checkURLInputValidity = (urlInput) => {
+ if (URL.canParse(urlInput.value)) {
+ urlInput.setCustomValidity("");
+ } else {
+ urlInput.setCustomValidity("Please enter a valid URL.");
+ }
+ urlInput.reportValidity();
+ };
+ const urlInput = document.querySelector("input#host_room_input_video_url");
+ checkURLInputValidity(urlInput);
+ urlInput.addEventListener("input", e => checkURLInputValidity(e.target));
+ })();
+ </script>
+
+ <input type="submit" value="host room">
+ </form>
+</body>
+
+</html>