From 8d961cd8053d931bc5040673a7f0272ad6637c2d Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Thu, 24 Apr 2025 12:35:36 -0400 Subject: [PATCH] ssb: Indicate that content warnings can be expanded. --- apps/ssb.json | 2 +- apps/ssb/tf-message.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/ssb.json b/apps/ssb.json index 61c9d28d..f9913b8e 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&Zv/eOewtUPxYuALmYV8v+JDKwH4+aN8zCTYFwB7oYEw=.sha256" + "previous": "&OZ/C4IMnH3MU1FTsImb1u25m1I8Wjic2SsEfMbJeCq8=.sha256" } diff --git a/apps/ssb/tf-message.js b/apps/ssb/tf-message.js index 9558f99b..36a01ad5 100644 --- a/apps/ssb/tf-message.js +++ b/apps/ssb/tf-message.js @@ -306,6 +306,10 @@ class TfMessageElement extends LitElement { ); } + is_expanded(tag) { + return this.expanded[(this.message.id || '') + (tag || '')]; + } + render_children() { let self = this; if (this.message.child_messages?.length) { @@ -678,11 +682,12 @@ class TfMessageElement extends LitElement { } let content_warning = html`
this.toggle_expanded(':cw')} >

${content.contentWarning}

+

${this.is_expanded(':cw') ? 'Show less' : 'Show more'}

`; let content_html = html`