blob: f6fef0973898db28e03ed3330950aacda4369037 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
<h2>Create a channel</h2>
<form method="post" action="/">
<label for="passwordField">Password (optional)</label>
<input type="password" id="passwordField" name="password">
<input type="submit" id="randomButton" value="Generate random password">
<input type="submit" value="Create a new channel">
</form>
<br>
<hr>
<a href="/client">Test client</a> - <a href="https://github.com/Pacien/Webcastor">Sources</a>
<script type="text/javascript">
randomButton.addEventListener("click", function(event) {
event.preventDefault();
var randomPassword = Math.random().toString(36).substr(2, 10);
passwordField.type = "text";
passwordField.value = randomPassword;
});
passwordField.addEventListener("input", function(event) {
if (passwordField.value.length <= 1) {
passwordField.type = "password";
}
});
</script>
|