An HTML-only Bluesky frontend

add facets finally

+18 -10
.actor.js.swp

This is a binary file and will not be displayed.

+12 -8
actor.js
··· 84 84 85 85 const feedList = []; 86 86 87 - feed.forEach(async (post) => { 87 + for (const post of feed) { 88 88 if (post.reply) { 89 89 const reply = post.reply.parent ? post.reply.parent : post.reply.root; 90 90 const author = reply.author; ··· 106 106 <td> 107 107 <table> 108 108 <tr><td><b>${reply.author.displayName ? reply.author.displayName : reply.author.handle}</b> (<a href="/profile/${reply.author.handle !== "handle.invalid" ? reply.author.handle : reply.author.did}/">@${reply.author.handle}</a>) &middot; ${DateTimeFormat.format(new Date(reply.record.createdAt))}</td></tr> 109 - <tr><td>${/*await getFacets(*/reply.record.text/*).then((res) => res.replaceAll("\n", "<br>"))*/}</td></tr> 109 + <tr><td>${await getFacets(reply.record.text).then((res) => res.replaceAll("\n", "<br>"))}</td></tr> 110 110 <tr><td><b>${reply.replyCount}</b> replies &middot; <b>${reply.repostCount}</b> reposts &middot; <b>${reply.likeCount}</b> likes</td></tr> 111 111 </table> 112 112 </td> ··· 125 125 <table> 126 126 ${actor.did !== author.did ? `<tr><td><i>Reposted by ${actor.displayName ? actor.displayName : actor.handle}</i></td></tr>` : ``} 127 127 <tr><td><b>${author.displayName ? author.displayName : author.handle}</b> (<a href="/profile/${author.handle !== "handle.invalid" ? author.handle : author.did }/">@${author.handle}</a>) &middot; ${DateTimeFormat.format(new Date(record.createdAt))}</td></tr> 128 - <tr><td><p>${/*await getFacets(*/record.text/*).then((res) => res.replaceAll("\n", "<br>"))*/}</p></td></tr> 128 + <tr><td><p>${await getFacets(record.text).then((res) => res.replaceAll("\n", "<br>"))}</p></td></tr> 129 + <tr><td> 130 + ${/*post.post.record.embed ? `<pre>${JSON.stringify(post.post.record.embed, null, 2)}</pre>` : */``} 131 + </td></tr> 129 132 <tr><td><b>${post.post.replyCount}</b> replies &middot; <b>${post.post.repostCount}</b> reposts &middot; <b>${post.post.likeCount}</b> likes</td></tr> 130 133 </table> 131 134 ${post.reply ? `</blockquote><hr>` : `<hr>`} 132 135 </td> 133 136 </tr> 134 137 `); 135 - }); 138 + } 136 139 137 140 if (cursor) { 138 141 feedList.push(` ··· 141 144 </tr> 142 145 `); 143 146 } 147 + 144 148 145 149 return ` 146 150 <table width="100%"> ··· 160 164 const { followers, cursor } = data; 161 165 162 166 const followersList = []; 163 - followers.forEach((follower) => { 167 + for (const follower of followers) { 164 168 followersList.push(` 165 169 <tr> 166 170 <td><b>${follower.displayName ? follower.displayName : follower.handle}</b> (<a href="/profile/${follower.handle !== "handle.invalid" ? follower.handle : follower.did}/">@${follower.handle}</a>)</td> 167 171 </tr>`); 168 - }); 172 + } 169 173 170 174 if (cursor) { 171 175 followersList.push(` ··· 199 203 const { follows, cursor } = data; 200 204 201 205 const followsList = []; 202 - follows.forEach((follow) => { 206 + for (const follow of follows) { 203 207 followsList.push(` 204 208 <tr> 205 209 <td><b>${follow.displayName ? follow.displayName : follow.handle}</b> (<a href="/profile/${follow.handle !== "handle.invalid" ? follow.handle : follow.did}/">@${follow.handle}</a>)</td> 206 210 </tr>`); 207 - }); 211 + } 208 212 209 213 if (cursor) { 210 214 followsList.push(`
+6 -2
facets.js
··· 9 9 10 10 for (const segment of rt.segments()) { 11 11 if (segment.isLink()) { 12 - res += `<a href="${segment.link?.uri}">${segment.text}</a>`; 12 + res += `<a href="${segment.link.uri}">${segment.text}</a>`; 13 13 } else if (segment.isMention()) { 14 - res += `<a href="/profile/${segment.mention?.did}/">${segment.text}</a>`; 14 + res += `<a href="/profile/${segment.mention.did}/">${segment.text}</a>`; 15 + } else if (segment.isTag()) { 16 + res += `<a href="https://bsky.app/hashtag/${segment.tag.tag}">${segment.text}</a>`; 15 17 } else { 16 18 res += segment.text; 17 19 } ··· 31 33 res += `<a href="${segment.link.uri}">${segment.text}</a>`; 32 34 } else if (segment.isMention()) { 33 35 res += `<a href="/profile/${segment.mention.did}/">${segment.text}</a>`; 36 + } else if (segment.isTag()) { 37 + res += `<a href="https://bsky.app/hashtag/${segment.tag.tag}">${segment.text}</a>`; 34 38 } else { 35 39 res += segment.text; 36 40 }