-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQuestion.html
More file actions
90 lines (78 loc) · 2.73 KB
/
Question.html
File metadata and controls
90 lines (78 loc) · 2.73 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title> RaiseOn </title>
<link rel="stylesheet" href="css/style.css">
<script src='https://cdn.firebase.com/js/client/1.1.1/firebase.js'></script>
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js'></script>
<!-- // popup as "login" or "continue as anon"?
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#dialog" ).dialog();
});
</script>
</head>
<body>
<div id="dialog" title="Basic dialog">
<p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p>
</div>
-->
</head>
<body>
<h1>
<span class="raise">Raise</span>
<span class="on ">On</span>
</h1>
<div id="menu">
<ul>
<li><a href="Question.html">In Class</a></li>
<li><a href="Quiz.html">Quiz</a></li>
<li><a href="index.html">After School</a></li>
<li><a href="Contact.html">Contact Us</a></li>
<li> <a href="Sign up.html">Sign Up</a> </li>
</ul>
</div>
</br> </br> </br> </br>
<h2>
Welcome to class! Have a question? Type it in below!
</h2>
<SPAN style="margin: 10% 10% 10% 10%; font-family: 'Glegoo', serif; position: absolute; width: 80%; height:10; top: 20%; padding: 20px 20px">
<div id='messagesDiv'></div>
<input type='text' id='nameInput' placeholder='Name'>
<input type='text' id='messageInput' placeholder='Question'>
</br>
<div id="BUTTONS">
<button type="button" onclick="myDataRef.remove()">Reset</button>
<button type="button" onclick="location.reload()">Refresh</button>
</div>
</br> </br>
<script>
var myDataRef = new Firebase('https://roquestions.firebaseio.com/');
$('#messageInput').keypress(function (e) {
if (e.keyCode == 13) {
var name = $('#nameInput').val();
var text = $('#messageInput').val();
myDataRef.push({name: name, text: text});
$('#messageInput').val('');
}
});
myDataRef.on('child_added', function(snapshot) {
var message = snapshot.val();
displayChatMessage(message.name, message.text);
});
function displayChatMessage(name, text) {
$('<div/>').text(text).prepend($('<em/>').text(name+': ')).appendTo($('#messagesDiv'));
$('#messagesDiv')[0].scrollTop = $('#messagesDiv')[0].scrollHeight;
};
</script>
</SPAN>
</br>
</br>
</br>
</body>
</html>