From c3a52b9e4cd346cf7b8964a69105fdcd30c4ec05 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Sun, 11 Sep 2022 21:30:51 +0200 Subject: xP: indicate hidden buffer lines --- xP/public/xP.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'xP/public/xP.js') diff --git a/xP/public/xP.js b/xP/public/xP.js index ced93e9..f80182a 100644 --- a/xP/public/xP.js +++ b/xP/public/xP.js @@ -580,13 +580,20 @@ let Buffer = { return m('.buffer') let lastDateMark = undefined + let squashing = false 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) + + if (!line.isUnimportant || !b.hideUnimportant) { + squashing = false + } else if (squashing) { return + } else { + squashing = true + } let date = new Date(line.when) let dateMark = date.toLocaleDateString() @@ -594,6 +601,11 @@ let Buffer = { lines.push(m('.date', {}, dateMark)) lastDateMark = dateMark } + if (squashing) { + lines.push(m('.time.hidden')) + lines.push(m('.content')) + return + } let attrs = {} if (line.leaked) -- cgit v1.2.3-70-g09d2