about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-07-10 16:28:51 -0400
committerJune McEnroe <june@causal.agency>2020-07-10 16:31:33 -0400
commitf94b37baf4304b901c93b5fee076738946e1820f (patch)
treea0ef905cf38e4c962d6622872ef99d87c854a2cd
parentAdd IRC colors and implement nick coloring (diff)
downloadscooper-f94b37baf4304b901c93b5fee076738946e1820f.tar.gz
scooper-f94b37baf4304b901c93b5fee076738946e1820f.zip
Add basic messages to table and attempt to style
-rw-r--r--default.css14
-rw-r--r--html.c9
2 files changed, 23 insertions, 0 deletions
diff --git a/default.css b/default.css
index 40d9e88..ddd0982 100644
--- a/default.css
+++ b/default.css
@@ -36,6 +36,20 @@ nav form {
 	margin-top: 1em;
 }
 
+table {
+	border-collapse: collapse;
+}
+tr {
+	vertical-align: top;
+}
+tr td:not(:last-child) {
+	padding-right: 1ch;
+}
+
+td.time {
+	white-space: nowrap;
+}
+
 td.nick {
 	text-align: right;
 }
diff --git a/html.c b/html.c
index c1e4b15..37e52b3 100644
--- a/html.c
+++ b/html.c
@@ -271,6 +271,14 @@ static enum kcgi_err eventNick(struct khtmlreq *html, struct Event event) {
 	return error;
 }
 
+static enum kcgi_err eventMessage(struct khtmlreq *html, struct Event event) {
+	if (!event.message) return KCGI_OK;
+	return 0
+		|| khtml_attr(html, KELEM_TD, KATTR_CLASS, "message", KATTR__MAX)
+		|| khtml_puts(html, event.message)
+		|| khtml_closeelem(html, 1);
+}
+
 static const char *Types[TypesLen] = {
 #define X(id, name) [id] = name,
 	ENUM_TYPE
@@ -290,5 +298,6 @@ enum kcgi_err htmlEvent(struct khtmlreq *html, struct Event event) {
 		|| eventNetwork(html, event)
 		|| eventContext(html, event)
 		|| eventNick(html, event)
+		|| eventMessage(html, event)
 		|| khtml_closeelem(html, 1);
 }