Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
watch-my-terminal.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
plain text flows and wraps properly
[watch-my-terminal.git]
/
index.html
diff --git
a/index.html
b/index.html
index
d540026
..
091da51
100644
(file)
--- a/
index.html
+++ b/
index.html
@@
-7,18
+7,12
@@
<script>
$(function() {
var $body = $('body');
<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');
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>
});
});
</script>