diff options
Diffstat (limited to 'termcast_server')
-rw-r--r-- | termcast_server/index.html | 23 | ||||
-rw-r--r-- | termcast_server/termcast.py | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/termcast_server/index.html b/termcast_server/index.html index 9696760..2ade843 100644 --- a/termcast_server/index.html +++ b/termcast_server/index.html @@ -308,12 +308,17 @@ socket.onmessage = function (e) { else if (type == "redraw_screen") { document.querySelector('.menu').style.setProperty('display', 'none'); var termdiv = document.querySelector('.term'); + var hideNext = false; term = '<table class="screen">'; data.screen.forEach(function (row) { term += '<tr>'; row.forEach(function (cell) { term += '<td'; - if (cell.f != null || cell.b != null || cell.i || cell.u || cell.n) { + if (cell.w) { + term += ' colspan="2"'; + hideNext = true; + } + if (cell.f != null || cell.b != null || cell.i || cell.u || cell.n || hideNext) { var fgcolor = cell.f; var bgcolor = cell.b; var inverse = cell.n; @@ -341,6 +346,10 @@ socket.onmessage = function (e) { if (cell.u) { term += 'text-decoration: underline;'; } + if (hideNext) { + term += 'display: none;'; + hideNext = false; + } term += '"'; } term += '>'; @@ -419,6 +428,18 @@ socket.onmessage = function (e) { td.style.removeProperty('text-decoration'); } } + if (update.cell.hasOwnProperty('w')) { + if (update.cell.w) { + console.log("setting colspan to 2"); + tr.children[update.col + 1].style.setProperty('display', 'none'); + td.colSpan = 2; + } + else { + console.log("setting colspan to 1"); + tr.children[update.col + 1].style.setProperty('display', 'block'); + td.colSpan = 1; + } + } }) } else if (type == "streamer_disconnect") { diff --git a/termcast_server/termcast.py b/termcast_server/termcast.py index 909c352..8a4e98a 100644 --- a/termcast_server/termcast.py +++ b/termcast_server/termcast.py @@ -77,6 +77,7 @@ class Handler(object): "i": cell.italic(), "u": cell.underline(), "n": cell.inverse(), + "w": cell.is_wide(), }) return term @@ -96,6 +97,7 @@ class Handler(object): "i": cell.italic(), "u": cell.underline(), "n": cell.inverse(), + "w": cell.is_wide(), } ) |