aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xP/public/xP.js18
1 files changed, 7 insertions, 11 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js
index 46b567a..af20c2b 100644
--- a/xP/public/xP.js
+++ b/xP/public/xP.js
@@ -171,8 +171,9 @@ rpc.addEventListener('BufferActivate', event => {
rpc.addEventListener('BufferLine', event => {
let e = event.detail, b = buffers.get(e.bufferName)
- if (b !== undefined)
- b.lines.push({when: e.when, rendition: e.rendition, items: e.items})
+ if (b === undefined)
+ return
+ b.lines.push({when: e.when, rendition: e.rendition, items: e.items})
})
rpc.addEventListener('BufferClear', event => {
@@ -204,11 +205,11 @@ function applyColor(fg, bg, inverse) {
if (inverse)
[fg, bg] = [bg >= 0 ? bg : 15, fg >= 0 ? fg : 0]
- let style = ''
+ let style = {}
if (fg >= 0)
- style += `color: ${palette[fg]};`
+ style.color = palette[fg]
if (bg >= 0)
- style += `background-color: ${palette[bg]};`
+ style.backgroundColor = palette[bg]
if (style)
return style
}
@@ -399,9 +400,4 @@ let Main = {
},
}
-// TODO: Buffer names should work as routes.
-window.addEventListener('load', () => {
- m.route(document.body, '/', {
- '/': Main,
- })
-})
+window.addEventListener('load', () => m.mount(document.body, Main))