Skip to content

Commit

Permalink
RenoteよりQuote Resolve #344
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Nov 22, 2019
1 parent 2ebd6ab commit 3d11eed
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 85 deletions.
1 change: 0 additions & 1 deletion locales/cs-CZ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,6 @@ desktop/views/components/post-form.vue:
attach-location-information: "Přidat informace o lokaci"
hide-contents: "Schovat obsah"
reply-placeholder: "Odpovědět na tento příspěvěk"
quote-placeholder: "Citovat tento příspěvek"
submit: "Příspěvek"
reply: "Odpovědět"
renote: "Renotovat"
Expand Down
1 change: 0 additions & 1 deletion locales/de-DE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,6 @@ desktop/views/components/post-form.vue:
add-visible-user: "+Nutzer hinzufügen"
hide-contents: "Inhalt verstecken"
reply-placeholder: "Antworte auf diese Anmerkung..."
quote-placeholder: "Zitiere diese Anmerkung..."
submit: "Beitragsform"
reply: "Antworten"
renote: "Anmerkung"
Expand Down
4 changes: 2 additions & 2 deletions locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ desktop/views/components/post-form.vue:
attach-location-information: "Attach location information"
hide-contents: "Hide contents"
reply-placeholder: "Reply to this post..."
quote-placeholder: "Quote this Post..."
quote-placeholder: "Leave empty to Renote"
preview: "Preview"
submit: "Post"
reply: "Reply"
Expand Down Expand Up @@ -1554,7 +1554,7 @@ mobile/views/components/post-form.vue:
submit: "Post"
reply: "Reply"
renote: "Renote"
quote-placeholder: "Quote this post... (optional)"
quote-placeholder: "Leave empty to Renote"
reply-placeholder: "Reply to this note..."
cw-placeholder: "Comments for the post (optional)"
location-alert: "Your device does not provide location services"
Expand Down
1 change: 0 additions & 1 deletion locales/es-ES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,6 @@ desktop/views/components/post-form.vue:
attach-location-information: "Agregar localización"
hide-contents: "Esconder contenidos"
reply-placeholder: "Responder a esta nota..."
quote-placeholder: "Citar esta nota..."
submit: "Publicar"
reply: "Responder"
renote: "Republicar"
Expand Down
2 changes: 0 additions & 2 deletions locales/fr-FR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ desktop/views/components/post-form.vue:
attach-location-information: "Attacher des informations de localisation"
hide-contents: "Masquer les contenus"
reply-placeholder: "Répondre à cette note …"
quote-placeholder: "Citer cette note …"
submit: "Publier"
reply: "Répondre"
renote: "Republier"
Expand Down Expand Up @@ -1363,7 +1362,6 @@ mobile/views/components/post-form.vue:
submit: "Publier"
reply: "Répondre"
renote: "Republier"
quote-placeholder: "Citer ce billet ... (Facultatif)"
reply-placeholder: "Répondre à cette note"
cw-placeholder: "Commenter le contenu (optionnel)"
location-alert: "Votre appareil ne prend pas en charge les services de localisation"
Expand Down
6 changes: 3 additions & 3 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ desktop/views/components/post-form.vue:
attach-location-information: "位置情報を添付する"
hide-contents: "内容を隠す"
reply-placeholder: "この投稿への返信..."
quote-placeholder: "この投稿を引用..."
quote-placeholder: "ここを空のままにするとRenoteになります"
preview: "プレビュー"
submit: "投稿"
reply: "返信"
Expand Down Expand Up @@ -1074,7 +1074,7 @@ desktop/views/components/renote-form.vue:
failure: "Renoteに失敗しました"

desktop/views/components/renote-form-window.vue:
title: "この投稿をRenoteしますか?"
title: "引用して投稿"

desktop/views/pages/user-following-or-followers.vue:
following: "{user}のフォロー"
Expand Down Expand Up @@ -1725,7 +1725,7 @@ mobile/views/components/post-form.vue:
submit: "投稿"
reply: "返信"
renote: "Renote"
quote-placeholder: "この投稿を引用... (オプション)"
quote-placeholder: "ここを空のままにするとRenoteになります"
reply-placeholder: "この投稿への返信..."
cw-placeholder: "内容への注釈 (オプション)"
location-alert: "お使いの端末は位置情報に対応していません"
Expand Down
6 changes: 3 additions & 3 deletions locales/ja-KS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ desktop/views/components/post-form.vue:
attach-location-information: "いる場所くっつけるで"
hide-contents: "内容を隠す"
reply-placeholder: "この投稿への返信..."
quote-placeholder: "この投稿を引用..."
quote-placeholder: "ここを空のままにするとRenoteになります"
submit: "投稿"
reply: "返信"
renote: "Renote"
Expand Down Expand Up @@ -716,7 +716,7 @@ desktop/views/components/renote-form.vue:
success: "Renoteしたで!"
failure: "Renoteでけへん"
desktop/views/components/renote-form-window.vue:
title: "この投稿をRenoteしてもええか?"
title: "引用して投稿"
desktop/views/pages/user-following-or-followers.vue:
following: "{user}のフォロー"
followers: "{user}のフォロワー"
Expand Down Expand Up @@ -1139,7 +1139,7 @@ mobile/views/components/post-form.vue:
submit: "投稿"
reply: "返す"
renote: "Renote"
quote-placeholder: "この投稿を持ってくる(オプション)"
quote-placeholder: "ここを空のままにするとRenoteになります"
reply-placeholder: "この投稿への返信..."
cw-placeholder: "内容への注釈 (オプション)"
location-alert: "あんさんのつことる端末は位置情報に対応しとらんみたいやわ、知らんけど。"
Expand Down
2 changes: 0 additions & 2 deletions locales/ko-KR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,6 @@ desktop/views/components/post-form.vue:
attach-location-information: "위치정보를 첨부하기"
hide-contents: "내용 숨기기"
reply-placeholder: "이 글에 답글..."
quote-placeholder: "이 글을 인용..."
submit: "글쓰기"
reply: "답글 달기"
renote: "리노트"
Expand Down Expand Up @@ -1465,7 +1464,6 @@ mobile/views/components/post-form.vue:
submit: "글쓰기"
reply: "답글 달기"
renote: "리노트"
quote-placeholder: "이 글을 인용... (선택적)"
reply-placeholder: "이 글에 답글..."
cw-placeholder: "내용 주석 (선택적)"
location-alert: "사용하시는 장치가 위치정보 기능에 대응하지 않습니다"
Expand Down
1 change: 0 additions & 1 deletion locales/nl-NL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ desktop/views/components/notifications.vue:
empty: "Geen meldingen"
desktop/views/components/post-form.vue:
reply-placeholder: "Deze notitie beantwoorden..."
quote-placeholder: "Deze notitie citeren..."
submit: "Bericht"
reply: "Beantwoorden"
posted: "Geplaatst!"
Expand Down
2 changes: 0 additions & 2 deletions locales/pl-PL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,6 @@ desktop/views/components/post-form.vue:
attach-location-information: "Załącz informacje o lokalizacji"
hide-contents: "Ukryj zawartość"
reply-placeholder: "Odpowiedz na ten wpis…"
quote-placeholder: "Zacytuj ten wpis…"
submit: "Wyślij"
reply: "Odpowiedz"
renote: "Udostępnienie"
Expand Down Expand Up @@ -1087,7 +1086,6 @@ mobile/views/components/post-form.vue:
submit: "Wyślij"
reply: "Odpowiedz"
renote: "Udostępnij"
quote-placeholder: "Zacytuj ten wpis… (nieobowiązkowe)"
reply-placeholder: "Odpowiedź na ten wpis…"
cw-placeholder: "Treść ostrzeżenia (opcjonalnie)"
location-alert: "Twoje urządzenie nie pozwala na przekazywanie informacji o lokalizacji"
Expand Down
2 changes: 0 additions & 2 deletions locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,6 @@ desktop/views/components/post-form.vue:
attach-location-information: "添加位置信息"
hide-contents: "隐藏内容"
reply-placeholder: "回复这个帖子"
quote-placeholder: "引用这个帖子…"
submit: "投稿"
reply: "回复"
renote: "转发"
Expand Down Expand Up @@ -1464,7 +1463,6 @@ mobile/views/components/post-form.vue:
submit: "帖子"
reply: "回复"
renote: "Renote"
quote-placeholder: "引用这个帖子t... (可选)"
reply-placeholder: "回复这个帖子"
cw-placeholder: "评论帖子(可选)"
location-alert: "您的设备不提供定位服务"
Expand Down
2 changes: 1 addition & 1 deletion src/client/app/desktop/views/components/post-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default Vue.extend({
},
submitText(): string {
return this.renote
return this.renote && !this.text.length && !this.files.length && !this.poll
? this.$t('renote')
: this.reply
? this.$t('reply')
Expand Down
62 changes: 1 addition & 61 deletions src/client/app/desktop/views/components/renote-form.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,7 @@
<template>
<div class="mk-renote-form">
<mk-note-preview class="preview" :note="note"/>
<template v-if="!quote">
<footer>
<div class="buttons">
<a class="quote" v-if="!quote" @click="onQuote">{{ $t('quote') }}</a>
<ui-button class="button cancel" inline @click="cancel">{{ $t('cancel') }}</ui-button>
<ui-button class="button ok" inline :primary="visibility == 'public'" @click="ok('public')" :disabled="wait">
<fa icon="globe"/> {{ 'Renote' }}
</ui-button>
<ui-button class="button home" inline :primary="visibility == 'home'" @click="ok('home')" :disabled="wait">
<fa icon="home"/> {{ 'Renote' }}
</ui-button>
</div>
</footer>
</template>
<template v-if="quote">
<template>
<mk-post-form ref="form" :renote="note" @posted="onChildFormPosted"/>
</template>
</div>
Expand All @@ -38,39 +24,10 @@ export default Vue.extend({
data() {
return {
wait: false,
quote: false,
visibility: 'home'
};
},
methods: {
ok(v: string) {
this.wait = true;
this.$root.api('notes/create', {
renoteId: this.note.id,
visibility: v || this.visibility
}).then(data => {
this.$emit('posted');
this.$notify(this.$t('success'));
}).catch(err => {
this.$notify(this.$t('failure'));
}).then(() => {
this.wait = false;
});
},
cancel() {
this.$emit('canceled');
},
onQuote() {
this.quote = true;
this.$nextTick(() => {
(this.$refs.form as any).focus();
});
},
onChildFormPosted() {
this.$emit('posted');
}
Expand All @@ -83,22 +40,5 @@ export default Vue.extend({
> .preview
margin 16px 22px
> footer
height 72px
background var(--desktopRenoteFormFooter)
> .buttons
display flex
padding 12px
align-items center
> .quote
display block
margin-right auto
margin-left 8px
> .button
display block
margin 4px
</style>
6 changes: 3 additions & 3 deletions src/client/app/mobile/views/components/post-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default Vue.extend({
quote: {
type: Boolean,
required: false,
default: false
default: true
},
initialText: {
type: String,
Expand Down Expand Up @@ -182,15 +182,15 @@ export default Vue.extend({
];
const x = xs[Math.floor(Math.random() * xs.length)];
return this.renote
return this.renote && !this.text.length && !this.files.length && !this.poll
? this.$t('quote-placeholder')
: this.reply
? this.$t('reply-placeholder')
: x;
},
submitText(): string {
return (this.renote && !this.quote)
return this.renote && !this.text.length && !this.files.length && !this.poll
? this.$t('renote')
: this.reply
? this.$t('reply')
Expand Down

0 comments on commit 3d11eed

Please sign in to comment.