JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
d540026718223d42a740f806d3f960e955037f25
[watch-my-terminal.git] / index.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4         <title>Remote Terminal Viewer</title>
5         <script src="/jquery.js"></script>
6         <script src="/socket.io/socket.io.js"></script>
7         <script>
8                 $(function() {
9                         var $body = $('body');
10                         var lines = 0;
11                         var log = function (str) {
12                                 if(lines > 66) {
13                                         $($body.children().get(0)).remove();
14                                 } else {
15                                         lines += 1;
16                                 }
17                                 $body.append($('<div>').text(str));
18                         };
19                         var socket = io.connect('http://localhost');
20                         socket.on('write', function (data) {
21                                 log(data);
22                         });
23                 });
24         </script>
25         <style>
26                 body {
27                         color: white;
28                         background: black;
29                         font-family: monospace;
30                         font-size: 12px;
31                         line-height: 14px;
32                         white-space: pre;
33                 }
34         </style>
35 </head>
36 <body>
37 </body>
38 </html>