ssb: Slight improvements to blog header display.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"type": "tildefriends-app",
|
"type": "tildefriends-app",
|
||||||
"emoji": "🦀",
|
"emoji": "🦀",
|
||||||
"previous": "&t4hk+Y6NB+TftzDLhJ9gUKLPU5YcFYvTEbJuTT2qPCQ=.sha256"
|
"previous": "&QdW1N8dMttww41AFP9qNRor9P9Rsiamnl/YQSJiviQE=.sha256"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -196,26 +196,6 @@ class TfMessageElement extends LitElement {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
flag(event) {
|
|
||||||
let reason = prompt(
|
|
||||||
'What is the reason for reporting this content (spam, nsfw, ...)?',
|
|
||||||
'offensive'
|
|
||||||
);
|
|
||||||
if (reason !== undefined) {
|
|
||||||
tfrpc.rpc
|
|
||||||
.appendMessage(this.whoami, {
|
|
||||||
type: 'flag',
|
|
||||||
flag: {
|
|
||||||
link: this.message.id,
|
|
||||||
reason: reason.length ? reason : undefined,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
.catch(function (error) {
|
|
||||||
alert(error?.message);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
show_image(link) {
|
show_image(link) {
|
||||||
let div = document.createElement('div');
|
let div = document.createElement('div');
|
||||||
div.style.left = 0;
|
div.style.left = 0;
|
||||||
@@ -519,14 +499,11 @@ class TfMessageElement extends LitElement {
|
|||||||
</button>
|
</button>
|
||||||
`
|
`
|
||||||
: undefined}
|
: undefined}
|
||||||
<button class="w3-button w3-bar-item" @click=${this.react}>
|
|
||||||
👍 React
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
class="w3-button w3-bar-item w3-border-bottom"
|
class="w3-button w3-bar-item w3-border-bottom"
|
||||||
@click=${this.flag}
|
@click=${this.react}
|
||||||
>
|
>
|
||||||
⚠️ Flag
|
👍 React
|
||||||
</button>
|
</button>
|
||||||
${formats.map(
|
${formats.map(
|
||||||
([format, name]) => html`
|
([format, name]) => html`
|
||||||
@@ -988,11 +965,7 @@ class TfMessageElement extends LitElement {
|
|||||||
style="cursor: pointer"
|
style="cursor: pointer"
|
||||||
@click=${(x) => this.toggle_expanded(':cw')}
|
@click=${(x) => this.toggle_expanded(':cw')}
|
||||||
>
|
>
|
||||||
<p>
|
<p>${content.contentWarning}</p>
|
||||||
${this.message.flags
|
|
||||||
? `Caution: This message has been flagged ${this.message.flags.length} time${this.message.flags.length == 1 ? '' : 's'}.`
|
|
||||||
: content.contentWarning}
|
|
||||||
</p>
|
|
||||||
<p class="w3-small">
|
<p class="w3-small">
|
||||||
${this.is_expanded(':cw') ? 'Show less' : 'Show more'}
|
${this.is_expanded(':cw') ? 'Show less' : 'Show more'}
|
||||||
</p>
|
</p>
|
||||||
@@ -1003,12 +976,11 @@ class TfMessageElement extends LitElement {
|
|||||||
<div @click=${this.body_click}>${body}</div>
|
<div @click=${this.body_click}>${body}</div>
|
||||||
${this.render_mentions()}
|
${this.render_mentions()}
|
||||||
`;
|
`;
|
||||||
let payload =
|
let payload = content.contentWarning
|
||||||
this.message.flags || content.contentWarning
|
? self.expanded[(this.message.id || '') + ':cw']
|
||||||
? self.expanded[(this.message.id || '') + ':cw']
|
? html` ${content_warning} ${content_html} `
|
||||||
? html` ${content_warning} ${content_html} `
|
: content_warning
|
||||||
: content_warning
|
: content_html;
|
||||||
: content_html;
|
|
||||||
return this.render_frame(html`
|
return this.render_frame(html`
|
||||||
${this.render_header()}
|
${this.render_header()}
|
||||||
<div class="w3-container">${payload}</div>
|
<div class="w3-container">${payload}</div>
|
||||||
@@ -1048,11 +1020,15 @@ class TfMessageElement extends LitElement {
|
|||||||
case 'message':
|
case 'message':
|
||||||
body = html`
|
body = html`
|
||||||
<div
|
<div
|
||||||
style="border: 1px solid #fff; border-radius: 1em; padding: 8px; margin: 4px; cursor: pointer"
|
class="w3-border w3-theme-d4 w3-round"
|
||||||
@click=${(x) => self.toggle_expanded(':blog')}>
|
style="padding: 8px; margin: 4px; cursor: pointer"
|
||||||
|
@click=${(x) => self.toggle_expanded(':blog')}
|
||||||
|
>
|
||||||
<h2>${content.title}</h2>
|
<h2>${content.title}</h2>
|
||||||
<div style="display: flex; flex-direction: row">
|
<div style="display: flex; flex-direction: row; gap: 8px">
|
||||||
<img src=/${content.thumbnail}/view></img>
|
${content.thumbnail
|
||||||
|
? html`<img src=/${content.thumbnail}/view style="max-width: 25vw; max-height: 25vw"></img>`
|
||||||
|
: undefined}
|
||||||
<span>${content.summary}</span>
|
<span>${content.summary}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user