Post --> Note

Closes #1411
This commit is contained in:
syuilo
2018-04-08 02:30:37 +09:00
parent c7106d250c
commit a1b490afa7
167 changed files with 4440 additions and 1762 deletions

View File

@@ -1,15 +1,15 @@
<template>
<div class="mk-repost-form">
<mk-post-preview :post="post"/>
<div class="mk-renote-form">
<mk-note-preview :note="note"/>
<template v-if="!quote">
<footer>
<a class="quote" v-if="!quote" @click="onQuote">%i18n:desktop.tags.mk-repost-form.quote%</a>
<button class="cancel" @click="cancel">%i18n:desktop.tags.mk-repost-form.cancel%</button>
<button class="ok" @click="ok" :disabled="wait">{{ wait ? '%i18n:desktop.tags.mk-repost-form.reposting%' : '%i18n:desktop.tags.mk-repost-form.repost%' }}</button>
<a class="quote" v-if="!quote" @click="onQuote">%i18n:desktop.tags.mk-renote-form.quote%</a>
<button class="cancel" @click="cancel">%i18n:desktop.tags.mk-renote-form.cancel%</button>
<button class="ok" @click="ok" :disabled="wait">{{ wait ? '%i18n:desktop.tags.mk-renote-form.reposting%' : '%i18n:desktop.tags.mk-renote-form.renote%' }}</button>
</footer>
</template>
<template v-if="quote">
<mk-post-form ref="form" :repost="post" @posted="onChildFormPosted"/>
<mk-post-form ref="form" :renote="note" @posted="onChildFormPosted"/>
</template>
</div>
</template>
@@ -18,7 +18,7 @@
import Vue from 'vue';
export default Vue.extend({
props: ['post'],
props: ['note'],
data() {
return {
wait: false,
@@ -28,13 +28,13 @@ export default Vue.extend({
methods: {
ok() {
this.wait = true;
(this as any).api('posts/create', {
repostId: this.post.id
(this as any).api('notes/create', {
renoteId: this.note.id
}).then(data => {
this.$emit('posted');
(this as any).apis.notify('%i18n:desktop.tags.mk-repost-form.success%');
(this as any).apis.notify('%i18n:desktop.tags.mk-renote-form.success%');
}).catch(err => {
(this as any).apis.notify('%i18n:desktop.tags.mk-repost-form.failure%');
(this as any).apis.notify('%i18n:desktop.tags.mk-renote-form.failure%');
}).then(() => {
this.wait = false;
});
@@ -59,9 +59,9 @@ export default Vue.extend({
<style lang="stylus" scoped>
@import '~const.styl'
.mk-repost-form
.mk-renote-form
> .mk-post-preview
> .mk-note-preview
margin 16px 22px
> footer