summaryrefslogtreecommitdiff
path: root/xP/public
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2022-09-11 21:30:51 +0200
committerPřemysl Eric Janouch <p@janouch.name>2022-09-11 21:50:09 +0200
commitc3a52b9e4cd346cf7b8964a69105fdcd30c4ec05 (patch)
tree463f582e7b33184737d0303c3ae982afd78a7fb1 /xP/public
parent96fc12bc4c852f1343a120126f1f46ac7cca447d (diff)
downloadxK-c3a52b9e4cd346cf7b8964a69105fdcd30c4ec05.tar.gz
xK-c3a52b9e4cd346cf7b8964a69105fdcd30c4ec05.tar.xz
xK-c3a52b9e4cd346cf7b8964a69105fdcd30c4ec05.zip
xP: indicate hidden buffer lines
Diffstat (limited to 'xP/public')
-rw-r--r--xP/public/xP.css13
-rw-r--r--xP/public/xP.js14
2 files changed, 24 insertions, 3 deletions
diff --git a/xP/public/xP.css b/xP/public/xP.css
index b4ce13c..53aa2c2 100644
--- a/xP/public/xP.css
+++ b/xP/public/xP.css
@@ -43,6 +43,9 @@ body {
bottom: -1px;
background: #ccc;
}
+button {
+ font: inherit;
+}
.middle {
flex: auto;
@@ -111,9 +114,8 @@ body {
font-weight: bold;
}
.unread {
- height: 1px;
grid-column: span 2;
- background: #ff5f00;
+ border-top: 1px solid #ff5f00;
}
.time {
padding: .1em .3em;
@@ -121,6 +123,13 @@ body {
color: #bbb;
border-right: 1px solid #ccc;
}
+.time.hidden:after {
+ border-top: .2em dotted #ccc;
+ display: block;
+ width: 50%;
+ margin: 0 auto;
+ content: "";
+}
.mark {
padding-right: .3em;
text-align: center;
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)