mirror of
https://github.com/styppo/hamstr.git
synced 2024-10-18 13:33:22 +00:00
feat: interpolate mentions in posts & events
This commit is contained in:
parent
23f6763441
commit
a5c5bb66c1
@ -72,23 +72,7 @@
|
||||
@mouseup="finishClicking"
|
||||
>
|
||||
<Markdown v-if="event.kind === 1">
|
||||
{{ trimmedContent }}
|
||||
<template #append>
|
||||
<q-icon
|
||||
v-if="hasMore"
|
||||
name="more_horiz"
|
||||
color="primary"
|
||||
class="
|
||||
bg-white
|
||||
drop-shadow
|
||||
border-1
|
||||
px-2
|
||||
py-1
|
||||
ml-1
|
||||
-translate-y-1
|
||||
"
|
||||
/>
|
||||
</template>
|
||||
{{ content }}
|
||||
</Markdown>
|
||||
<Recommend v-else-if="event.kind === 2" :url="event.content" />
|
||||
</q-item-label>
|
||||
@ -125,17 +109,8 @@ export default {
|
||||
return null
|
||||
},
|
||||
|
||||
trimmedContent() {
|
||||
if (this.event.content.length > 280) {
|
||||
return this.event.content.slice(0, 270)
|
||||
}
|
||||
|
||||
return this.event.content
|
||||
},
|
||||
|
||||
hasMore() {
|
||||
if (this.event.content.length > 280) return true
|
||||
return false
|
||||
content() {
|
||||
return this.interpolateMentions(this.event.content, this.event.tags)
|
||||
},
|
||||
|
||||
showVerticalLineTop() {
|
||||
@ -161,7 +136,7 @@ export default {
|
||||
if (ev.target.tagName === 'A') return
|
||||
|
||||
if (this.clicking) this.toEvent(this.event.id)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -32,7 +32,7 @@
|
||||
class="text-xl my-4 font-sans break-words text-justify"
|
||||
style="hyphens: auto !important"
|
||||
>
|
||||
<Markdown>{{ event.content }}</Markdown>
|
||||
<Markdown>{{ content }}</Markdown>
|
||||
</div>
|
||||
<div class="flex items-center justify-between w-full">
|
||||
<q-icon
|
||||
@ -143,6 +143,9 @@ export default {
|
||||
.filter(([_, prefs]) => prefs.write)
|
||||
.map(([url, _]) => url)
|
||||
.filter(url => this.event.seen_on.indexOf(url) === -1)
|
||||
},
|
||||
content() {
|
||||
return this.interpolateMentions(this.event.content, this.event.tags)
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user