user mention (#3771)
This commit is contained in:
@@ -60,6 +60,7 @@ init((launch) => {
|
||||
|
||||
const vm = this.$root.new(PostForm, {
|
||||
reply: o.reply,
|
||||
mention: o.mention,
|
||||
renote: o.renote
|
||||
});
|
||||
|
||||
|
@@ -5,6 +5,7 @@
|
||||
<mk-post-form ref="form"
|
||||
:reply="reply"
|
||||
:renote="renote"
|
||||
:mention="mention"
|
||||
:initial-text="initialText"
|
||||
:instant="instant"
|
||||
@posted="onPosted"
|
||||
@@ -27,6 +28,10 @@ export default Vue.extend({
|
||||
type: Object,
|
||||
required: false
|
||||
},
|
||||
mention: {
|
||||
type: Object,
|
||||
required: false
|
||||
},
|
||||
initialText: {
|
||||
type: String,
|
||||
required: false
|
||||
|
@@ -84,6 +84,10 @@ export default Vue.extend({
|
||||
type: Object,
|
||||
required: false
|
||||
},
|
||||
mention: {
|
||||
type: Object,
|
||||
required: false
|
||||
},
|
||||
initialText: {
|
||||
type: String,
|
||||
required: false
|
||||
@@ -172,6 +176,11 @@ export default Vue.extend({
|
||||
this.text = `@${this.reply.user.username}@${toASCII(this.reply.user.host)} `;
|
||||
}
|
||||
|
||||
if (this.mention) {
|
||||
this.text = this.mention.host ? `@${this.mention.username}@${toASCII(this.mention.host)}` : `@${this.mention.username}`;
|
||||
this.text += ' ';
|
||||
}
|
||||
|
||||
if (this.reply && this.reply.text != null) {
|
||||
const ast = parse(this.reply.text);
|
||||
|
||||
|
@@ -55,6 +55,7 @@
|
||||
<b>{{ user.followersCount | number }}</b>
|
||||
<i>{{ $t('followers') }}</i>
|
||||
</a>
|
||||
<button @click="mention"><fa icon="at"/></button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
@@ -126,6 +127,10 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
|
||||
mention() {
|
||||
this.$post({ mention: this.user });
|
||||
},
|
||||
|
||||
menu() {
|
||||
let menu = [{
|
||||
icon: ['fas', 'list'],
|
||||
@@ -365,6 +370,9 @@ main
|
||||
> i
|
||||
font-size 14px
|
||||
|
||||
> button
|
||||
color var(--text)
|
||||
|
||||
> nav
|
||||
position -webkit-sticky
|
||||
position sticky
|
||||
|
Reference in New Issue
Block a user