ssb: Bring back the date. Whoops.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 29m37s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 29m37s
This commit is contained in:
@ -377,9 +377,7 @@ class TfMessageElement extends LitElement {
|
||||
|
||||
render_menu() {
|
||||
let content = this.get_content();
|
||||
let formats = [
|
||||
['message', 'Message'],
|
||||
];
|
||||
let formats = [['message', 'Message']];
|
||||
if (content?.type == 'post' || content?.type == 'blog') {
|
||||
formats.push(['md', 'Markdown']);
|
||||
}
|
||||
@ -390,12 +388,33 @@ class TfMessageElement extends LitElement {
|
||||
return html`
|
||||
<div class="w3-bar-item w3-right w3-dropdown-hover">
|
||||
<button class="w3-button w3-theme-d1">%</button>
|
||||
<div class="w3-dropdown-content w3-bar-block w3-card-4 w3-theme-l1" style="right: 48px">
|
||||
<a target="_top" class="w3-button w3-bar-item" href=${'#' + encodeURIComponent(this.message?.id)}>${this.message?.id}</a>
|
||||
<button class="w3-button w3-bar-item w3-border-bottom" @click=${this.copy_id}>Copy ID</button>
|
||||
${formats.map(([format, name]) => (html`
|
||||
<button class="w3-button w3-bar-item" style=${format == this.format ? 'font-weight: bold' : ''} @click=${() => (this.format = format)}>${name}</button>
|
||||
`))}
|
||||
<div
|
||||
class="w3-dropdown-content w3-bar-block w3-card-4 w3-theme-l1"
|
||||
style="right: 48px"
|
||||
>
|
||||
<a
|
||||
target="_top"
|
||||
class="w3-button w3-bar-item"
|
||||
href=${'#' + encodeURIComponent(this.message?.id)}
|
||||
>${this.message?.id}</a
|
||||
>
|
||||
<button
|
||||
class="w3-button w3-bar-item w3-border-bottom"
|
||||
@click=${this.copy_id}
|
||||
>
|
||||
Copy ID
|
||||
</button>
|
||||
${formats.map(
|
||||
([format, name]) => html`
|
||||
<button
|
||||
class="w3-button w3-bar-item"
|
||||
style=${format == this.format ? 'font-weight: bold' : ''}
|
||||
@click=${() => (this.format = format)}
|
||||
>
|
||||
${name}
|
||||
</button>
|
||||
`
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@ -412,11 +431,10 @@ class TfMessageElement extends LitElement {
|
||||
<span class="w3-bar-item">
|
||||
<tf-user id=${this.message.author} .users=${this.users}></tf-user>
|
||||
</span>
|
||||
${is_encrypted}
|
||||
${this.render_menu()}
|
||||
<span class="w3-bar-item w3-right" style="text-wrap: nowrap"
|
||||
${new Date(this.message.timestamp).toLocaleString()}</span
|
||||
>
|
||||
${is_encrypted} ${this.render_menu()}
|
||||
<div class="w3-bar-item w3-right" style="text-wrap: nowrap">
|
||||
${new Date(this.message.timestamp).toLocaleString()}
|
||||
</div>
|
||||
</header>
|
||||
`;
|
||||
}
|
||||
|
@ -189,7 +189,7 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
UNION
|
||||
SELECT refs_in.message AS ref FROM messages_refs refs_in JOIN news ON refs_in.ref = news.id
|
||||
`,
|
||||
[JSON.stringify(result.map(x => x.id))]
|
||||
[JSON.stringify(result.map((x) => x.id))]
|
||||
);
|
||||
let t2 = new Date();
|
||||
let related_messages = await tfrpc.rpc.query(
|
||||
@ -199,7 +199,8 @@ class TfTabNewsFeedElement extends LitElement {
|
||||
JOIN json_each(?2) refs ON messages.id = refs.value
|
||||
JOIN json_each(?1) AS following ON messages.author = following.value
|
||||
`,
|
||||
[JSON.stringify(this.following), JSON.stringify(refs.map(x => x.ref))]);
|
||||
[JSON.stringify(this.following), JSON.stringify(refs.map((x) => x.ref))]
|
||||
);
|
||||
result = [].concat(result, related_messages);
|
||||
let t3 = new Date();
|
||||
console.log(
|
||||
|
Reference in New Issue
Block a user