Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[from now] 2012/04/07 14:55:41

diff --git a/browser/index.html b/browser/index.html
index 2644320..8b1b468 100644
--- a/browser/index.html
+++ b/browser/index.html
@@ -10,6 +10,7 @@
 </head>
 <body>
   <div id="display">
+    <div>Viewers: <span id="counter">0</span></div>
   </div>
 </body>
 </html>
diff --git a/browser/main.js b/browser/main.js
index de37b1f..6feced3 100644
--- a/browser/main.js
+++ b/browser/main.js
@@ -10,6 +10,12 @@ window.onload = function () {
     socket.emit('create');
   });

+  var counter = document.getElementById('counter');
+
+  socket.on('counter', function (num) {
+    counter.innerText = num;
+  });
+
   socket.on('input', function (data) {
     term.write(data);
   });
  • Loading branch information...
commit 80cb0e6e185676c2fa360d6109dc41e0d670ff8c 1 parent cb25d2b
@KOBA789 authored
Showing with 7 additions and 0 deletions.
  1. +1 −0  browser/index.html
  2. +6 −0 browser/main.js
View
1  browser/index.html
@@ -10,6 +10,7 @@
</head>
<body>
<div id="display">
+ <div>Viewers: <span id="counter">0</span></div>
</div>
</body>
</html>
View
6 browser/main.js
@@ -10,6 +10,12 @@ window.onload = function () {
socket.emit('create');
});
+ var counter = document.getElementById('counter');
+
+ socket.on('counter', function (num) {
+ counter.innerText = num;
+ });
+
socket.on('input', function (data) {
term.write(data);
});
Please sign in to comment.
Something went wrong with that request. Please try again.