-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate_stream.html
More file actions
34 lines (31 loc) · 1.28 KB
/
update_stream.html
File metadata and controls
34 lines (31 loc) · 1.28 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
<html>
<head><title>test</title></head>
<script src="socket.io/socket.io.js"></script>
<body>
<script>
function init(){
window.userid=window.parent.document.getElementById("userid").value;
}
var socket = io.connect('http://localhost:8000');
socket.on('pullnewpost', function (postinfo) {
//if (window.userid!=postinfo["posterid"])
//{
if (postinfo["link"]!=0 && postinfo["asker"]==window.userid)
{
// Alert user that their question received a reply.
}
// Check if post is from someone they follow
if (postinfo["link"]==0)
window.parent.showmsg("New question by "+postinfo["poster_firstname"]+" "+postinfo["poster_lastname"]+" about "+postinfo["coursename"]);
window.parent.submit();
//}
});
socket.on("like",function(postinfo){
if (window.userid!=postinfo["posterid"])
});
function edittedpost(postinfo){
socket.emit('newpost',postinfo);
}
</script>
</body>
</html>