JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
plain text flows and wraps properly
[watch-my-terminal.git] / index.html
index d540026..091da51 100644 (file)
@@ -7,18 +7,12 @@
        <script>
                $(function() {
                        var $body = $('body');
-                       var lines = 0;
-                       var log = function (str) {
-                               if(lines > 66) {
-                                       $($body.children().get(0)).remove();
-                               } else {
-                                       lines += 1;
-                               }
-                               $body.append($('<div>').text(str));
-                       };
                        var socket = io.connect('http://localhost');
-                       socket.on('write', function (data) {
-                               log(data);
+                       socket.on('init', function (v) {
+                               $body.children().remove();
+                               for(i in v.text) {
+                                       $body.append($('<div>').text(v.text[i].join('')));
+                               }
                        });
                });
        </script>