Created
August 15, 2010 05:17
-
-
Save toastdriven/525114 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <html> | |
| <head> | |
| <title>Commits</title> | |
| <script src="socket.io.js"></script> | |
| </head> | |
| <body> | |
| <script> | |
| io.setPath('/client/'); | |
| function message(obj){ | |
| console.log(obj); | |
| for(var commit_offset in obj) { | |
| var commit = obj[commit_offset]; | |
| var el = document.createElement('p'); | |
| el.innerHTML = ""+commit.team_name+" - "+commit.member_name+" commited "+commit.revision.slice(0,6)+"."; | |
| document.getElementById('commits').appendChild(el); | |
| document.getElementById('commits').scrollTop = 1000000; | |
| } | |
| } | |
| var socket = new io.Socket("localhost", {port: 8080}); | |
| socket.connect(); | |
| socket.on('message', function(data){ | |
| var obj = JSON.parse(data); | |
| message(obj); | |
| }); | |
| socket.send(''); | |
| </script> | |
| <h1>Commits</h1> | |
| <div id="commits"><p>Connecting...</p></div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment