summaryrefslogtreecommitdiff
path: root/xP/public/xP.js
diff options
context:
space:
mode:
Diffstat (limited to 'xP/public/xP.js')
-rw-r--r--xP/public/xP.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js
index 864323a..2e7732e 100644
--- a/xP/public/xP.js
+++ b/xP/public/xP.js
@@ -171,6 +171,7 @@ rpc.addEventListener('BufferUpdate', event => {
buffers.set(e.bufferName, (b = {lines: []}))
resetBufferStats(b)
}
+ b.hideUnimportant = e.hideUnimportant
})
rpc.addEventListener('BufferStats', event => {
@@ -465,6 +466,11 @@ let Buffer = {
let markBefore = b.lines.length
- b.newMessages - b.newUnimportantMessages
b.lines.forEach((line, i) => {
+ if (i == markBefore)
+ lines.push(m('.unread'))
+ if (line.isUnimportant && b.hideUnimportant)
+ return
+
let date = new Date(line.when)
let dateMark = date.toLocaleDateString()
if (dateMark !== lastDateMark) {
@@ -472,14 +478,10 @@ let Buffer = {
lastDateMark = dateMark
}
- if (i == markBefore)
- lines.push(m('.unread'))
-
let attrs = {}
if (line.leaked)
attrs.class = 'leaked'
- // TODO: Make use of isUnimportant.
lines.push(m('.time', {...attrs}, date.toLocaleTimeString()))
lines.push(m(Content, {...attrs}, line))
})
@@ -604,6 +606,7 @@ let Main = {
return m('.xP', {}, [
m('.title', {}, [`xP (${state})`, m(Toolbar)]),
m('.middle', {}, [m(BufferList), m(BufferContainer)]),
+ // TODO: Indicate hideUnimportant.
m('.status', {}, bufferCurrent),
m(Input),
])