@@ -4,7 +4,7 @@ import signin from './signin.vue';
|
||||
import signup from './signup.vue';
|
||||
import forkit from './forkit.vue';
|
||||
import nav from './nav.vue';
|
||||
import postHtml from './post-html';
|
||||
import noteHtml from './note-html';
|
||||
import poll from './poll.vue';
|
||||
import pollEditor from './poll-editor.vue';
|
||||
import reactionIcon from './reaction-icon.vue';
|
||||
@@ -29,7 +29,7 @@ Vue.component('mk-signin', signin);
|
||||
Vue.component('mk-signup', signup);
|
||||
Vue.component('mk-forkit', forkit);
|
||||
Vue.component('mk-nav', nav);
|
||||
Vue.component('mk-post-html', postHtml);
|
||||
Vue.component('mk-note-html', noteHtml);
|
||||
Vue.component('mk-poll', poll);
|
||||
Vue.component('mk-poll-editor', pollEditor);
|
||||
Vue.component('mk-reaction-icon', reactionIcon);
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<img src="/assets/desktop/messaging/delete.png" alt="Delete"/>
|
||||
</button>
|
||||
<div class="content" v-if="!message.isDeleted">
|
||||
<mk-post-html class="text" v-if="message.text" ref="text" :text="message.text" :i="os.i"/>
|
||||
<mk-note-html class="text" v-if="message.text" ref="text" :text="message.text" :i="os.i"/>
|
||||
<div class="file" v-if="message.file">
|
||||
<a :href="message.file.url" target="_blank" :title="message.file.name">
|
||||
<img v-if="message.file.type.split('/')[0] == 'image'" :src="message.file.url" :alt="message.file.name"/>
|
||||
|
@@ -9,7 +9,7 @@ const flatten = list => list.reduce(
|
||||
(a, b) => a.concat(Array.isArray(b) ? flatten(b) : b), []
|
||||
);
|
||||
|
||||
export default Vue.component('mk-post-html', {
|
||||
export default Vue.component('mk-note-html', {
|
||||
props: {
|
||||
text: {
|
||||
type: String,
|
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div class="mk-post-menu">
|
||||
<div class="mk-note-menu">
|
||||
<div class="backdrop" ref="backdrop" @click="close"></div>
|
||||
<div class="popover" :class="{ compact }" ref="popover">
|
||||
<button v-if="post.userId == os.i.id" @click="pin">%i18n:common.tags.mk-post-menu.pin%</button>
|
||||
<button v-if="note.userId == os.i.id" @click="pin">%i18n:common.tags.mk-note-menu.pin%</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -12,7 +12,7 @@ import Vue from 'vue';
|
||||
import * as anime from 'animejs';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['post', 'source', 'compact'],
|
||||
props: ['note', 'source', 'compact'],
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
const popover = this.$refs.popover as any;
|
||||
@@ -51,7 +51,7 @@ export default Vue.extend({
|
||||
methods: {
|
||||
pin() {
|
||||
(this as any).api('i/pin', {
|
||||
postId: this.post.id
|
||||
noteId: this.note.id
|
||||
}).then(() => {
|
||||
this.$destroy();
|
||||
});
|
||||
@@ -83,7 +83,7 @@ export default Vue.extend({
|
||||
<style lang="stylus" scoped>
|
||||
$border-color = rgba(27, 31, 35, 0.15)
|
||||
|
||||
.mk-post-menu
|
||||
.mk-note-menu
|
||||
position initial
|
||||
|
||||
> .backdrop
|
@@ -22,7 +22,7 @@
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
export default Vue.extend({
|
||||
props: ['post'],
|
||||
props: ['note'],
|
||||
data() {
|
||||
return {
|
||||
showResult: false
|
||||
@@ -30,7 +30,7 @@ export default Vue.extend({
|
||||
},
|
||||
computed: {
|
||||
poll(): any {
|
||||
return this.post.poll;
|
||||
return this.note.poll;
|
||||
},
|
||||
total(): number {
|
||||
return this.poll.choices.reduce((a, b) => a + b.votes, 0);
|
||||
@@ -48,8 +48,8 @@ export default Vue.extend({
|
||||
},
|
||||
vote(id) {
|
||||
if (this.poll.choices.some(c => c.isVoted)) return;
|
||||
(this as any).api('posts/polls/vote', {
|
||||
postId: this.post.id,
|
||||
(this as any).api('notes/polls/vote', {
|
||||
noteId: this.note.id,
|
||||
choice: id
|
||||
}).then(() => {
|
||||
this.poll.choices.forEach(c => {
|
||||
|
@@ -25,7 +25,7 @@ import * as anime from 'animejs';
|
||||
const placeholder = '%i18n:common.tags.mk-reaction-picker.choose-reaction%';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['post', 'source', 'compact', 'cb'],
|
||||
props: ['note', 'source', 'compact', 'cb'],
|
||||
data() {
|
||||
return {
|
||||
title: placeholder
|
||||
@@ -68,8 +68,8 @@ export default Vue.extend({
|
||||
},
|
||||
methods: {
|
||||
react(reaction) {
|
||||
(this as any).api('posts/reactions/create', {
|
||||
postId: this.post.id,
|
||||
(this as any).api('notes/reactions/create', {
|
||||
noteId: this.note.id,
|
||||
reaction: reaction
|
||||
}).then(() => {
|
||||
if (this.cb) this.cb();
|
||||
|
@@ -17,10 +17,10 @@
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
export default Vue.extend({
|
||||
props: ['post'],
|
||||
props: ['note'],
|
||||
computed: {
|
||||
reactions(): number {
|
||||
return this.post.reactionCounts;
|
||||
return this.note.reactionCounts;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -1,21 +1,21 @@
|
||||
<template>
|
||||
<div class="mk-welcome-timeline">
|
||||
<div v-for="post in posts">
|
||||
<router-link class="avatar-anchor" :to="`/@${getAcct(post.user)}`" v-user-preview="post.user.id">
|
||||
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=96`" alt="avatar"/>
|
||||
<div v-for="note in notes">
|
||||
<router-link class="avatar-anchor" :to="`/@${getAcct(note.user)}`" v-user-preview="note.user.id">
|
||||
<img class="avatar" :src="`${note.user.avatarUrl}?thumbnail&size=96`" alt="avatar"/>
|
||||
</router-link>
|
||||
<div class="body">
|
||||
<header>
|
||||
<router-link class="name" :to="`/@${getAcct(post.user)}`" v-user-preview="post.user.id">{{ getUserName(post.user) }}</router-link>
|
||||
<span class="username">@{{ getAcct(post.user) }}</span>
|
||||
<router-link class="name" :to="`/@${getAcct(note.user)}`" v-user-preview="note.user.id">{{ getUserName(note.user) }}</router-link>
|
||||
<span class="username">@{{ getAcct(note.user) }}</span>
|
||||
<div class="info">
|
||||
<router-link class="created-at" :to="`/@${getAcct(post.user)}/${post.id}`">
|
||||
<mk-time :time="post.createdAt"/>
|
||||
<router-link class="created-at" :to="`/@${getAcct(note.user)}/${note.id}`">
|
||||
<mk-time :time="note.createdAt"/>
|
||||
</router-link>
|
||||
</div>
|
||||
</header>
|
||||
<div class="text">
|
||||
<mk-post-html :text="post.text"/>
|
||||
<mk-note-html :text="note.text"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -31,7 +31,7 @@ export default Vue.extend({
|
||||
data() {
|
||||
return {
|
||||
fetching: true,
|
||||
posts: []
|
||||
notes: []
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@@ -42,14 +42,14 @@ export default Vue.extend({
|
||||
getUserName,
|
||||
fetch(cb?) {
|
||||
this.fetching = true;
|
||||
(this as any).api('posts', {
|
||||
(this as any).api('notes', {
|
||||
reply: false,
|
||||
repost: false,
|
||||
renote: false,
|
||||
media: false,
|
||||
poll: false,
|
||||
bot: false
|
||||
}).then(posts => {
|
||||
this.posts = posts;
|
||||
}).then(notes => {
|
||||
this.notes = notes;
|
||||
this.fetching = false;
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user