$body = $('body')
$body.css backgroundColor: "##{palette[0]}", color: "##{palette[7]}"
- socket = io.connect('http://localhost')
+ socket = io.connect('/')
color_to_css = (i) ->
# handle inverse bit
return 'background-' + color_to_css(i ^ 0x080000)
stylize = (txt, style) ->
- if (txt.length == 0 or style == 0x000007)
- return txt
+ return '' if txt.length is 0
+ return $('<span>').text txt if style is 0x000007
css = ''
css += 'font-weight: bold; ' if style & 0x010000
css += 'text-decoration: underline; ' if style & 0x020000
socket.on 'init', (v) ->
term = terminal.new(v.width, v.height)
- term.x = v.x
- term.y = v.y
- term.a = v.a
- term.text = v.text
- term.attributes = v.attributes
- term.cursor_visible = v.cursor_visible
- redraw()
+ update v.text