diff options
Diffstat (limited to 'views/home.html')
-rw-r--r-- | views/home.html | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/views/home.html b/views/home.html new file mode 100644 index 0000000..f6fef09 --- /dev/null +++ b/views/home.html | |||
@@ -0,0 +1,31 @@ | |||
1 | <h2>Create a channel</h2> | ||
2 | |||
3 | <form method="post" action="/"> | ||
4 | <label for="passwordField">Password (optional)</label> | ||
5 | <input type="password" id="passwordField" name="password"> | ||
6 | <input type="submit" id="randomButton" value="Generate random password"> | ||
7 | <input type="submit" value="Create a new channel"> | ||
8 | </form> | ||
9 | |||
10 | <br> | ||
11 | <hr> | ||
12 | |||
13 | <a href="/client">Test client</a> - <a href="https://github.com/Pacien/Webcastor">Sources</a> | ||
14 | |||
15 | <script type="text/javascript"> | ||
16 | randomButton.addEventListener("click", function(event) { | ||
17 | event.preventDefault(); | ||
18 | |||
19 | var randomPassword = Math.random().toString(36).substr(2, 10); | ||
20 | |||
21 | passwordField.type = "text"; | ||
22 | passwordField.value = randomPassword; | ||
23 | }); | ||
24 | |||
25 | passwordField.addEventListener("input", function(event) { | ||
26 | if (passwordField.value.length <= 1) { | ||
27 | passwordField.type = "password"; | ||
28 | } | ||
29 | }); | ||
30 | |||
31 | </script> | ||