-
Notifications
You must be signed in to change notification settings - Fork 226
/
Copy pathchatfix.html
53 lines (46 loc) · 1.61 KB
/
chatfix.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<!DOCTYPE html>
<html>
<head>
<title>Join Chat</title>
<script src='/everypage.js'></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
</head>
<body>
<ul class="nav justify-content-center">
<li class="nav-item">
</li>
</ul>
<div class="container pt-3">
<br>
<div class="jumbotron">
<ul id="form-control" style='max-height: 200px;overflow-y:scroll;'>
</ul>
<h3>Temporary Chat <br>(Other one is very broken)</h3>
<form id="form">
<div class="form-group">
<label for="input">Username: </label>
<input type="text" class="form-control" id="input" aria-describedby="messageH" required placeholder="Type Your Username" maxlength="16"><br>
<button type="submit" class="btn btn-primary">Join</button><br>
<div class="fixed-bottom" id='active'>
</div>
</div>
</form>
</div>
</div>
<script>
const messageForm = document.getElementById('form');
const textInput = document.getElementById('input');
if (localStorage.chatUsername) {
textInput.value = localStorage.chatUsername;
}
messageForm.addEventListener('submit', function(e) {
e.preventDefault();
if (textInput.value) {
localStorage.chatUsername = textInput.value;
document.write("<iframe style='border:0;position:fixed;width:100vw;height:100vh;' src="
+"https://6f972c4a-a213-4cf1-8305-0b9b7d540077.id.repl.co/#"+textInput.value+"></iframe>");
}
});
</script>
</body>
</html>