summaryrefslogtreecommitdiff
path: root/priv/home.html.eex
diff options
context:
space:
mode:
authorArjun Satarkar <me@arjunsatarkar.net>2024-07-26 14:20:14 +0000
committerArjun Satarkar <me@arjunsatarkar.net>2024-07-26 14:23:53 +0000
commitcd794243a5bba358d995e26ba024268e7d5d3f85 (patch)
tree2df6974cc40f736441f7b985ca95a7f897f4510e /priv/home.html.eex
parent37ab5213a368926506206cb21a438cb7fea3d530 (diff)
downloadmediasync-cd794243a5bba358d995e26ba024268e7d5d3f85.tar
mediasync-cd794243a5bba358d995e26ba024268e7d5d3f85.tar.gz
mediasync-cd794243a5bba358d995e26ba024268e7d5d3f85.zip
Add Discord Activity functionality (mostly) + general improvements
Diffstat (limited to 'priv/home.html.eex')
-rw-r--r--priv/home.html.eex10
1 files changed, 8 insertions, 2 deletions
diff --git a/priv/home.html.eex b/priv/home.html.eex
index 5936e6c..4b6accd 100644
--- a/priv/home.html.eex
+++ b/priv/home.html.eex
@@ -1,3 +1,10 @@
+<%
+{form_action_base, form_action_suffix} = case mode do
+ :discord_activity -> {"/.proxy/", "?#{Mediasync.Constants.query_param_discord_activity_inner()}"}
+ :normal -> {"/", ""}
+ _ -> raise ArgumentError
+end
+%>
<!DOCTYPE html>
<html lang="en">
@@ -9,7 +16,7 @@
</head>
<body>
- <form action="/host_room" method="post">
+ <form action="<%= form_action_base %>host_room<%= form_action_suffix %>" 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"
@@ -29,7 +36,6 @@
urlInput.reportValidity();
};
const urlInput = document.querySelector("input#host_room_input_video_url");
- checkURLInputValidity(urlInput);
urlInput.addEventListener("input", e => checkURLInputValidity(e.target));
})();
</script>